Skip to main content

Units and Ownership

The repository uses one primary ownership rule: model-specific behavior stays inside one families/<family>/ vertical slice. Similar code is deliberately duplicated across families until a stable model-agnostic contract exists.

Public contracts

ContractLocationOwns
Python build request and entry pointcore/builder/tensorrt_model_connect/build.pyResolved build inputs and one control transfer to a family.
Model support protocolcore/builder/tensorrt_model_connect/model_support.pyDependency-free exact checkpoint matching.
Bundle writercore/builder/tensorrt_model_connect/bundle_writer.pyFormat-1 header and streaming named sections.
Task APIcore/runtime/include/trtmc/task.hUser-visible task requests and results.
Bundle APIcore/runtime/include/trtmc/bundle.hBounded immutable bundle inspection and section reads.
Family factory and loadercore/runtime/include/trtmc/runtime/family_factory.h, family_loader.hOne family/backend control transfer.
Engine APIcore/runtime/include/trtmc/runtime/trt_backend.h, trt_module.hBackend-neutral engine creation, binding, and enqueue.
BYOK APIcore/runtime/include/trtmc/byok.hExplicit TVM-FFI kernel binding.

Physical units

UnitOwnership boundary
families/<family>/All topology, weight mapping, bundle-section semantics, native pipeline, model dependencies, fixtures, manifests, thresholds, and oracles for one family.
core/builder/Model-agnostic Python build contracts, discovery, bundle mechanics, and unit tests.
core/runtime/bundle/ and primitives/libtrtmc_core.so bundle, tensor, CUDA, and engine primitives.
core/runtime/loader/libtrtmc_runtime.so exact family/backend loading.
core/runtime/tensorrt/Standard TensorRT and optional TensorRT-RTX Engine implementations.
apps/cli/Native command parsing and private image/WAV/file adapters.
apps/benchmark/Benchmark catalog, workers, reference runners, and reporting policy.
examples/Optional applications over public APIs.

Allowed dependency direction

applications -> public build/load/Task/BYOK contracts
family build -> BuildRequest + BundleWriter + TensorRT build API
family runtime -> BundleReader + Task + Engine contracts
runtime loader -> bundle + factory + backend contracts
TensorRT backend -> Engine contract

The always-forbidden edges are family-to-family dependencies, core-to-concrete family dependencies, backend-to-family dependencies, and family/core dependencies on applications. A family-local custom TensorRT plugin is allowed only when the family graph genuinely requires it; TVM-FFI BYOK remains the model-agnostic custom-kernel boundary.