Skip to content

feat(cli): add commands for ten decoder families - #1378

Open
yifeif-nv wants to merge 1 commit into
NVIDIA:mainfrom
yifeif-nv:agent/family-cli-batch-5
Open

yifeif-nv wants to merge 1 commit into
NVIDIA:mainfrom
yifeif-nv:agent/family-cli-batch-5

Conversation

@yifeif-nv

@yifeif-nv yifeif-nv commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Background

Follow up #1310 by moving ten existing families' CLI definitions and execution into their owning directories. New options can then be added without changing the public parser or shared build request.

Exit Criteria

  • Each family owns its build declaration, typed request, native handler and tests.
  • Existing defaults, supported inputs, legacy rejection behavior and numerical criteria are preserved.
  • Discovery, help, runtime staging and packaging use the existing generic protocol.

Implementation

Families: bloom, codegen, falcon, gpt2, gpt_neo, gpt_neox, opt, stablelm, starcoder2, xglm.

Adds build and generate, lazy Python build handlers and native adapter targets. Existing family runtime interfaces are reused inside owner handlers. Model graphs and build policies remain in their existing owners. Existing flat CLI entry points remain compatible; public Task ABI, bundle format and dependencies are unchanged.

A generic CI test fixture now derives its runtime files from the selected family declaration. The existing missing-testcase assertion is unchanged; missing descriptors and adapters remain errors. This is the only change outside the ten family directories.

Change categories

  • Model or runtime behavior
  • Public API
  • ABI
  • Bundle or artifact format
  • Dependencies
  • Documentation only
  • CI or developer tooling

Validation

Commands and Results

  • Partial remote CI on 64984d36a103ff7debcf1249d100152a7e2c37d5: Stable Community CIpassed; Dev Community CIfailed; TRTMC Internal CI / Automated premerge gatepassed. Dev GPU validation remains incomplete because of a provisioning infrastructure failure; a normal CI retry is pending.

  • CI_BASE_REF=4b9cc2b0f259e8959e1a5c0e996506e60d7101b5 python3 -m tools.ci pipeline source-quality: passed, including 299 architecture and CI contract tests.

  • Owner CPU suite: 151 passed / 21 existing selector skips:

python3 -m pytest families/bloom/tests families/codegen/tests families/falcon/tests families/gpt2/tests families/gpt_neo/tests families/gpt_neox/tests families/opt/tests families/stablelm/tests families/starcoder2/tests families/xglm/tests -m "not gpu and not trt" -q -p no:cacheprovider
  • cmake --build /work/build --parallel 8 and ctest --test-dir /work/build --output-on-failure --label-exclude gpu: a local integration tree containing all five independent migration batches passed 268 tests / 7 expected no-device skips, including this batch's 10 native CLI handler tests.
  • python3 -m build --no-isolation --wheel --outdir /work/wheels -Cbuild-dir=/work/wheel-build .: the same integration tree built a real wheel; archive/installed validators passed for all 128 model families. Installed-only probes passed owner build dispatch for all 50 migrated families, 120 offline help commands and 70 native adapter family guards.
  • Model math/build-policy definitions and existing E2E assertions were compared with the baseline. The tests now call the owner entry points with the same acceptance criteria.

Hardware, Environment, and Revisions

Head: 64984d36a103ff7debcf1249d100152a7e2c37d5. Base: 4b9cc2b0f259e8959e1a5c0e996506e60d7101b5. Local Linux/aarch64 CPU-only validation used TensorRT 11.1.0.106 and Torch 2.12.0+cu130. Synthetic runtime fixtures and probe bundles were used for CLI integration; the skipped tests retain their existing explicit GPU/E2E selectors.

Not Run / Remaining Gaps

Fresh checkpoint GPU inference, numerical/performance qualification and TensorRT-RTX execution were not run locally. The passing remote results above cover their configured checks on this head. Dev GPU validation remains incomplete, so merge readiness is pending.

Contributor Self-Review

  • I have completed a self-review of this change.

Reviewed family ownership, supported parameters/defaults, old Python-call compatibility, native input/output contracts and failure behavior. Publication is gated on an independent review of outgoing code, commit metadata, PR text and CI output paths.

Notes For Future Readers

This is batch 5 of five independent ten-family migrations on the same base; no batch depends on another. Review cli.json, cli.py, native cli.cpp, then owner tests. Remaining families can follow the same pattern. Remove the shared legacy CLI/request only after migration is complete.

Risk level

  • Low
  • Medium
  • High

Ten families gain a new command path and adapter artifacts. Explicit defaults, strict rejection, owner tests and installed-package checks cover the integration boundary; they do not replace model qualification.

Move build declarations, narrow request types, and native generation handlers into each decoder family. Preserve sampling defaults, legacy unsupported-input checks, and StableLM mixed-precision controls while exercising owner commands from existing E2E helpers.

Python CPU owner tests passed: 151 passed and 21 unselected E2E cases skipped. Existing model graph definitions and numerical assertions are unchanged.

Signed-off-by: yifeif <277870278+yifeif-nv@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/TensorRT-Model-Connect/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1d1e4aa7-03bb-49d9-a9aa-c8495f874015

📥 Commits

Reviewing files that changed from the base of the PR and between 4b9cc2b and 64984d3.

📒 Files selected for processing (81)
  • families/bloom/cli.json
  • families/bloom/cli.py
  • families/bloom/model.py
  • families/bloom/runtime/CMakeLists.txt
  • families/bloom/runtime/cli.cpp
  • families/bloom/tests/cpp/test_cli.cpp
  • families/bloom/tests/test_cli.py
  • families/bloom/tests/test_e2e.py
  • families/codegen/cli.json
  • families/codegen/cli.py
  • families/codegen/model.py
  • families/codegen/runtime/CMakeLists.txt
  • families/codegen/runtime/cli.cpp
  • families/codegen/tests/cpp/test_cli.cpp
  • families/codegen/tests/test_cli.py
  • families/codegen/tests/test_e2e.py
  • families/falcon/cli.json
  • families/falcon/cli.py
  • families/falcon/model.py
  • families/falcon/runtime/CMakeLists.txt
  • families/falcon/runtime/cli.cpp
  • families/falcon/tests/cpp/test_cli.cpp
  • families/falcon/tests/test_cli.py
  • families/falcon/tests/test_e2e.py
  • families/gpt2/cli.json
  • families/gpt2/cli.py
  • families/gpt2/model.py
  • families/gpt2/runtime/CMakeLists.txt
  • families/gpt2/runtime/cli.cpp
  • families/gpt2/tests/cpp/test_cli.cpp
  • families/gpt2/tests/test_cli.py
  • families/gpt2/tests/test_e2e.py
  • families/gpt_neo/cli.json
  • families/gpt_neo/cli.py
  • families/gpt_neo/model.py
  • families/gpt_neo/runtime/CMakeLists.txt
  • families/gpt_neo/runtime/cli.cpp
  • families/gpt_neo/tests/cpp/test_cli.cpp
  • families/gpt_neo/tests/test_cli.py
  • families/gpt_neo/tests/test_e2e.py
  • families/gpt_neox/cli.json
  • families/gpt_neox/cli.py
  • families/gpt_neox/model.py
  • families/gpt_neox/runtime/CMakeLists.txt
  • families/gpt_neox/runtime/cli.cpp
  • families/gpt_neox/tests/cpp/test_cli.cpp
  • families/gpt_neox/tests/test_cli.py
  • families/gpt_neox/tests/test_e2e.py
  • families/opt/cli.json
  • families/opt/cli.py
  • families/opt/model.py
  • families/opt/runtime/CMakeLists.txt
  • families/opt/runtime/cli.cpp
  • families/opt/tests/cpp/test_cli.cpp
  • families/opt/tests/test_cli.py
  • families/opt/tests/test_e2e.py
  • families/stablelm/cli.json
  • families/stablelm/cli.py
  • families/stablelm/model.py
  • families/stablelm/runtime/CMakeLists.txt
  • families/stablelm/runtime/cli.cpp
  • families/stablelm/tests/cpp/test_cli.cpp
  • families/stablelm/tests/test_cli.py
  • families/stablelm/tests/test_e2e.py
  • families/starcoder2/cli.json
  • families/starcoder2/cli.py
  • families/starcoder2/model.py
  • families/starcoder2/runtime/CMakeLists.txt
  • families/starcoder2/runtime/cli.cpp
  • families/starcoder2/tests/cpp/test_cli.cpp
  • families/starcoder2/tests/test_cli.py
  • families/starcoder2/tests/test_e2e.py
  • families/xglm/cli.json
  • families/xglm/cli.py
  • families/xglm/model.py
  • families/xglm/runtime/CMakeLists.txt
  • families/xglm/runtime/cli.cpp
  • families/xglm/tests/cpp/test_cli.cpp
  • families/xglm/tests/test_cli.py
  • families/xglm/tests/test_e2e.py
  • tools/tests/test_new_ci.py

Included review availability: Your plan provides up to 12 included reviews per hour; 2 remain after this review.


📝 Summary

A detailed high-level summary could not be generated for this review. Here is an overview derived from the analyzed file changes:

  • families/bloom/cli.json: ## AI-generated summary of changes
  • families/bloom/cli.py: ## AI-generated summary of changes
  • families/bloom/model.py: ## AI-generated summary of changes
  • families/bloom/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/bloom/runtime/cli.cpp: ## AI-generated summary of changes
  • families/bloom/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/bloom/tests/test_cli.py: ## AI-generated summary of changes
  • families/bloom/tests/test_e2e.py: ## AI-generated summary of changes
  • families/codegen/cli.json: ## AI-generated summary of changes
  • families/codegen/cli.py: ## AI-generated summary of changes
  • families/codegen/model.py: ## AI-generated summary of changes
  • families/codegen/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/codegen/runtime/cli.cpp: ## AI-generated summary of changes
  • families/codegen/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/codegen/tests/test_cli.py: ## AI-generated summary of changes
  • families/codegen/tests/test_e2e.py: ## AI-generated summary of changes
  • families/falcon/cli.json: ## AI-generated summary of changes
  • families/falcon/cli.py: ## AI-generated summary of changes
  • families/falcon/model.py: ## AI-generated summary of changes
  • families/falcon/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/falcon/runtime/cli.cpp: ## AI-generated summary of changes
  • families/falcon/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/falcon/tests/test_cli.py: ## AI-generated summary of changes
  • families/falcon/tests/test_e2e.py: ## AI-generated summary of changes
  • families/gpt2/cli.json: ## AI-generated summary of changes
  • families/gpt2/cli.py: ## AI-generated summary of changes
  • families/gpt2/model.py: ## AI-generated summary of changes
  • families/gpt2/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/gpt2/runtime/cli.cpp: ## AI-generated summary of changes
  • families/gpt2/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/gpt2/tests/test_cli.py: ## AI-generated summary of changes
  • families/gpt2/tests/test_e2e.py: ## AI-generated summary of changes
  • families/gpt_neo/cli.json: ## AI-generated summary of changes
  • families/gpt_neo/cli.py: ## AI-generated summary of changes
  • families/gpt_neo/model.py: ## AI-generated summary of changes
  • families/gpt_neo/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/gpt_neo/runtime/cli.cpp: ## AI-generated summary of changes
  • families/gpt_neo/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/gpt_neo/tests/test_cli.py: ## AI-generated summary of changes
  • families/gpt_neo/tests/test_e2e.py: ## AI-generated summary of changes
  • families/gpt_neox/cli.json: ## AI-generated summary of changes
  • families/gpt_neox/cli.py: ## AI-generated summary of changes
  • families/gpt_neox/model.py: ## AI-generated summary of changes
  • families/gpt_neox/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/gpt_neox/runtime/cli.cpp: ## AI-generated summary of changes
  • families/gpt_neox/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/gpt_neox/tests/test_cli.py: ## AI-generated summary of changes
  • families/gpt_neox/tests/test_e2e.py: ## AI-generated summary of changes
  • families/opt/cli.json: ## AI-generated summary of changes
  • families/opt/cli.py: ## AI-generated summary of changes
  • families/opt/model.py: ## AI-generated summary of changes
  • families/opt/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/opt/runtime/cli.cpp: ## AI-generated summary of changes
  • families/opt/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/opt/tests/test_cli.py: ## AI-generated summary of changes
  • families/opt/tests/test_e2e.py: ## AI-generated summary of changes
  • families/stablelm/cli.json: ## AI-generated summary of changes
  • families/stablelm/cli.py: ## AI-generated summary of changes
  • families/stablelm/model.py: ## AI-generated summary of changes
  • families/stablelm/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/stablelm/runtime/cli.cpp: ## AI-generated summary of changes
  • families/stablelm/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/stablelm/tests/test_cli.py: ## AI-generated summary of changes
  • families/stablelm/tests/test_e2e.py: ## AI-generated summary of changes
  • families/starcoder2/cli.json: ## AI-generated summary of changes
  • families/starcoder2/cli.py: ## AI-generated summary of changes
  • families/starcoder2/model.py: ## AI-generated summary of changes
  • families/starcoder2/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/starcoder2/runtime/cli.cpp: ## AI-generated summary of changes
  • families/starcoder2/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/starcoder2/tests/test_cli.py: ## AI-generated summary of changes
  • families/starcoder2/tests/test_e2e.py: ## AI-generated summary of changes
  • families/xglm/cli.json: ## AI-generated summary of changes
  • families/xglm/cli.py: ## AI-generated summary of changes
  • families/xglm/model.py: ## AI-generated summary of changes
  • families/xglm/runtime/CMakeLists.txt: ## AI-generated summary of changes
  • families/xglm/runtime/cli.cpp: ## AI-generated summary of changes
  • families/xglm/tests/cpp/test_cli.cpp: ## AI-generated summary of changes
  • families/xglm/tests/test_cli.py: ## AI-generated summary of changes
  • families/xglm/tests/test_e2e.py: ## AI-generated summary of changes
  • tools/tests/test_new_ci.py: ## AI-generated summary of changes

Walkthrough

Ten model families add family-specific build and generate commands. Build handlers validate requests and publish bundles. Native adapters parse generation settings, load text-generation tasks, and return generated text, token IDs, and timings. Tests cover both command paths and isolated runtime staging.

Changes

Family build commands

Layer / File(s) Summary
Build requests and bundle construction
families/{bloom,codegen,falcon,gpt2,gpt_neo,gpt_neox,opt,stablelm,starcoder2,xglm}/cli.json, families/{bloom,codegen,falcon,gpt2,gpt_neo,gpt_neox,opt,stablelm,starcoder2,xglm}/cli.py, families/{bloom,codegen,falcon,gpt2,gpt_neo,gpt_neox,opt,stablelm,starcoder2,xglm}/model.py
Each family defines build options, validates and coerces requests, and builds bundles. Model builders now coerce family CLI requests.
Build and end-to-end coverage
families/{bloom,codegen,falcon,gpt2,gpt_neo,gpt_neox,opt,stablelm,starcoder2,xglm}/tests/test_cli.py, families/{bloom,codegen,falcon,gpt2,gpt_neo,gpt_neox,opt,stablelm,starcoder2,xglm}/tests/test_e2e.py
Python tests check request validation, bundle publication, failure handling, and help output. End-to-end tests use each family’s build handler and generate command.
Native generation adapters
families/{bloom,codegen,falcon,gpt2,gpt_neo,gpt_neox,opt,stablelm,starcoder2,xglm}/runtime/cli.cpp, families/{bloom,codegen,falcon,gpt2,gpt_neo,gpt_neox,opt,stablelm,starcoder2,xglm}/runtime/CMakeLists.txt, families/{bloom,codegen,falcon,gpt2,gpt_neo,gpt_neox,opt,stablelm,starcoder2,xglm}/tests/cpp/test_cli.cpp
Each family adds a native generate handler and a CMake target. C++ tests cover generation output, options, runtime controls, and rejected requests.
Runtime staging checks
tools/tests/test_new_ci.py
CI tests check staging of CLI declarations and required native adapters in isolated runtimes.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant FamilyCLI
  participant FamilyAdapter
  participant load_task
  participant TextGenerationTask
  FamilyCLI->>FamilyAdapter: pass generate request JSON
  FamilyAdapter->>load_task: load family bundle and runtime settings
  load_task->>TextGenerationTask: return text-generation task
  FamilyAdapter->>TextGenerationTask: generate prompt with config
  TextGenerationTask-->>FamilyAdapter: return text, token IDs, and timings
  FamilyAdapter-->>FamilyCLI: write JSON result or error
Loading

Merge Risk: ⚪ Minimal · up to 64984

The new family commands add build and generation paths, and the checked default generation limit matches the existing behavior. No concrete merge-blocking issue is established.

🚥 Pre-merge checks | ✅ 8 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.16% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 256 functions across 50 files. (31 skippe… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (8 passed)
Check name Status Explanation
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.
Family Ownership Boundary ✅ Passed The pull request introduces build and generate commands for ten decoder families (bloom, codegen, falcon, gpt2, gpt_neo, gpt_neox, opt, stablelm, starcoder2, xglm). Each family maintains clean own…
Shared Semantic Neutrality ✅ Passed The only changed file outside the family-owned directories is tools/tests/test_new_ci.py. Its new fixture stages a model library using the selected family ID and copies that family’s cli.json; it …
Benchmark Validation Integrity ✅ Passed The pull request moves CLI definitions and handlers into ten decoder family directories. Timing measurement and validation semantics are preserved. The benchmark validation integrity check applies whe…
Shared Change Blast Radius ✅ Passed The pull request adds CLI commands for ten decoder families. It changes one shared-code file: tools/tests/test_new_ci.py. The custom check requires that shared-code changes be justified by identifyi…
Title check ✅ Passed The title clearly summarizes the main change: adding CLI commands for ten decoder families.
Description check ✅ Passed The description covers the required sections, including background, exit criteria, implementation, change categories, validation, environment, remaining gaps, self-review, and risk. It reports pending…
Full details: Docstring Coverage

Explanation

Docstring coverage is 10.16% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 256 functions across 50 files. (31 skipped: 20 unsupported, 11 over the file limit.)


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

@yifeif-nv yifeif-nv added the run-internal-ci Maintainer-approved dispatch to internal CI label Sep 22, 2026
@github-actions github-actions Bot removed the run-internal-ci Maintainer-approved dispatch to internal CI label Sep 22, 2026
@yifeif-nv
yifeif-nv marked this pull request as ready for review September 22, 2026 22:40

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant