Skip to content

feat(cli): add commands for ten encoder families - #1377

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

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

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: albert, convbert, deberta, distilbert, dpr, electra, fnet, modernbert, mpnet, roberta.

Adds build, encode, embed and rerank, 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.

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 8cb9610d3977ce475b2864c273364a0e7e17c659: 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 296 architecture and CI contract tests.

  • Owner CPU suite: 120 passed / 26 existing selector skips:

python3 -m pytest families/albert/tests families/convbert/tests families/deberta/tests families/distilbert/tests families/dpr/tests families/electra/tests families/fnet/tests families/modernbert/tests families/mpnet/tests families/roberta/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: 8cb9610d3977ce475b2864c273364a0e7e17c659. 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 4 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 encode/embed/rerank handlers into each encoder family. Preserve legacy unsupported-input checks and exercise the owner namespace from existing E2E helpers.

Python CPU owner tests passed: 120 passed and 26 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: dc234868-4fd9-4ed1-b151-f7257d54b25b

📥 Commits

Reviewing files that changed from the base of the PR and between 4b9cc2b and 8cb9610.

📒 Files selected for processing (80)
  • families/albert/cli.json
  • families/albert/cli.py
  • families/albert/model.py
  • families/albert/runtime/CMakeLists.txt
  • families/albert/runtime/cli.cpp
  • families/albert/tests/cpp/test_cli.cpp
  • families/albert/tests/test_cli.py
  • families/albert/tests/test_e2e.py
  • families/convbert/cli.json
  • families/convbert/cli.py
  • families/convbert/model.py
  • families/convbert/runtime/CMakeLists.txt
  • families/convbert/runtime/cli.cpp
  • families/convbert/tests/cpp/test_cli.cpp
  • families/convbert/tests/test_cli.py
  • families/convbert/tests/test_e2e.py
  • families/deberta/cli.json
  • families/deberta/cli.py
  • families/deberta/model.py
  • families/deberta/runtime/CMakeLists.txt
  • families/deberta/runtime/cli.cpp
  • families/deberta/tests/cpp/test_cli.cpp
  • families/deberta/tests/test_cli.py
  • families/deberta/tests/test_e2e.py
  • families/distilbert/cli.json
  • families/distilbert/cli.py
  • families/distilbert/model.py
  • families/distilbert/runtime/CMakeLists.txt
  • families/distilbert/runtime/cli.cpp
  • families/distilbert/tests/cpp/test_cli.cpp
  • families/distilbert/tests/test_cli.py
  • families/distilbert/tests/test_e2e.py
  • families/dpr/cli.json
  • families/dpr/cli.py
  • families/dpr/model.py
  • families/dpr/runtime/CMakeLists.txt
  • families/dpr/runtime/cli.cpp
  • families/dpr/tests/cpp/test_cli.cpp
  • families/dpr/tests/test_cli.py
  • families/dpr/tests/test_e2e.py
  • families/electra/cli.json
  • families/electra/cli.py
  • families/electra/model.py
  • families/electra/runtime/CMakeLists.txt
  • families/electra/runtime/cli.cpp
  • families/electra/tests/cpp/test_cli.cpp
  • families/electra/tests/test_cli.py
  • families/electra/tests/test_e2e.py
  • families/fnet/cli.json
  • families/fnet/cli.py
  • families/fnet/model.py
  • families/fnet/runtime/CMakeLists.txt
  • families/fnet/runtime/cli.cpp
  • families/fnet/tests/cpp/test_cli.cpp
  • families/fnet/tests/test_cli.py
  • families/fnet/tests/test_e2e.py
  • families/modernbert/cli.json
  • families/modernbert/cli.py
  • families/modernbert/model.py
  • families/modernbert/runtime/CMakeLists.txt
  • families/modernbert/runtime/cli.cpp
  • families/modernbert/tests/cpp/test_cli.cpp
  • families/modernbert/tests/test_cli.py
  • families/modernbert/tests/test_e2e.py
  • families/mpnet/cli.json
  • families/mpnet/cli.py
  • families/mpnet/model.py
  • families/mpnet/runtime/CMakeLists.txt
  • families/mpnet/runtime/cli.cpp
  • families/mpnet/tests/cpp/test_cli.cpp
  • families/mpnet/tests/test_cli.py
  • families/mpnet/tests/test_e2e.py
  • families/roberta/cli.json
  • families/roberta/cli.py
  • families/roberta/model.py
  • families/roberta/runtime/CMakeLists.txt
  • families/roberta/runtime/cli.cpp
  • families/roberta/tests/cpp/test_cli.cpp
  • families/roberta/tests/test_cli.py
  • families/roberta/tests/test_e2e.py

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


📝 Summary

Summary

Adds family-owned build, encode, embed, and rerank commands for ALBERT, ConvBERT, DeBERTa, DistilBERT, DPR, ELECTRA, FNet, ModernBERT, MPNet, and RoBERTa.

Each family defines its CLI, build request validation, bundle construction, and native runtime handler. The native handlers reuse the existing task interfaces and check bundle family identity. Build handlers load model code lazily. The reported intent is to preserve existing defaults, inputs, unsupported-input rejection, and flat CLI entry points.

The supplied summary reports 296 architecture and CI contract tests, 120 owner CPU tests with 26 selector skips, and 268 integration tests passed with 7 expected no-device skips. It also reports that wheel and installed-package validators passed. Fresh-checkpoint GPU inference, numerical and performance qualification, and TensorRT-RTX execution remain outstanding. These results were not independently verified here.

Architecture impact

  • Family-owned files: Each of the ten families adds cli.json, cli.py, runtime/cli.cpp, CMake wiring, Python and C++ CLI tests, and updates its E2E helper. This keeps command declarations, validation, and runtime adapters in the owning family.
  • Shared surfaces: The generic CLI dispatcher, declaration discovery, CMake discovery, packaging, and E2E tooling use the existing family CLI protocol. The supplied change summary says these generic protocol surfaces remain unchanged. The available checkout has no working-tree diff, so changed shared files and full change scope could not be confirmed.
  • Dependency direction: Family Python handlers use shared build, bundle-writer, graph-transform, and model-resolution APIs. Native family adapters link to runtime, core, and JSON libraries and expose the existing family CLI entry point. No cross-family dependency is evident in the inspected samples.
  • Affected consumers: Users of family commands, the shared CLI dispatcher, build-tree discovery, runtime loading, packaging, and E2E tooling. The supplied report also identifies existing flat CLI entry points as compatibility consumers.
  • Unresolved blast radius: The repository diff was unavailable for inspection. Therefore, compatibility across all ten families and integration with discovery, runtime staging, and packaging cannot be fully confirmed from source changes in this review.

HUMAN REVIEW REQUIRED — the reported test and packaging results are not independently verified, and the unavailable diff leaves the full change scope unconfirmed. Review severity counts are unavailable because no current review findings were supplied.

Walkthrough

This PR adds family-specific CLI build and native runtime commands for ten model families. It moves build request coercion into each family CLI module, updates model builders and E2E calls to use that path, adds native runtime adapters, and adds Python and C++ CLI tests.

Changes

Family-specific CLI rollout

Layer / File(s) Summary
Albert and ConvBERT CLI support
families/albert/*, families/convbert/*
Adds cli.json command definitions, family BuildRequest validation and build_bundle entry points, native encode/embed/rerank runtime handlers, model build coercion, CMake targets, and Python/C++/E2E tests for ALBERT and ConvBERT.
DeBERTa and DistilBERT CLI support
families/deberta/*, families/distilbert/*
Adds the same family-owned CLI, runtime, model-build, and test path for DeBERTa and DistilBERT. E2E flows now call build_bundle and pass the family name to native commands.
DPR and Electra CLI support
families/dpr/*, families/electra/*
Adds family-specific build and native CLI support for DPR and Electra, moves request coercion out of model builders, and covers runtime dispatch, validation, failure paths, and help behavior in tests.
FNet and ModernBERT CLI support
families/fnet/*, families/modernbert/*
Adds family CLI definitions and runtime adapters for FNet and ModernBERT, updates build entry points to use family BuildRequest coercion, and adds matching CLI and E2E coverage.
MPNet and RoBERTa CLI support
families/mpnet/*, families/roberta/*
Adds family-owned CLI build/native command support for MPNet and RoBERTa, updates model builders and native invocation shape, and adds contract and regression tests around these flows.

Priority: ⬇️ Low

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

Merge Risk: ⚪ Minimal · up to 8cb96

The new family CLI commands preserve optional runtime defaults and have no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 8 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 262 functions across 50 files. (30 skipped… 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 No cross-family dependency or central registry edit was introduced. All 80 changed paths are under the ten owning family directories; added-line scanning found no references to another migrated family…
Shared Semantic Neutrality ✅ Passed Shared semantic neutrality check passes. The pull request changes 80 files, all located within family-owned directories (families/{family_name}/). No changes are made to shared code outside family-o…
Benchmark Validation Integrity ✅ Passed No benchmark-validation integrity failure was introduced. The E2E tests for all ten families keep the same reference model, cosine calculation, parity thresholds, evidence stages, output parsing, and …
Shared Change Blast Radius ✅ Passed The shared-change check does not apply. The authoritative diff contains 80 changed paths, all under the ten owning families/<name>/ trees; no shared code, contracts, tooling, examples, benchmarks, c…
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding CLI commands for ten encoder families.
Description check ✅ Passed The description covers the required sections, identifies the affected families and API changes, records validation commands and results, and states remaining validation gaps and risk.
Full details: Docstring Coverage

Explanation

Docstring coverage is 6.49% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 262 functions across 50 files. (30 skipped: 20 unsupported, 10 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:34

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