-
Notifications
You must be signed in to change notification settings - Fork 128
[inductor] Fix a use before def error #956
Conversation
BEFORE:
AFTER:
|
There is still another error where
|
b089fb0
to
777059f
Compare
@@ -632,6 +638,7 @@ def indexing(self, index: sympy.Expr, copy_shape=None, dense_indexing=False): | |||
or indirect_indexing | |||
or self._load_mask is not None | |||
) and index != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The index != 0
here seems related, I think this was related to loading the random mask.
torchinductor/codegen/triton.py
Outdated
@@ -646,7 +653,7 @@ def indexing(self, index: sympy.Expr, copy_shape=None, dense_indexing=False): | |||
mask.append(f"{tree.prefix}mask") | |||
dense_mask.append(f"{tree.prefix}mask") | |||
|
|||
if need_dense and not have_dense: | |||
if (need_dense and not have_dense) or load_index0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not
if (need_dense and not have_dense) or load_index0: | |
if (need_dense and not have_dense) or index == 0: |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if this is safe to do if we are not calling from load
, but CI run suggests this is ok.
777059f
to
de3925a
Compare
wdym? How does it fail? |
The error I saw was,
Adding |
Summary: Change how tl.load with index 0 is done
Summary: for #918