Skip to content

Commit

Permalink
implement cpu issue softmax
Browse files Browse the repository at this point in the history
  • Loading branch information
fishingguy456 committed Mar 9, 2024
1 parent 713b016 commit eafa10f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/hidet/graph/ops/softmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,6 @@ def softmax_kernel(xs: xdtype[shape], ys: xdtype[shape]):

return ir_module

def implement_cpu(self, working_dir: str) -> Union[IRModule, List[IRModule]]:
if self.inputs[0].type.dtype != float32:
return NotImplemented # use auto-scheduler
return tune.extract_ir_modules(self.schedule_softmax_cpu)


class CPUSoftmaxTask(SoftmaxTask):
def allow_epilogue(self) -> bool:
Expand All @@ -170,6 +165,11 @@ def allow_epilogue(self) -> bool:
def allow_prologue(self) -> bool:
return False

def implement_cpu(self, working_dir: str) -> Union[IRModule, List[IRModule]]:
if self.inputs[0].type.dtype != float32:
return NotImplemented # use auto-scheduler
return tune.extract_ir_modules(self.schedule_softmax_cpu)

@tune.space(2, nthreads=['', 4, 8, 16, 32, 64, 96])
@tune.space(1, nthreads=['', 8, 16])
def schedule_softmax_cpu(self, nthreads='') -> IRModule:
Expand Down

0 comments on commit eafa10f

Please sign in to comment.