Expand description
Rust-native AIConfigurator performance-model implementation.
The compiled-engine path is the only supported entry point: Python’s
compile_engine walks the model once and emits an engine::spec::EngineSpec
(op lists + EngineConfig identity); the Rust engine::Engine executes
it without re-entering Python. With the python feature enabled,
[AicEngineBuilder] is the preferred Rust → Python → Rust embedded build
entry point and [AicEngine] is the PyO3 hot-path pyclass.
This directory remains a stable mirror of the former AIConfigurator Rust crate. Keeping the imported implementation behind one namespace makes upstream syncs mechanical while the crate root remains owned by replay.
Re-exports§
pub use memory::EstimateSource;pub use memory::KvCacheEstimate;pub use memory::KvCacheEstimateAdjusted;pub use memory::KvCacheEstimateError;pub use memory::KvCacheEstimateOptions;pub use memory::KvCacheEstimateRequest;pub use memory::KvCacheMemoryFraction;pub use memory::MemoryBreakdown;
Modules§
Structs§
- Engine
Config - Static engine identity and setup information carried by an
crate::perfmodel::engine::spec::EngineSpec. - Forward
Pass Metrics - Per-iteration forward-pass metrics.
- Forward
Pass Perf Diagnostics - Current readiness and tuning state for a
ForwardPassPerfModel. - Forward
Pass Perf Model - Forward-pass-level performance model with optional online tuning.
- Forward
Pass Perf Options - In-memory tuning controls for
ForwardPassPerfModel. - Parallel
Mapping - Parallelism layout. Flattened into
EngineConfigso the flat wire keys (tp_size,pp_size, …) parse unchanged. - Quantization
Config - Precision/quantization dtypes. Flattened into
EngineConfig. Field names and types are unchanged from the former flat struct so the flat wire keys (weight_dtype,moe_dtype, …) parse unchanged. - Queued
Request Metrics - Metrics for requests queued but not scheduled in one iteration.
- Scheduled
Request Metrics - Metrics for requests scheduled in one forward-pass iteration.
- Speculative
Config - Multi-Token Prediction speculative-decoding parameters. Wrapped in
Option<>onEngineConfigso models without MTP don’t carry the noise, and#[serde(flatten)]-ed so the flat wire key (nextn) parses unchanged. Accepted-token progress is modeled aboveaic-core.
Enums§
- AicError
- All errors surfaced by the Rust core.
- Backend
Kind - Backend performance database family.
- Data
Type - Precision/quantization dtypes carried on the engine-config wire.
- Forward
Pass Perf Readiness - Readiness state reported by
ForwardPassPerfDiagnostics. - Forward
Pass Perf Source - Prediction backend currently used by
ForwardPassPerfModel.
Constants§
- ENGINE_
CONFIG_ SCHEMA_ VERSION - ENGINE_
SPEC_ SCHEMA_ VERSION - FPM_
VERSION - Wire-schema version for
ForwardPassMetrics(Dynamo’s scheduler telemetry). The FPM input is rejected withAicError::UnsupportedSchemaVersionwhenversiondoes not match.