Skip to content

[DLight][CUDA] Fix undefined TX in GEMV broadcast epilogue#19970

Open
Nanmur wants to merge 1 commit into
apache:mainfrom
Nanmur:codex/fix-dlight-gemv-tx
Open

[DLight][CUDA] Fix undefined TX in GEMV broadcast epilogue#19970
Nanmur wants to merge 1 commit into
apache:mainfrom
Nanmur:codex/fix-dlight-gemv-tx

Conversation

@Nanmur

@Nanmur Nanmur commented Jul 9, 2026

Copy link
Copy Markdown

This PR fixes an undefined TX reference in the DLight GPU GEMV inner-reduction schedule.

The broadcast epilogue path splits fused epilogue loops and binds the inner loop to threadIdx.x, but it referenced TX, which is not defined in the surrounding scope or passed into the helper. This PR uses the existing TR tile factor, which is already used for the threadIdx.x direction in this schedule.

A regression test is added to cover the GEMV broadcast epilogue path.

Fixes #19969

Tests:

  • python -m pytest tests/python/s_tir/dlight/test_gpu_gemv.py -q
  • python -m pytest tests/python/s_tir/dlight/test_gpu_low_batch_gemv.py -q
  • python -m pytest tests/python/s_tir/dlight/test_gpu_reduction.py -q

Note: The branch is based on apache/tvm:main. Local main-branch test execution on this Windows machine could not be completed because the available compiled TVM library is from a v0.25 build and does not match the latest Python sources; the same tests passed in the matching local v0.25 environment before rebasing the patch to main.

The GEMV inner-reduction schedule handles broadcast epilogues by splitting the fused epilogue loops and binding the inner loop to threadIdx.x. This path referenced TX, but TX is not defined in the scope or passed into the inner scheduling helper.

Use the existing TR tile factor, which is already used for the threadIdx.x direction in this schedule, and add a regression test that covers the broadcast epilogue path.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the GPU GEMV schedule in python/tvm/s_tir/dlight/gpu/gemv.py by changing the split factor for the epilogue block from TX to TR. It also adds a new unit test test_gemv_broadcast_epilogue in tests/python/s_tir/dlight/test_gpu_gemv.py to validate this scheduling behavior. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Dlight]DLight GPU GEMV fails with undefined TX in broadcast epilogue path

1 participant