Skip to content

Commit

Permalink
[Fix] Mark the reduce fp16 operator not fusible (#100)
Browse files Browse the repository at this point in the history
* mark the reduce fp16 operator not fusible

* lint

* format
  • Loading branch information
yaoyaoding committed Feb 13, 2023
1 parent f394b8a commit d97dc2f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python/hidet/graph/ops/definitions/reduce/reduce_f16.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ def reduce_fcompute(*reduce_indices):
},
)

def allow_prologue(self) -> bool:
return False

def allow_epilogue(self) -> bool:
rank = len(self.inputs[0].const_shape())
if rank - 1 in self.dims: # pylint: disable=simplifiable-if-statement
# use self.cuda_schedule_reduce_by_warp
return True
else:
# use self.cuda_schedule_reduce_by_default
return False

def implement_cuda(self, workding_dir: str) -> IRModule:
rank = len(self.inputs[0].const_shape())
if rank - 1 in self.dims:
Expand Down

0 comments on commit d97dc2f

Please sign in to comment.