[AMD] Fixed make_desc lowering - i.e., findEncodingFromUsers #9585
[AMD] Fixed make_desc lowering - i.e., findEncodingFromUsers #9585antiagainst merged 5 commits intotriton-lang:mainfrom
make_desc lowering - i.e., findEncodingFromUsers #9585Conversation
| if (!sharedEnc) { | ||
| // TODO: add an extra pass to assign layout to descriptors | ||
| sharedEnc = findEncodingFromUsers(op); | ||
| if (!sharedEnc) | ||
| return rewriter.notifyMatchFailure(op, "Descriptor has no layout."); | ||
| } |
There was a problem hiding this comment.
looks like a very fragile solution. might be worth doing a proper fix?
There was a problem hiding this comment.
@ThomasRaoux Well, the author is @yangshuxin. I believe he is working on a proper solution which may take a while. Meanwhile, this PR fixes the logic of findEncodingFromUsers which doesn't confirm the language syntax at its current implementation.
The kernel which were failing on GFX1250 is
triton/python/test/unit/language/test_tensor_descriptor.py
Lines 751 to 811 in 2adfa7a
The current implementation in the upstream assumes that the tensor descriptor definition and all uses are in the same basic block which is not always true.
There was a problem hiding this comment.
Yes this is temporary stop gap to avoid crashes; will be replaced with more proper implementation very soon.
| if (!sharedEnc) { | ||
| // TODO: add an extra pass to assign layout to descriptors | ||
| sharedEnc = findEncodingFromUsers(op); | ||
| if (!sharedEnc) | ||
| return rewriter.notifyMatchFailure(op, "Descriptor has no layout."); | ||
| } |
There was a problem hiding this comment.
Yes this is temporary stop gap to avoid crashes; will be replaced with more proper implementation very soon.
The PR fixes findEncodingFromUsers function used in make_desc op lowering by taking into account information about value uses in all basic blocks
Closes https://github.com/ROCm/triton-internal/issues/1598
cc @antiagainst