Skip to main content

Module perfmodel

Module perfmodel 

Source
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§

engine
Compiled-engine layer.
memory
KV-cache memory estimation.

Structs§

EngineConfig
Static engine identity and setup information carried by an crate::perfmodel::engine::spec::EngineSpec.
ForwardPassMetrics
Per-iteration forward-pass metrics.
ForwardPassPerfDiagnostics
Current readiness and tuning state for a ForwardPassPerfModel.
ForwardPassPerfModel
Forward-pass-level performance model with optional online tuning.
ForwardPassPerfOptions
In-memory tuning controls for ForwardPassPerfModel.
ParallelMapping
Parallelism layout. Flattened into EngineConfig so the flat wire keys (tp_size, pp_size, …) parse unchanged.
QuantizationConfig
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.
QueuedRequestMetrics
Metrics for requests queued but not scheduled in one iteration.
ScheduledRequestMetrics
Metrics for requests scheduled in one forward-pass iteration.
SpeculativeConfig
Multi-Token Prediction speculative-decoding parameters. Wrapped in Option<> on EngineConfig so 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 above aic-core.

Enums§

AicError
All errors surfaced by the Rust core.
BackendKind
Backend performance database family.
DataType
Precision/quantization dtypes carried on the engine-config wire.
ForwardPassPerfReadiness
Readiness state reported by ForwardPassPerfDiagnostics.
ForwardPassPerfSource
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 with AicError::UnsupportedSchemaVersion when version does not match.