fix: correct knob annotate() mem_space values and TileOp emission#60
Open
ymwangg wants to merge 1 commit into
Open
fix: correct knob annotate() mem_space values and TileOp emission#60ymwangg wants to merge 1 commit into
ymwangg wants to merge 1 commit into
Conversation
Two bugs in builder.py's annotate() function: 1. ms_map used 0-based values (Hbm=0, Psum=1, Sbuf=2, SharedHbm=3) but the C++ dialect defines them starting at 1 (NkipyAttrs.td). This caused annotate-memory-space pass to fail with type mismatches on return ops. 2. TileOp was called with a non-existent `reduction_tile` kwarg. The dialect only supports `loop_tile_size` which should contain the full iteration space (e.g. [M, N, K] for matmul). Now merges tile_size and reduction_tile into a single loop_tile_size array before emission.
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.
Summary
ms_mapinbuilder.py'sannotate()to use 1-based enum values matching the C++ dialect definition inNkipyAttrs.td(Hbm=1, Psum=2, Sbuf=3, SharedHbm=4)TileOpemission to mergetile_sizeandreduction_tileinto a singleloop_tile_sizearray, sinceTileOpdoesn't have areduction_tileattributeTest plan
Tested with #58
pytest tests/test_nkigen_numerical.py tests/test_nkigen_ops.py tests/unit/test_nkigen_backend.py -n auto— 45 passed, 8 xfailed (previously 32 failed)