Repository navigation
[None][test] Add coverage for MBartForConditionalGeneration - #22171
StanleySun639 wants to merge 1 commit into
Conversation
Signed-off-by: Stanley Sun <stsun@nvidia.com>
|
No actionable comments were generated in the recent review. WalkthroughThis change adds a CUDA-gated mBART test. It compares TensorRT-LLM encoder-decoder inference with a Hugging Face reference using matching configuration and weights. ChangesmBART inference validation
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk:
|
|
/bot run |
|
PR_Github #84399 [ run ] triggered by Bot. Commit: |
Dev Engineer Review
tests/unittest/_torch/modeling/test_modeling_bart.py(+86/-2).test_mbart_for_conditional_generation_construction_and_forward. The test is skipped when CUDA is unavailable.MBartForConditionalGenerationfromtensorrt_llm._torch.models.modeling_bart. The diff does not change that module.get_registered_model_class("MBartForConditionalGeneration"). It checks layer-norm presence andnormalize_beforefor both stacks. It checks cross-attention metadata and wrapper forward output against the Hugging Face reference.rtol=2e-4andatol=2e-5. The test sets_attn_implementation = "eager"on the reference model.QA Engineer Review
tests/unittest/_torch/modeling/test_modeling_bart.py.test_mbart_for_conditional_generation_construction_and_forward.test_bart_for_conditional_generation_construction_and_forwardis unchanged in this diff.MBartForConditionalGeneration.normalize_beforesettings for encoder and decoder.float32), finiteness, and closeness to the Hugging Face mBART reference.tests/integration/test_lists/test-db/l0_a10.yml(line 30). The file is therefore run in CI through that entry. The new test function is covered by the file-level entry.sufficientfor the stated scope. The test requires CUDA and does not run on CPU-only runners.#107asSUCCESS. This summary did not verify that result.Per-File QA Perspective
tests/unittest/_torch/modeling/test_modeling_bart.py: Adds an mBART construction and forward check against the Hugging Face reference. It is listed in CI throughl0_a10.yml. A QA engineer should confirm the CUDA-gated test runs on an A10 runner, not only skips.Description
Adds unit-test coverage for existing supported model architectures.
tests/unittest/_torch/modeling/test_modeling_bart.py::test_mbart_for_conditional_generation_construction_and_forwardverifies: The production registry resolves MBartForConditionalGeneration to the exact production class, and constructing that class produces an MBartForConditionalGeneration instance. Both model stacks have final layer normalization and their single layers use pre-normalization. The prepared stateless cross-attention metadata identifies cross-attention. The real wrapper forward returns finite float32 logits with shape (3, 64). Every decoder context token's logits match an independently executed Hugging Face mBART model with identical weights, within rtol=2e-4 and atol=2e-5.Test Coverage
unittest/_torch/modeling/test_modeling_bart.py::test_mbart_for_conditional_generation_construction_and_forwardSUCCESSGap Fixer Validation
461580bcd5adPR 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-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin 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.