Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call tl.view in arg{min,max} #1518

Merged
merged 2 commits into from
Apr 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions python/triton/language/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,9 +1255,10 @@ def _argreduce(input, axis, combine_fn, _builder=None, _generator=None):
index = arange(0, n, _builder=_builder)

if len(input.shape) > 1:
new_shape = [constexpr(1)] * len(input.shape)
new_shape[axis] = constexpr(n)
index = view(index, new_shape, _builder=_builder)
# Broadcast index across the non-reduced axes
expand_dims_index = [None] * len(input.shape)
expand_dims_index[axis] = slice(None)
index = index.__getitem__(expand_dims_index, _builder=_builder)
index = broadcast_to(index, input.shape, _builder=_builder)

rvalue, rindices = reduction((input, index), axis, combine_fn,
Expand Down