Skip to content

[https://nvbugs/6705034][fix] Route zero-token causal-conv input to the channel-major kernel - #18571

Open
nv-guomingz wants to merge 1 commit into
NVIDIA:mainfrom
nv-guomingz:user/guomingz/fix_nvbug_6705034
Open

[https://nvbugs/6705034][fix] Route zero-token causal-conv input to the channel-major kernel#18571
nv-guomingz wants to merge 1 commit into
NVIDIA:mainfrom
nv-guomingz:user/guomingz/fix_nvbug_6705034

Conversation

@nv-guomingz

@nv-guomingz nv-guomingz commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Description

A zero-token x reaches causal_conv1d_fwd with 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:

RuntimeError: causal_conv1d_fwd: the channel-last path cannot run in-place; `out` must not overlap x

This broke unittest/_torch/modules/kimi_kda/test_kda_prefill_op.py::test_kda_mixer_empty_prefill on 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 == 0 to 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

  • Unwaives 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

  • PR title and description added
  • Test coverage: existing unit test unwaived

🤖 Generated with Claude Code

Dev Engineer Review

  • Routes seqlen == 0 inputs to the channel-major causal-convolution kernel.
  • Preserves existing channel-last selection for non-empty inputs.
  • Avoids empty channel-last launches and supports conv-state write-back.
  • Removes the DGX B200 waiver and associated NVBUG reference for test_kda_mixer_empty_prefill.
  • No public API changes or unintended configuration changes identified.

QA Engineer Review

  • Test-list change: removed test_kda_mixer_empty_prefill from tests/integration/test_lists/waives.txt.
  • No test-db or qa/ files were modified.
  • The test function was not changed. Its waiver was removed to enable coverage.
  • CBTS coverage data is unavailable.

Verdict: needs follow-up

…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>
@nv-guomingz
nv-guomingz requested a review from a team as a code owner September 2, 2026 02:57
@nv-guomingz

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 72a6018c-5a7f-4475-9894-ef3cc13330f9

📥 Commits

Reviewing files that changed from the base of the PR and between 84a59d6 and 3310718.

📒 Files selected for processing (2)
  • cpp/tensorrt_llm/thop/causalConv1dOp.cpp
  • tests/integration/test_lists/waives.txt
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The forward kernel selection now routes zero-token inputs to the channel-major kernel. The related DGX_B200 test waiver and NVBUG reference were removed.

Changes

Causal convolution empty-input handling

Layer / File(s) Summary
Zero-token kernel selection and waiver removal
cpp/tensorrt_llm/thop/causalConv1dOp.cpp, tests/integration/test_lists/waives.txt
causalConv1dFwd routes zero-token inputs to the channel-major kernel regardless of strides. The DGX_B200 waiver for test_kda_mixer_empty_prefill was removed.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 33107

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: bowenfu

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the NVBugs reference, fix type, and primary change: routing zero-token causal-convolution inputs to the channel-major kernel.
Description check ✅ Passed 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 expl…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

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.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #70879 [ run ] triggered by Bot. Commit: 3310718 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #70879 [ run ] completed with state FAILURE. Commit: 3310718
/LLM/main/L0_MergeRequest_PR pipeline #58051 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@nv-guomingz

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #70923 [ run ] triggered by Bot. Commit: 3310718 Link to invocation

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.

2 participants