-
-
Notifications
You must be signed in to change notification settings - Fork 0
Inference Routing and Planning
Section: AI & Inference · Media-Playback-System · Home · ONNX-Execution-Providers
Inference routing selects and validates execution providers for pipeline stages. Provider registered ≠ model ready. Windows preference: TensorRT RTX plugin, Windows ML catalog routes, DirectML fallback.
The planning system is built around a centralized logic that evaluates model metadata against a "Hardware Matrix" to determine the optimal execution path.
| Component | Description |
|---|---|
IRuntimePlanner |
The primary interface for determining if a stage can run and selecting the best execution route. |
HardwareMatrix |
A structured representation of the local machine's capabilities, including detected GPUs and supported Execution Providers. |
ModelManifest |
Authoritative metadata for a model, including expected_runtime, engine_family, and licensing information. |
CommercialSafeEvaluator |
Validates that a selected route complies with commercial licensing restrictions. |
The following diagram illustrates the decision flow when a pipeline stage requests a runtime plan.
flowchart TD
Start[Stage Execution Request] --> GetManifest[Fetch Model Manifest]
GetManifest --> CheckLicense{Commercial Mode?}
CheckLicense -- Yes --> EvalLicense[Evaluate Model License]
EvalLicense --> CheckHardware[Query Hardware Matrix]
CheckLicense -- No --> CheckHardware
CheckHardware --> FilterEPs[Filter Supported EPs]
FilterEPs --> Ranking[Rank EPs by Performance Tier]
Ranking --> SmokeTest[Verify Execution Provider Path]
SmokeTest -- Success --> Ready[Return Ready Status]
SmokeTest -- Missing Files --> Blocked[Return Blocked: Download Required]
SmokeTest -- Fail --> Fallback[Attempt Legacy Fallback]
This workflow ensures that engines do not hardcode routing internally but instead rely on the planner to provide a verified execution path.
Trackdub adopts a platform-specific strategy for hardware acceleration, particularly on Windows, where it distinguishes between legacy and modern acceleration paths.
On Windows, the system prioritizes Windows ML and TensorRT RTX as modern integration surfaces.
-
TensorRT RTX: Utilized via a standalone ONNX Runtime EP ABI plugin (
NvTensorRTRTXExecutionProvider). - Windows ML: Used for certified catalog EPs (MIGraphX, OpenVINO, QNN).
- DirectML: Maintained exclusively as a legacy GPU fallback.
The HardwareMatrix is responsible for fingerprinting the machine and tracking registered EPs.
classDiagram
class HardwareMatrix {
+List~GpuInfo~ DetectedGpus
+List~string~ RegisteredProviders
+UpdateCapabilities()
+IsProviderAvailable(string providerId)
}
class RuntimePlanner {
+GetPlan(StageRequest request)
+VerifyModelReadiness(ModelId id)
}
RuntimePlanner --> HardwareMatrix : Queries
To prevent "fake readiness," the system tracks fine-grained states for every model and provider combination. A model is not considered ready simply because its class exists; it must pass multiple validation gates.
The planner evaluates the following conditions before a stage can execute:
- Provider Registered: The EP (e.g., DirectML) is known to the runtime.
- Runtime Installed: Required native binaries (e.g., ONNX DLLs) are present.
-
Model Manifest Present: The model is registered in the authoritative
bundled-models.manifest.json. - Checksum Verified: Model files in the cache match the manifest hashes.
- Hardware Provider Available: The selected GPU or NPU is actually accessible.
- Commercial eligibility: The model license allows for the current project mode.
When a plan is generated, it returns structured outcomes rather than simple booleans.
| Status | Meaning |
|---|---|
Ready |
All gates passed; execution can proceed. |
Blocked |
A mandatory requirement (like a model file) is missing. |
Skipped |
The stage was bypassed (e.g., low confidence or user toggle). |
Fallback |
The preferred high-performance route failed, falling back to CPU or DirectML. |
The RuntimePlanner utilizes the StageRuntimeRequirementsCatalog to align stages with their necessary hardware and model profiles.
// Example of how the planner might resolve a request
// Path: src/Trackdub.Inference/Runtime/Planning/RuntimePlanner.cs
public async Task<RuntimePlan> ResolvePlanAsync(RuntimeStage stage, CancellationToken ct)
{
var requirements = _catalog.GetRequirements(stage);
var manifest = _registry.GetManifest(requirements.DefaultModelId);
// Check hardware matrix and license evaluator
var ep = _hardwareMatrix.GetBestProvider(manifest.ExpectedRuntimes);
// ... validation logic ...
}Inference Routing & Planning provides the necessary abstraction to decouple high-level pipeline logic from low-level hardware concerns. By enforcing strict manifest-driven routing and honest readiness states, it ensures Trackdub remains a stable and predictable workstation regardless of the underlying hardware (CPU, NVIDIA RTX, or AMD). This system is foundational for the "local-first" mission, allowing users to leverage their hardware's full potential while maintaining data privacy.
Trackdub Engineering Wiki · Trackdub-gated · Trackdub · Contributing
Overview
Architecture
Pipeline
- Pipeline-Orchestration
- Media-Ingest-and-Preparation
- Transcription-and-VAD
- Diarization-and-Speaker-Management
- Translation-Engine
- Text-to-Speech
- Lip-Sync-and-Synthesis
- Mixing-and-Export
Desktop App
AI & Inference
- Inference-Routing-and-Planning
- ONNX-Execution-Providers
- Model-Manifests-and-Governance
- Hardware-Starter-Packs
Media & Audio
Data
Cloud & SaaS
- Cloud-API-and-Job-Management
- Web-Dashboard
- Billing-and-Quota-Management
- Webhook-Delivery-System
- Cloud-Infrastructure-Deployment
Development
Links