refactor(vision): migrate Inception classifiers to Task SDK - #1334
Conversation
Implement family-owned image class-score Tasks, bindings and complete result metadata. Preserve each model graph, preprocessing and existing oracle while exercising public C/C++ consumers and owned benchmark references. No shared implementation or sibling-family dependency is added. Signed-off-by: yifeif-nv <277870278+yifeif-nv@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (45)
Included review availability: Your plan provides up to 12 included reviews per hour; 5 remain after this review. 📝 SummarySummaryThis change migrates the Inception, Inception-v4, and Inception-ResNet families from Each family now:
The change adds CPU task-contract tests, public C and C++ SDK consumers, E2E checks, and performance reference coverage. Performance workloads, sampling, margins, and timing boundaries remain unchanged. Architecture impactFamily-owned filesThe implementation remains within the three owning family directories:
The family directories contain model metadata, runtime pipelines, plugins, contract tests, SDK consumers, E2E tests, manifests, and performance references. Shared surfacesNo shared implementation, registry, CLI, benchmark, website, or workflow changes are reported. The new runtime code consumes existing internal task contracts. It does not add family-specific behavior to shared code. Dependency directionsThe dependency direction remains:
No cross-family implementation or validation dependency is reported. Affected consumersThe affected consumers include:
Existing consumers that request Unresolved blast-radius questionsExisting bundles require rebuilding because the primary task and family runtime metadata changed. The supplied evidence does not establish completion of multi-device execution, full Nightly, complete package qualification, all-profile GPU qualification, or remote Pre-merge checks. Review finding counts are unavailable because no current review findings were supplied. ValidationReported validation includes:
OutcomeHUMAN REVIEW REQUIRED The implementation and family ownership evidence are clear, but full compatibility and qualification remain unresolved. Human review must confirm migration impact for existing WalkthroughThe three Timm image families now use the ChangesTimm Inception
Timm Inception-ResNet
Timm Inception-v4
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant SDK
participant FamilyPlugin
participant ImageToClassScoresPipeline
participant TensorRT
SDK->>FamilyPlugin: Load bundle and submit image request
FamilyPlugin->>ImageToClassScoresPipeline: Provide runtime metadata
ImageToClassScoresPipeline->>TensorRT: Execute preprocessed RGB tensor
TensorRT-->>ImageToClassScoresPipeline: Return logits
ImageToClassScoresPipeline-->>SDK: Return scores, vocabulary ID, and labels
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No concrete current-head issue remains; the migrated classification path emits the expected score payload. 🚥 Pre-merge checks | ✅ 7 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (7 passed)
Full details: Docstring CoverageExplanation 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 231 functions across 36 files. (9 skipped: 9 unsupported.) Full details: Benchmark Validation IntegrityExplanation The new benchmark comparisons do not measure equivalent regions. Each new Resolution Use one measurement contract for both paths. The simplest fix is to preload only the image asset, then perform the same resize/normalize and device transfer inside every timed reference invocation. Declare Comment |
Background
Migrate Inception, Inception-v4 and Inception-ResNet to the existing image-class-score Task SDK.
These three independent families use the same contract, so they are grouped in
one reviewable migration PR. Every changed file belongs to one of:
families/timm_inception/**families/timm_inception_v4/**families/timm_inception_resnet/**This follows the shared SDK in #1226 and the merged MobileNetV3 pattern in #1308.
It does not introduce a shared model implementation or a dependency between families.
Exit Criteria
IModelandIImageToClassScores, with its ownbinddeclaration, correct bundle primary Task, and complete owned logits.
do not replace a family's existing acceptance rule with a weaker common check.
checks remain required before merge; this submission does not claim Pre-merge green.
Implementation
classificationtoimage_to_class_scores; no legacy alias or fallback execution.and vocabulary identity are published; absent identity stays empty. No hashes
or invented cross-model IDs.
binding, input/output, metadata and result-lifetime CPU contracts.
mechanism. The existing E2Es call both SDKs with identical decoded RGB pixels,
compare every score, and read results after model release. Original JPEG CLI
and reference paths remain; different decoders are not claimed bitwise identical.
Preserve entry IDs, workloads, precision, 3/10 sampling and 5% margin.
No shared header, registry, CLI, benchmark implementation, website or workflow edit.
Change categories
Public C layouts and bundle format 1 are unchanged. Primary Task and family
runtime metadata change, so rebuild existing bundles for these family runtimes.
Validation
Commands and Results
With the existing native dependencies and E2E environment:
cmake --build build --target trtmc trtmc_backend_trt trtmc_benchmark_worker test_timm_inception_task_contract test_timm_inception_image_preprocess test_timm_inception_v4_task_contract test_timm_inception_v4_image_preprocess test_timm_inception_resnet_task_contract test_timm_inception_resnet_image_preprocess:passed, including the six public SDK consumer binaries.
ctest --test-dir build --output-on-failure -R '^(timm_inception|timm_inception_v4|timm_inception_resnet)_(task_contract|image_preprocess)$':6/6 CPU tests passed.
python -m pytest families/timm_inception/tests families/timm_inception_v4/tests families/timm_inception_resnet/tests -m 'not gpu and not trt and not e2e' -q:95 passed; 3 explicitly unselected E2E cases skipped.
python -m pytest families/timm_inception/tests/test_e2e.py families/timm_inception_v4/tests/test_e2e.py families/timm_inception_resnet/tests/test_e2e.py --e2e-testcase inception-v3-tv-in1k --e2e-testcase inception-v4-tf-in1k --e2e-testcase inception-resnet-v2-tf-in1k -q:3 passed (three actual checkpoint cases), including C/C++ calls.
python3 -m tools.community_ci source-quality --base 9d65d3bf0022255237df36727a3a2b3f6de3a5d4:legal, inventory, complexity, formatting and 212 contract tests passed.
git diff --check: passed.The existing native worker and owned references executed all three original
3-warmup / 10-measurement workloads and passed the unchanged classification
output contracts. Each native/reference result retained all 1000 scores.
This is execution/output evidence, not a latency improvement claim.
Hardware, Environment, and Revisions
9d65d3bf0022255237df36727a3a2b3f6de3a5d4.9b4d709a810e2bf3f9ea9b396f24d17c4169e03e.13.3.33, TensorRT 11.1.0.106, PyTorch 2.12.0+cu130 and timm 1.0.28. Selected
model cases use their existing FP16 manifest settings and checked-in images.
timm/inception_v3.tv_in1k393d84cc85c467d8fbc0dc81a65c04e87a32572ctimm/inception_v4.tf_in1kad5d294cda312745a9afa433e45d9ccd956a1548timm/inception_resnet_v2.tf_in1k836b07d7d599da247de92f148c7a07fda18afcedNot Run / Remaining Gaps
all-profile GPU qualification. Unselected cases remain declared.
while native public Task timing includes family preprocessing; that scope
distinction remains documented, not declared equivalent.
Contributor Self-Review
Reviewed ownership, retained model behavior, test oracles and public evidence.
Independent reviewers checked the exact changes and publication text.
Notes For Future Readers
This branch starts directly from the shared mainline base, not another migration
batch. The three families do not import one another or MobileNetV3; intentional
local duplication preserves independent ownership. Use the existing
TRTMC_NATIVE_BUILD_DIRfor development SDK consumer binaries. Core/backend/familyDSOs upgrade together, and old bundles must be rebuilt. Obsolete shared interfaces
will be removed separately after the remaining families migrate.
Risk level
Three family Task identities and runtime metadata change, but model math and
preprocessing are retained and the selected real-model paths were exercised.