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.
C Task ABI and header-only C++ SDKcore/api/include/trtmc/Typed user requests/results, versioned C tables and user-compiled RAII wrappers.
Internal Task contractscore/runtime/include/trtmc/internal/Release-coupled abstract interfaces implemented by families; not a public C++ ABI.
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/api/runtime/libtrtmc_c.so.1: C transport, direct internal Task calls, ownership and error conversion; no family policy.
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/C Task/BYOK contracts
applications -> header-only C++ SDK
header-only C++ SDK -> C ABI
C ABI implementation -> internal abstract Task contracts
family build -> BuildRequest + BundleWriter + TensorRT build API
family runtime -> BundleReader + internal 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.