[https://nvbugs/6705034][fix] Route zero-token causal-conv input to the channel-major kernel - #18571
[https://nvbugs/6705034][fix] Route zero-token causal-conv input to the channel-major kernel#18571nv-guomingz wants to merge 1 commit into
Conversation
…he channel-major kernel A zero-token x reaches causal_conv1d_fwd with the strides its no-op transpose left behind (an empty tensor is always contiguous), so the stride-based layout classification saw it as channel-last, and the 0-byte x/out allocations alias each other, so the channel-last in-place guard rejected the call. Route seqlen == 0 to the channel-major kernel, which handles empty input (state write-back only) the way it did before the channel-last path existed. Unwaive unittest/_torch/modules/kimi_kda/test_kda_prefill_op.py::test_kda_mixer_empty_prefill. Signed-off-by: nv-guomingz <137257613+nv-guomingz@users.noreply.github.com>
|
/bot run |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. WalkthroughThe forward kernel selection now routes zero-token inputs to the channel-major kernel. The related DGX_B200 test waiver and NVBUG reference were removed. ChangesCausal convolution empty-input handling
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change routes zero-token causal-convolution inputs to the channel-major kernel and re-enables the targeted empty-prefill test; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description explains the zero-token stride and aliasing failure, the channel-major routing fix, and the relevant test coverage. It is mostly complete, although several checklist items are not explicitly addressed.
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
PR_Github #70879 [ run ] triggered by Bot. Commit: |
|
PR_Github #70879 [ run ] completed with state
|
|
/bot run --disable-fail-fast |
|
PR_Github #70923 [ run ] triggered by Bot. Commit: |
Description
A zero-token
xreachescausal_conv1d_fwdwith the strides its no-op transpose left behind (an empty tensor is always reported contiguous, so the caller's.contiguous()does not restride it). The stride-based layout classification therefore saw it as channel-last, and because 0-byte CUDA allocations can alias each other, the channel-last in-place guard rejected the call with:This broke
unittest/_torch/modules/kimi_kda/test_kda_prefill_op.py::test_kda_mixer_empty_prefillon DGX_B200 (https://nvbugs/6705034), waived in #18549.The channel-last kernel also cannot run an empty input anyway (zero token chunks would give an empty launch grid), so this change routes
seqlen == 0to the channel-major kernel, which handles empty input (conv-state write-back only) the way it always has before the channel-last path was introduced in #18081.Test Coverage
unittest/_torch/modules/kimi_kda/test_kda_prefill_op.py::test_kda_mixer_empty_prefill(DGX_B200), which exercises exactly this zero-token path.PR Checklist
🤖 Generated with Claude Code
Dev Engineer Review
seqlen == 0inputs to the channel-major causal-convolution kernel.test_kda_mixer_empty_prefill.QA Engineer Review
test_kda_mixer_empty_prefillfromtests/integration/test_lists/waives.txt.qa/files were modified.Verdict: needs follow-up