Skip to content

[None][fix] Set in_mtp_draft_loop on the synthetic DSA metadata stub - #17416

Merged
brnguyen2 merged 1 commit into
NVIDIA:mainfrom
brnguyen2:fix/dsa-req-idx-test-metadata
Aug 7, 2026
Merged

[None][fix] Set in_mtp_draft_loop on the synthetic DSA metadata stub#17416
brnguyen2 merged 1 commit into
NVIDIA:mainfrom
brnguyen2:fix/dsa-req-idx-test-metadata

Conversation

@brnguyen2

@brnguyen2 brnguyen2 commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

test_on_update_kv_lens_rebuilds_stale_map (added in #16925) builds its DSAtrtllmAttentionMetadata with object.__new__, bypassing __init__ — the only place in_mtp_draft_loop is initialized. The same PR made on_update_kv_lens() read that flag, so the test fails deterministically with

AttributeError: 'DSAtrtllmAttentionMetadata' object has no attribute 'in_mtp_draft_loop'

on every pre-merge CI run since it merged (seen on H100, B200, and B300 pre-merge stages across unrelated PRs).

Fix

Set the __init__ default (False) on the synthetic stub, matching how the test already stubs its other collaborators.

Validation

Full tests/unittest/_torch/attention/sparse/dsa/test_req_idx_per_token.py run on a Blackwell node: 11/11 pass.

Dev Engineer Review

  • Initialized md.in_mtp_draft_loop to False in the synthetic metadata fixture.
  • This fixes the deterministic AttributeError caused by bypassing DSAtrtllmAttentionMetadata.__init__.
  • The change matches the default initialization and has no API, performance, configuration, or regression impact.
  • No public entities or test-list files changed.

QA Engineer Review

  • Modified test_on_update_kv_lens_rebuilds_stale_map.
  • The full test file passed with 11/11 tests on a Blackwell node.
  • Coverage in tests/integration/test_lists/ was not provided.
  • Verdict: needs follow-up.

test_on_update_kv_lens_rebuilds_stale_map builds its metadata with
object.__new__, bypassing __init__ where in_mtp_draft_loop is
initialized. Since NVIDIA#16925 made on_update_kv_lens() read that flag, the
test fails with AttributeError on every pre-merge run. Set the __init__
default on the stub.

Signed-off-by: Brian Nguyen <brnguyen@nvidia.com>
@brnguyen2
brnguyen2 requested a review from a team as a code owner August 7, 2026 11:10
@brnguyen2
brnguyen2 requested review from kris1025 and yuxianq August 7, 2026 11:10
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Aug 7, 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: b90595c8-68e9-4886-ab83-cfb14a42d6cb

📥 Commits

Reviewing files that changed from the base of the PR and between 378136e and 614378b.

📒 Files selected for processing (1)
  • tests/unittest/_torch/attention/sparse/dsa/test_req_idx_per_token.py

Walkthrough

The test fixture now initializes in_mtp_draft_loop to False so on_update_kv_lens() can access the attribute during stale request-index map rebuilding tests.

Changes

DSA test fixture

Layer / File(s) Summary
Initialize metadata fixture state
tests/unittest/_torch/attention/sparse/dsa/test_req_idx_per_token.py
The fixture sets in_mtp_draft_loop to False after bypassing DSAtrtllmAttentionMetadata.__init__.

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

Possibly related PRs

Suggested reviewers: bowenfu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the fix to initialize in_mtp_draft_loop on the synthetic DSA metadata stub.
Description check ✅ Passed The description explains the failure, the fix, and test validation, although it does not include the full checklist template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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 #64587 [ run ] triggered by Bot. Commit: 614378b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64587 [ run ] completed with state SUCCESS. Commit: 614378b
/LLM/main/L0_MergeRequest_PR pipeline #52450 completed with status: 'SUCCESS'

CI Report

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.

4 participants