Skip to content

[https://nvbugs/6290967][fix] Update the two Cosmos3 quant assertions to read…#15264

Open
tensorrt-cicd wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6290967
Open

[https://nvbugs/6290967][fix] Update the two Cosmos3 quant assertions to read…#15264
tensorrt-cicd wants to merge 1 commit into
NVIDIA:mainfrom
tensorrt-cicd:repair-bot-bug6290967

Conversation

@tensorrt-cicd

@tensorrt-cicd tensorrt-cicd commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Root cause: Test asserted on pipeline.model_config, but BasePipeline exposes only pipeline_config / config — no model_config attribute exists on the pipeline.
  • Fix: Update the two Cosmos3 quant assertions to read pipeline.pipeline_config.primary_model_config.quant_config.quant_algo, avoiding any new public-API surface on the user-facing pipeline class.
  • Automated fix generated by repair-bot

Test plan

  • Verify fix on the same GPU type as the original failure
  • Check for regressions in related tests

Links

Summary by CodeRabbit

  • Tests
    • Updated FP8 quantization configuration validation tests to ensure proper verification of quantization settings.

…ant_algo assertion

Cosmos3 FP8 tests asserted on pipeline.model_config.quant_config, but
BasePipeline only exposes pipeline_config (a DiffusionPipelineConfig)
and config; there is no model_config attribute on the pipeline itself.
The per-component quant_config lives on
pipeline_config.primary_model_config (i.e. model_configs['transformer']),
which is the existing public API. Update both Cosmos3 quant tests to
use it.

Signed-off-by: tensorrt-cicd <90828364+tensorrt-cicd@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Two test assertions validate FP8 quantization configuration in Cosmos3 pipeline tests. Both update the assertion path from pipeline.model_config.quant_config.quant_algo to pipeline.pipeline_config.primary_model_config.quant_config.quant_algo, reflecting a configuration structure change.

Changes

FP8 Quantization Config Path Validation

Layer / File(s) Summary
FP8 quantization config path validation
tests/unittest/_torch/visual_gen/test_cosmos3_pipeline.py, tests/unittest/_torch/visual_gen/test_cosmos3_transformer.py
Both FP8 quantization test assertions are updated to access quant_algo through pipeline_config.primary_model_config.quant_config instead of the previous model_config.quant_config path.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • kaiyux
  • tburt-nv
  • dpitman-nvda
🚥 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%. 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 summarizes the main change: updating two Cosmos3 quantization assertions to read from the correct configuration path.
Description check ✅ Passed The description explains the root cause, the fix applied, and includes a test plan with verification steps, though the PR checklist is incomplete.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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

🧹 Nitpick comments (2)
tests/unittest/_torch/visual_gen/test_cosmos3_pipeline.py (1)

271-271: 💤 Low value

Consider verifying the specific quantization algorithm value.

The assertion checks that quant_algo is not None, but could be strengthened to verify it matches the expected QuantAlgo.FP8 value since the test explicitly loads FP8 configuration. This would catch configuration parsing issues more precisely.

♻️ Optional: More precise assertion
+from tensorrt_llm.models.modeling_utils import QuantAlgo
+
 def test_fp8_load_and_t2v(self):
     checkpoint = _require_checkpoint()
     pipeline = _load_pipeline(checkpoint, quant_config=COSMOS3_FP8_QUANT_CONFIG)
     try:
-        assert pipeline.pipeline_config.primary_model_config.quant_config.quant_algo is not None
+        assert pipeline.pipeline_config.primary_model_config.quant_config.quant_algo == QuantAlgo.FP8
         result = _run_forward(pipeline, image=None, num_frames=NUM_FRAMES)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/_torch/visual_gen/test_cosmos3_pipeline.py` at line 271,
Replace the loose non-null check with a precise equality assertion: assert that
pipeline.pipeline_config.primary_model_config.quant_config.quant_algo ==
QuantAlgo.FP8 so the test verifies the parsed quantization algorithm matches the
expected FP8 value (use the QuantAlgo enum and the existing
pipeline.pipeline_config.primary_model_config.quant_config.quant_algo
identifier).
tests/unittest/_torch/visual_gen/test_cosmos3_transformer.py (1)

298-298: 💤 Low value

Consider verifying the specific quantization algorithm value.

Similar to the pipeline test, this assertion could be strengthened to verify the parsed quant_algo matches the expected QuantAlgo.FP8 enum value from the input configuration string. This provides more precise validation of the config parsing logic.

♻️ Optional: More precise assertion
+from tensorrt_llm.models.modeling_utils import QuantAlgo
+
 `@pytest.mark.parametrize`("quant_algo", ["FP8"])
 def test_load_fp8_quantization(self, quant_algo: str):
     checkpoint_dir = _require_checkpoint()
     if not torch.cuda.is_available():
         pytest.skip("CUDA not available")
     args = VisualGenArgs(
         model=checkpoint_dir,
         quant_config={**COSMOS3_FP8_QUANT_CONFIG, "quant_algo": quant_algo},
         torch_compile_config=TorchCompileConfig(enable=False),
     )
     pipeline = PipelineLoader(args).load(skip_warmup=True, skip_components=_SKIP_AUX)
     try:
-        assert pipeline.pipeline_config.primary_model_config.quant_config.quant_algo is not None
+        assert pipeline.pipeline_config.primary_model_config.quant_config.quant_algo == QuantAlgo.FP8
         transformer = pipeline.transformer
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/unittest/_torch/visual_gen/test_cosmos3_transformer.py` at line 298,
The test currently only checks that
pipeline.pipeline_config.primary_model_config.quant_config.quant_algo is not
None; update the assertion to verify the exact enum value by asserting it equals
QuantAlgo.FP8 (import QuantAlgo from the module where it’s defined) so the test
confirms the parsed quant_algo matches the expected FP8 value instead of just
non-null.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/unittest/_torch/visual_gen/test_cosmos3_pipeline.py`:
- Line 271: Replace the loose non-null check with a precise equality assertion:
assert that
pipeline.pipeline_config.primary_model_config.quant_config.quant_algo ==
QuantAlgo.FP8 so the test verifies the parsed quantization algorithm matches the
expected FP8 value (use the QuantAlgo enum and the existing
pipeline.pipeline_config.primary_model_config.quant_config.quant_algo
identifier).

In `@tests/unittest/_torch/visual_gen/test_cosmos3_transformer.py`:
- Line 298: The test currently only checks that
pipeline.pipeline_config.primary_model_config.quant_config.quant_algo is not
None; update the assertion to verify the exact enum value by asserting it equals
QuantAlgo.FP8 (import QuantAlgo from the module where it’s defined) so the test
confirms the parsed quant_algo matches the expected FP8 value instead of just
non-null.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 6658c322-b81d-491c-bdd4-4beaa1c6952c

📥 Commits

Reviewing files that changed from the base of the PR and between 835fd61 and a029aac.

📒 Files selected for processing (2)
  • tests/unittest/_torch/visual_gen/test_cosmos3_pipeline.py
  • tests/unittest/_torch/visual_gen/test_cosmos3_transformer.py

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