tqchen commented on PR #20063: URL: https://github.com/apache/tvm/pull/20063#issuecomment-5114436391
Repair report for the `optimize_llm.py` failure: - Reproduced the reported undefined `cross_thread_NT_matmul_intermediate_local` through the exact tutorial and reduced it to `thread_broadcast_2` through the full S-TIR pipeline. The first invalid module appeared after `LowerThreadAllreduce`. - The typed-buffer migration made the physical allocation root and sibling `DeclBuffer` aliases distinct logical buffer objects. `LowerThreadAllreduce` removed/remapped the root allocation, but some declaration/load/store remaps still used the logical alias, leaving an undefined buffer. A flat load-only repair also exposed a multi-group wrong-code case: alias-mediated stores could write `red_result[0]` instead of the group coordinate. - The fix canonicalizes declaration, load, store, allocation, and deferred remaps through the physical allocation root; defers declaration rewriting until the complete traversal has populated root maps; and remaps both the store buffer and its group-indexed coordinates. - No testcase was removed or changed by this PR series. The existing `thread_broadcast_2` test only exercised `LowerCrossThreadReduction`, so it never reached the failing `LowerThreadAllreduce`/`MakePackedAPI` path. This update adds that full-pipeline regression plus multi-group alias tests covering both store directions, declaration order, the positive `threadIdx_y` coordinate, and negative `[0]` race/fallback cases. Validation on head `83a9b865bb4ef7f43c02a31b0b8bcc0a6589062f`: - exact H200 `docs/how_to/tutorials/optimize_llm.py`: passed with NVRTC 13.1 - focused S-TIR/MakePackedAPI aggregate: 52 passed - CUDA codegen suites: 376 passed, 159 skipped - H200 MLA runtime suite: 4 passed - repository-wide pre-commit and `git diff --check`: passed - independent final review and fresh targeted regression run: clean, 16 passed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
