Skip to content

[None][test] Add coverage for Glm5NextForConditionalGeneration - #21500

Merged
StanleySun639 merged 2 commits into
NVIDIA:mainfrom
StanleySun639:gap-fixer/job-101-draft-145-check-130
Nov 4, 2026
Merged

StanleySun639 merged 2 commits into
NVIDIA:mainfrom
StanleySun639:gap-fixer/job-101-draft-145-check-130

Conversation

@StanleySun639

@StanleySun639 StanleySun639 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

The change adds a CUDA regression test for the registered GLM5 Next conditional-generation path. It checks model registration, sparse decoder construction, logits properties, embedding-input equivalence, context sensitivity, and the effect of the decoder. The test skips unless CUDA is available and the device has compute capability 10. No source or configuration changes are reported. Review finding counts are unavailable. The PR description reports successful CI runs; test execution results are not independently verified here.

QA Engineer Review

tests/unittest/_torch/modeling/test_glm5_next_contracts.py adds test_registered_vlm_text_forward. The test covers registered-model selection and text-forward behavior with synthetic sparse-attention metadata. The file is listed in the CI test list tests/integration/test_lists/test-db/l0_b200.yml. No manual-QA list entry was found. Coverage verdict: sufficient for the stated text-forward regression scope; the test requires Blackwell-class CUDA hardware.

Per-File QA Perspective

  • tests/unittest/_torch/modeling/test_glm5_next_contracts.py: Covers registered-model selection, sparse decoder construction, logits properties, embedding equivalence, context sensitivity, and decoder-path behavior. The file is listed in tests/integration/test_lists/test-db/l0_b200.yml; the test skips on systems without CUDA capability 10.

Description

Adds unit-test coverage for existing supported model architectures.

  • tests/unittest/_torch/modeling/test_glm5_next_contracts.py::test_registered_vlm_text_forward verifies: The exact conditional-generation registration resolves to Glm5NextVLM, and its constructed language model contains the requested real sparse decoder layer. Every top-level forward returns finite torch.float32 context logits with shape (13, 32). Caller-supplied embeddings reproduce token-ID logits even when the accompanying token IDs are different. Changing preceding tokens while retaining the final token changes its output logits, demonstrating contextual decoder computation. Forward logits differ from the separately computed embedding-to-final-norm-to-LM-head baseline that omits the decoder.

Test Coverage

  • Test case: unittest/_torch/modeling/test_glm5_next_contracts.py::test_registered_vlm_text_forward
  • Jenkins log: Jenkins #112 — SUCCESS

Gap Fixer Validation

  • Patch review: Passed with no unresolved must-fix findings.
  • Analyzed source snapshot: 461580bcd5ad
  • Gap Fixer run: Job #101

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@StanleySun639
StanleySun639 marked this pull request as ready for review November 3, 2026 02:29
@StanleySun639
StanleySun639 requested a review from a team as a code owner November 3, 2026 02:29
@StanleySun639
StanleySun639 force-pushed the gap-fixer/job-101-draft-145-check-130 branch from 2c47565 to c07cad5 Compare November 3, 2026 02:29
@StanleySun639

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Adds a CUDA regression test for the registered GLM5 Next VLM. The test checks text-forward output properties and compares logits from token IDs, equivalent embeddings, changed prefix tokens, and a direct norm-plus-LM-head path.

Changes

GLM5-next forwarding test

Layer / File(s) Summary
Configure and validate text forwarding
tests/unittest/_torch/modeling/test_glm5_next_contracts.py
The test builds a one-layer model and prepares sparse-attention metadata and cache storage. It checks logits shape, dtype, and finiteness. It also compares token-ID and embedding inputs, checks whether changed prefix tokens affect the final logit, and compares model output with a direct embedding-to-LM-head bypass.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to 2be40

The reviewed device guard matches the device used by the test, so no actionable merge risk remains.

Pre-merge checks: Passed 4 · Failed 1

Failed 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 with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "[None][test] Add coverage for Glm5NextForConditionalGeneration" follows the required template with a ticket tag and a lowercase type. It names the main change: new test coverage for the Glm…
Description check Passed The description explains the new test and what it verifies, and it lists the test case and CI evidence. It includes a Description section and a Test Coverage section. The template's Test Coverage sect…
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: Title check

Explanation

The title "[None][test] Add coverage for Glm5NextForConditionalGeneration" follows the required template with a ticket tag and a lowercase type. It names the main change: new test coverage for the Glm5NextForConditionalGeneration registration. The raw summary and objectives confirm the change adds one CUDA-gated test for this model. The title is specific and concise.

Full details: Description check

Explanation

The description explains the new test and what it verifies, and it lists the test case and CI evidence. It includes a Description section and a Test Coverage section. The template's Test Coverage section asks for relevant tests, and the description names the test. The description does not cover the CUDA and Blackwell (capability 10) skip condition, which the commit message explains. The description also adds a Gap Fixer Validation section that the template does not require. The PR checklist is checked. Overall the description is mostly complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between c07cad5 and 2be40a2.

Files selected for processing: 1
  • tests/unittest/_torch/modeling/test_glm5_next_contracts.py

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

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82155 [ run ] triggered by Bot. Commit: c07cad5 Link to invocation

@coderabbitai coderabbitai 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.

  • Fix comments: Fix CodeRabbit comments on this PR

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82155 [ run ] completed with state SUCCESS. Commit: c07cad5
/LLM/main/L0_MergeRequest_PR pipeline #67787 completed with status: 'SUCCESS'

CI Report

Link to invocation

@StanleySun639
StanleySun639 enabled auto-merge (squash) November 3, 2026 05:41
…e MLA

The test builds a CUDA model and runs the BF16, 64-head sparse attention
path, which dispatches to FlashMLA. Reuse the capability guard that
test_sparse_prefill_continuation_preserves_partial_pools already applies
to the same path so CPU-only and non-Blackwell runs skip cleanly.

Signed-off-by: Stanley Sun <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@StanleySun639

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82220 [ run ] triggered by Bot. Commit: 2be40a2 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #82220 [ run ] completed with state SUCCESS. Commit: 2be40a2
/LLM/main/L0_MergeRequest_PR pipeline #67846 completed with status: 'SUCCESS'

CI Report

Link to invocation

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements.

@StanleySun639
StanleySun639 merged commit b13f9b6 into NVIDIA:main Nov 4, 2026
@StanleySun639
StanleySun639 deleted the gap-fixer/job-101-draft-145-check-130 branch November 4, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants