fix(pycute): logical_product with an int tiler computed logical_divide - #3479
Open
arcusbuilds wants to merge 2 commits into
Open
fix(pycute): logical_product with an int tiler computed logical_divide#3479arcusbuilds wants to merge 2 commits into
arcusbuilds wants to merge 2 commits into
Conversation
logical_product(layout, <int>) dispatched to logical_divide, returning a divide result under a product name. logical_product(layout, Layout(<int>)) was unaffected, so the two forms disagreed. The tuple-tiler, zipped_product and tiled_product paths all bottom out in the same branch and were broken with it. Recurse with Layout(tiler) instead, matching the C++ reference at include/cute/layout.hpp:1671. Adds test/python/pycute/test_product.py, the first coverage for logical_product, porting the post-conditions from test/unit/cute/core/logical_product.cpp and pinning the int and tuple tiler forms against their Layout equivalents. Signed-off-by: arcusbuilds <srijankeshri007@gmail.com>
…endored pycute operators/cutlass/operators/fusion/pycute/layout.py is a copy of python/pycute/layout.py and carries the identical defect. Kept as a separate commit so it can be dropped if this tree is a frozen vendored drop. Signed-off-by: arcusbuilds <srijankeshri007@gmail.com>
Contributor
|
The outdated NVIDIA/cutlass version of pycute needs to be removed and pointed to the complete and supported PyCuTe here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3478.
logical_product(layout, <int>)calledlogical_divide, so it returned a divide result. Recursing withLayout(tiler)reaches the correct branch, which is what the C++ reference does atinclude/cute/layout.hpp:1670.Before:
After:
The tuple-tiler,
zipped_productandtiled_productpaths bottom out in the same branch and are fixed with it. After the change the integer path delegates to theLayoutpath, so the two forms cannot diverge again.Adds
test/python/pycute/test_product.py. There was no test forlogical_productbefore. It ports the post-conditions fromtest/unit/cute/core/logical_product.cppover the same cases, and pins the integer and tuple forms against theirLayoutequivalents.run_all_tests.pydiscovers it automatically; the suite goes from 10 to 14 tests.The nine
Layout-tiler cases intest_logical_productpass both before and after the fix, since aLayouttiler skips the integer branch. They are the control: the other three tests failing while that one stays green shows the failure is the integer path and not the test file.The second commit applies the same one-word fix to
operators/cutlass/operators/fusion/pycute/layout.py, a copy of the same module. It is kept separate. Say the word and I will drop it if that tree is regenerated from an internal source.