Repository navigation
Conversation
…s through one precedence table Signed-off-by: Igor Shovkun <ishovkun@nvidia.com>
|
/bot run --disable-fail-fast |
…efaults.py Signed-off-by: Igor Shovkun <ishovkun@nvidia.com>
|
/bot run --disable-fail-fast |
|
PR_Github #81788 [ run ] triggered by Bot. Commit: |
…resolver sources and duplicate checks Signed-off-by: Igor Shovkun <ishovkun@nvidia.com>
|
/bot run --disable-fail-fast |
|
PR_Github #81791 [ run ] triggered by Bot. Commit: |
|
PR_Github #81788 [ run ] completed with state |
|
PR_Github #81791 [ run ] completed with state
|
…defaults.py Signed-off-by: Igor Shovkun <ishovkun@nvidia.com>
|
/bot run --disable-fail-fast |
|
PR_Github #81868 [ run ] triggered by Bot. Commit: |
|
PR_Github #81868 [ run ] completed with state
|
@coderabbitai summary
Description
Cosmos3 checkpoints spread their settings over several files (
model_index.json, the transformerand VAE
config.json,checkpoint.json, the scheduler config), and TensorRT-LLM read them froma 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
Cosmos3Configwithsections (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 anerror naming the file and path, not a guess. Only the four transformer compatibility keys and
native_flow_schedule=Falsehave declared defaults;prompt.use_system_promptandvae.spatial_compressionare required. The transformer's compatibility defaults now come fromthe same table (
fill_pretrained_config), so they are declared once.Request settings.
request_resolver.pydoes 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.pyreadsself.cosmos3_configand the request resolver insteadof its own key lookups;
default_generation_params, warmup andinfer()share that path, sothe 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.jsonfails instead of assuming a spatialcompression 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 publishedcheckpoints resolve (
test_data/cosmos3_checkpoint_configs.json); conflict policies; requiredkeys; source recording; the transformer compatibility defaults.
tests/unittest/_torch/visual_gen/test_cosmos3_request_resolver.py(CPU): golden requestdefaults per checkpoint, mode and workflow (
test_data/cosmos3_request_defaults.json);override precedence; disagreement warnings.
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.pyrun on the new entry points (GPU).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-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.