Skip to content

[None][feat] Cosmos3: resolve checkpoint and request settings through one precedence table - #21368

Draft
ishovkun wants to merge 4 commits into
NVIDIA:mainfrom
ishovkun:cosmos3-config-resolver
Draft

ishovkun wants to merge 4 commits into
NVIDIA:mainfrom
ishovkun:cosmos3-config-resolver

Conversation

@ishovkun

@ishovkun ishovkun commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

@coderabbitai summary

Description

Cosmos3 checkpoints spread their settings over several files (model_index.json, the transformer
and VAE config.json, checkpoint.json, the scheduler config), and TensorRT-LLM read them from
a dozen places in the pipeline: some keys from one file, some from another, some with a hard-coded
fallback, with no record of which value won. The released checkpoints disagree with each other on
a few keys (system prompt, native flow schedule), and a silent fallback is how a wrong setting
goes unnoticed.

This PR puts every checkpoint- and request-level setting behind one precedence table, and
makes it the only path: the executor defaults, warmup and infer() all resolve through it.

Checkpoint settings. Cosmos3ConfigResolver(checkpoint_dir).resolve() walks a rule table.
Each rule names the sources for one setting in order of precedence (a key in a checkpoint file,
or an explicit default with a reason), and says what to do when the sources disagree: error,
warn, or ignore. The result is a Cosmos3Config with
sections (architecture, vae, audio, sampling, prompt, action); every value carries its source,
and describe() logs the table at load. A setting with no source and no declared default is an
error naming the file and path, not a guess. Only the four transformer compatibility keys and
native_flow_schedule=False have declared defaults; prompt.use_system_prompt and
vae.spatial_compression are required. The transformer's compatibility defaults now come from
the same table (fill_pretrained_config), so they are declared once.

Request settings. request_resolver.py does the same for per-request values (resolution,
frames, frame rate, steps, guidance, action mode, domain, action width): a request value wins,
then the checkpoint's distilled or policy contract, then the checkpoint's embodiment table, then
the family's tables. Disagreements with a recommendation warn once per request. A golden fixture
pins the resolved defaults for every published checkpoint so a change is visible in review.

Pipeline. pipeline_cosmos3.py reads self.cosmos3_config and the request resolver instead
of its own key lookups; default_generation_params, warmup and infer() share that path, so
the sampling policy's separate default overrides and the pipeline's own VAE/transformer
compression check are gone (the resolver's rules cover both). The constants that were defined
in two or three places (V2V flow shift, prompt format strings, aspect-ratio buckets, resolution
table) are defined once; the output geometry has its own leaf module, geometry.py.

Behaviour changes for shipped checkpoints: none intended. The golden fixtures were generated
from the current behaviour and reviewed by hand. The deliberate differences: a checkpoint
declaring neither prompt key now fails to load instead of silently running without a system
prompt, and a checkpoint without vae/config.json fails instead of assuming a spatial
compression of 16.

The rules for the autoregressive (Sim) checkpoints, their serving-config overrides and the
checkpoint embodiment table come with the Sim pipeline PR; this PR carries only the settings the
current pipeline consumes.

Test Coverage

  • tests/unittest/_torch/visual_gen/test_cosmos3_config_resolver.py (CPU): all 10 published
    checkpoints resolve (test_data/cosmos3_checkpoint_configs.json); conflict policies; required
    keys; source recording; the transformer compatibility defaults.
  • tests/unittest/_torch/visual_gen/test_cosmos3_request_resolver.py (CPU): golden request
    defaults per checkpoint, mode and workflow (test_data/cosmos3_request_defaults.json);
    override precedence; disagreement warnings.
  • Existing test_cosmos3_edge.py, test_cosmos3_pipeline.py, test_cosmos3_distilled.py,
    test_cosmos3_action.py, test_cosmos3_transfer.py, test_cosmos3_example_prompts.py,
    test_cosmos3_transformer.py run on the new entry points (GPU).
  • Test lists: the two CPU tests are added to l0_cpu.yml; the GPU suites are already listed.

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.

…s through one precedence table

Signed-off-by: Igor Shovkun <ishovkun@nvidia.com>
@ishovkun

Copy link
Copy Markdown
Contributor Author

/bot run --disable-fail-fast

…efaults.py

Signed-off-by: Igor Shovkun <ishovkun@nvidia.com>
@ishovkun

Copy link
Copy Markdown
Contributor Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81788 [ run ] triggered by Bot. Commit: 60c8832 Link to invocation

…resolver sources and duplicate checks

Signed-off-by: Igor Shovkun <ishovkun@nvidia.com>
@ishovkun

Copy link
Copy Markdown
Contributor Author

/bot run --disable-fail-fast

@ishovkun ishovkun changed the title [None][feat] Cosmos3: resolve checkpoint, serving and request settings through one precedence table [None][feat] Cosmos3: resolve checkpoint and request settings through one precedence table Oct 31, 2026
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81791 [ run ] triggered by Bot. Commit: f8d7739 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81788 [ run ] completed with state ABORTED. Commit: 60c8832

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81791 [ run ] completed with state FAILURE. Commit: f8d7739
/LLM/main/L0_MergeRequest_PR pipeline #67448 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

…defaults.py

Signed-off-by: Igor Shovkun <ishovkun@nvidia.com>
@ishovkun

ishovkun commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81868 [ run ] triggered by Bot. Commit: e27621e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #81868 [ run ] completed with state FAILURE. Commit: e27621e
/LLM/main/L0_MergeRequest_PR pipeline #67519 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

This branch has not been deployed

No deployments
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.

2 participants