Repository navigation
[None][test] Add coverage for LagunaForCausalLM - #22169
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. WalkthroughThe change adds a CUDA-only test that builds a two-layer, dense, ungated Laguna model and compares its context logits with those from a matching Qwen3 reference. ChangesLaguna inference parity
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Other Merge Risk:
|
|
/bot run |
|
PR_Github #84398 [ run ] triggered by Bot. Commit: |
Dev Engineer Review
get_registered_model_class("LagunaForCausalLM")and asserts the exact class. It also checks the layer count and layer types.Qwen3ForCausalLMreference and loads its state dict into the Laguna model. This only holds if the Laguna dense, ungated full-attention path matches Qwen3 math. The comment in the test states this assumption.model.load_weights(reference.state_dict()). The test does not check that every weight loaded. A partial load could still pass if shapes align.atol=1e-2andrtol=2e-3, on bfloat16 weights. Confirm these values are stable on target hardware.torch.random.fork_rngandtorch.manual_seed(42)for reproducible weights.TrtllmAttentionMetadatawith hand-built fields and callsmetadata.prepare(). Changes to that metadata API may break the test.QA Engineer Review
Test files and test-list files changed:
tests/unittest/_torch/speculative/hw_agnostic/test_lilicorr.py(+90 lines, 0 removed).Test functions added:
test_laguna_for_causal_lm_forward, a CUDA-only test underinference_mode.Behavior covered:
LagunaForCausalLMto the exact class.LagunaDecoderLayerinstances.return_context_logits=Trueon two sequences of four tokens each.(8, 64), dtypefloat32, and finite values.Not covered:
Test-list status:
tests/integration/test_lists/test-db/ortests/integration/test_lists/qa/. The diff does not change any test-list file. The test lists contain onlytest_lilicorr_loading.pyentries, which this PR does not change.#110passed. I did not verify this result from completed checks on the current head.Coverage verdict:
needs follow-up. The test covers one dense, ungated context path. It does not cover generation or decode. The test is not listed in test-db CI lists, so it does not run in the standard CI selection.Per-File QA Perspective
tests/unittest/_torch/speculative/hw_agnostic/test_lilicorr.py: Adds a CUDA-only forward test forLagunaForCausalLM. It checks class registration, layer structure, context logit shape, dtype, finiteness, and numerical match against Qwen3. It is not listed intest-db/orqa/, so CI does not select it by default.Description
Adds unit-test coverage for existing supported model architectures.
tests/unittest/_torch/speculative/hw_agnostic/test_lilicorr.py::test_laguna_for_causal_lm_forwardverifies: The production registry resolves LagunaForCausalLM to the exact LagunaForCausalLM class, and the constructed model contains two LagunaDecoderLayer instances. The real top-level context forward returns finite float32 logits with shape (8, 64). Every context logit agrees with an independently executed Hugging Face Qwen3 model with equivalent dense, ungated GQA configuration and identical weights.Test Coverage
unittest/_torch/speculative/hw_agnostic/test_lilicorr.py::test_laguna_for_causal_lm_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.