Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c2671d0
feat(sweeper): preserve engine request controls
jasonqinzhou Aug 19, 2026
7ce0460
feat(sweeper): pin forward-pass estimator inputs [AIC-1770]
jasonqinzhou Aug 26, 2026
f15b838
Merge main and expose AIC engine controls
jasonqinzhou Aug 26, 2026
410c7ff
refactor(perfmodel): unify estimator construction [AIC-1770]
jasonqinzhou Aug 26, 2026
633ea00
Merge origin/main into AIC-1770 estimator construction
jasonqinzhou Aug 31, 2026
b88ebcb
fix(sweeper): resolve exact estimator configs
jasonqinzhou Aug 31, 2026
d71c9a2
refactor(perfmodel): unify estimator selection and configuration
tedzhouhk Sep 17, 2026
09111ef
Merge remote-tracking branch 'origin/main' into hzhou-codex/pr13-esti…
tedzhouhk Sep 17, 2026
2e591ec
test(perfmodel): align merged fixtures with canonical API
tedzhouhk Sep 17, 2026
56db663
fix(perfmodel): validate search estimator controls before execution
tedzhouhk Sep 17, 2026
8140fc9
fix(perfmodel): pin native replay identity and reject trailing config…
tedzhouhk Sep 17, 2026
2f72e02
fix(replay): retain rank-level memory controls in canonical timing co…
tedzhouhk Sep 17, 2026
b927ff9
fix(perfmodel): preserve estimator contracts across replay and search
tedzhouhk Sep 17, 2026
3cf3d33
fix(perfmodel): validate availability and preserve resolved estimator…
tedzhouhk Sep 17, 2026
a58055e
fix(perfmodel): close configuration and release contract gaps
tedzhouhk Sep 17, 2026
521f528
chore(ci): merge main and preserve release gating
tedzhouhk Sep 17, 2026
057c66e
feat(sweeper): preserve engine request controls on canonical estimato…
jasonqinzhou Sep 17, 2026
6d6eb3f
Merge origin/main and preserve downstream publication gate
tedzhouhk Sep 18, 2026
1b1aba2
fix(perfmodel): enforce readiness and preserve role configuration
tedzhouhk Sep 18, 2026
41fc547
Merge main resource supervision and retain estimator regression tests
tedzhouhk Sep 18, 2026
1291c77
fix(ci): validate migration gates for the publication target
tedzhouhk Sep 18, 2026
a01b1ae
Merge current PR 242 into engine request controls
jasonqinzhou Sep 18, 2026
85421f2
feat(cli): add native timing and source detail reports
jasonqinzhou Sep 18, 2026
16a05e6
fix(perfmodel): reject overflowing diagnostic token shapes
jasonqinzhou Sep 18, 2026
bd6d242
Merge main to focus engine-controls PR on remaining changes
jasonqinzhou Sep 18, 2026
49aa6cc
Merge main and adapt engine controls to consolidated Python packages
jasonqinzhou Sep 18, 2026
638028a
Fix review findings in engine controls, FPM readiness and replay vali…
jasonqinzhou Sep 18, 2026
d3e5003
Align default MoE backend semantics and document synthetic prefix bounds
jasonqinzhou Sep 18, 2026
0b4cca8
fix(replay): preserve explicit model controls across compatibility gates
jasonqinzhou Sep 18, 2026
ba103e6
Merge remote-tracking branch 'origin/main' into codex/pr269-refresh-m…
jasonqinzhou Sep 18, 2026
fc3d734
Merge updated engine-controls base into timing and source reports
jasonqinzhou Sep 18, 2026
4e5cef6
fix(replay): require support for explicit MTP acceptance
jasonqinzhou Sep 18, 2026
8e885d5
fix(cli): validate diagnostic evidence and preserve partial provenance
jasonqinzhou Sep 18, 2026
ae9d49c
Merge current engine-controls parent for final validation
jasonqinzhou Sep 18, 2026
270f029
test(cli): verify diagnostic validation uses the CLI error exit
jasonqinzhou Sep 18, 2026
adda786
fix(api): publish the native phase diagnostics type signature
jasonqinzhou Sep 18, 2026
d3a10c4
fix(replay): reject unsupported controls at direct AFD boundary
jasonqinzhou Sep 18, 2026
8dff89a
Merge remote-tracking branch 'origin/main' into codex/pr269-refresh-m…
jasonqinzhou Sep 18, 2026
01b4de5
fix(diagnostics): retain specific SOL absence reasons
jasonqinzhou Sep 18, 2026
02b7750
test(sweeper): assert fractional MTP acceptance forwarding
jasonqinzhou Sep 18, 2026
6996377
test(fpm): expect corrupt system YAML to fail closed
jasonqinzhou Sep 18, 2026
767c20a
Merge remote-tracking branch 'origin/main' into codex/pr269-refresh-m…
jasonqinzhou Sep 18, 2026
6faa82e
Merge remote-tracking branch 'origin/main' into codex/pr269-refresh-m…
jasonqinzhou Sep 18, 2026
e22e03f
Merge commit '6faa82ebb9cc264c717a6cfff56e05ffb90a52d4' into codex/pr…
jasonqinzhou Sep 18, 2026
33942fc
test(fpm): expect corrupt system YAML to fail closed
jasonqinzhou Sep 18, 2026
8c93993
Merge commit '33942fc8d5a172a8b3fd1dbd86b1055f674a11b4' into codex/pr…
jasonqinzhou Sep 19, 2026
c45da2c
fix(diagnostics): align native and schema validation contracts
jasonqinzhou Sep 19, 2026
7301939
Merge current main into PR 269
jasonqinzhou Sep 19, 2026
8686276
fix(engine): reject unsupported decoder replay
jasonqinzhou Sep 19, 2026
4cb1eae
Merge commit '7301939e0efc2c919b090102306240b9c64789e1' into codex/pr…
jasonqinzhou Sep 19, 2026
9282f93
style(tests): sort runner imports
jasonqinzhou Sep 19, 2026
6eab22f
style(config): format decoder replay validation
jasonqinzhou Sep 19, 2026
ef9d16f
Merge commit '6eab22fc8a2c38fd941d98344e98318be6c77c29' into codex/pr…
jasonqinzhou Sep 19, 2026
5735cd2
fix(config): preserve lightweight supervision imports
jasonqinzhou Sep 19, 2026
92866bf
Merge validated parent into timing and source reports
jasonqinzhou Sep 19, 2026
ebc898e
Record merged parent ancestry without changing reviewed tree
jasonqinzhou Sep 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/release-gates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"pending_migrations": [
{
"pull_request": "https://github.com/ai-dynamo/dynamo/pull/14065",
"requirement": "Refresh and merge Dynamo's Planner and wheel-smoke migration to best_available(config), with required worker_type, nested estimator_config, and the released-wheel compatibility bridge. Validate against the canonical wheel before clearing this gate and releasing the API."
}
]
}
14 changes: 14 additions & 0 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,20 @@ jobs:
}
}
core.setFailed('commit_sha is not on main or any release/* branch');
# Both scheduled and approved manual publication require completed migrations.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ steps.target.outputs.sha }}
persist-credentials: false
# Keep the checker/current policy trusted while also checking the exact
# publication target's migration declarations. Neither can bypass the other.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ github.sha }}
path: release-policy
persist-credentials: false
- name: Require completed downstream API migrations
run: python3 release-policy/scripts/check_release_migrations.py --target-gates .github/release-gates.json
# Computed once here so both arch legs stamp the same date even if the
# run crosses a UTC midnight.
- name: Compute unique nightly version
Expand Down
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

This file adds explicit repository-wide development guards.

## Performance Model Changes

Before changing a performance model, its configuration, or a caller in Rust,
Python, CLI, Sweeper, Replay, or Planner, MUST read and follow
[`perfmodel-api.md`](python/aisimulate/.claude/rules/perfmodel-api.md).
This includes new features and configuration migrations.

## Required First Step

Before making any change under:
Expand Down
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ rand_chacha = "0.3.1"
rustc-hash = "2"
serde = { workspace = true }
serde_json = { workspace = true }
serde_path_to_error = "0.1"
serde_yaml = "0.9"
sha2 = "0.10"
slotmap = "1"
Expand Down
125 changes: 116 additions & 9 deletions crates/core/parity_tests/perfmodel/test_engine_step_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,10 @@ def __call__(self):

def _quiet_call(func, *args, **kwargs):
"""Keep interpolation loader chatter out of parity test output."""
with contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()):
with (
contextlib.redirect_stdout(io.StringIO()),
contextlib.redirect_stderr(io.StringIO()),
):
return func(*args, **kwargs)


Expand Down Expand Up @@ -1135,7 +1138,9 @@ def _comparison_metrics(
return {name: (python_metrics[name], rust_metrics[name]) for name in rust_metrics}


def _static_comparison_metrics(case: EngineStepParityCase) -> dict[str, tuple[float, float]]:
def _static_comparison_metrics(
case: EngineStepParityCase,
) -> dict[str, tuple[float, float]]:
return _comparison_metrics(case, "static")


Expand All @@ -1145,11 +1150,15 @@ def _mixed_step_comparison_metrics(
return _comparison_metrics(case, "mixed")


def _agg_comparison_metrics(case: EngineStepParityCase) -> dict[str, tuple[float, float]]:
def _agg_comparison_metrics(
case: EngineStepParityCase,
) -> dict[str, tuple[float, float]]:
return _comparison_metrics(case, "agg")


def _disagg_comparison_metrics(case: EngineStepParityCase) -> dict[str, tuple[float, float]]:
def _disagg_comparison_metrics(
case: EngineStepParityCase,
) -> dict[str, tuple[float, float]]:
return _comparison_metrics(case, "disagg")


Expand Down Expand Up @@ -1432,7 +1441,14 @@ class TestRustEngineHandleDatabasePolicyIdentity:
"""

def _static_ctx_ms(self, model, view) -> float:
rc = config.RuntimeConfig(batch_size=1, beam_width=1, isl=1024, osl=8, prefix=0, engine_step_backend="rust")
rc = config.RuntimeConfig(
batch_size=1,
beam_width=1,
isl=1024,
osl=8,
prefix=0,
engine_step_backend="rust",
)
ctx_latency, _gen, *_ = rust_engine_step.estimate_static_latency_breakdown_with_rust(
model, view, rc, "static_ctx", 1, 1.0
)
Expand Down Expand Up @@ -2332,7 +2348,12 @@ def test_hybrid_ngram_mixed_pin(self, fpm_systems_root):

model, backend, database = self._build_ngram()
rc = config.RuntimeConfig(batch_size=4, beam_width=1, isl=1024, osl=2)
est = backend.run_mixed(model, database, rc, MixedStepInput(context_tokens=1024, num_decode_requests=1))
est = backend.run_mixed(
model,
database,
rc,
MixedStepInput(context_tokens=1024, num_decode_requests=1),
)
value = est.latency_ms
if _FPM_HYBRID_MIXED_FROZEN is None:
print(f"\nPIN mixed: {value!r}")
Expand All @@ -2342,6 +2363,77 @@ def test_hybrid_ngram_mixed_pin(self, fpm_systems_root):


class TestRustEngineStepFpmParity:
@pytest.mark.parametrize("database_mode", ["SILICON", "HYBRID"])
def test_auto_skips_absent_op_tables(self, fpm_systems_root, database_mode):
from aiconfigurator_core.sdk import ForwardPassPerfModelConfig, RustForwardPassPerfModel

cfg = ForwardPassPerfModelConfig(
model=_FPM_MODEL,
system="b200_sxm",
backend="vllm",
backend_version=_FPM_VERSION,
worker_type="decode",
tp=2,
moe_tp_size=1,
moe_ep_size=2,
gemm_quant_mode="fp8_block",
moe_quant_mode="fp8_block",
fmha_quant_mode="bfloat16",
kvcache_quant_mode="fp8",
comm_quant_mode="half",
systems_paths=(str(fpm_systems_root),),
database_mode=database_mode,
)
model = RustForwardPassPerfModel.best_available(cfg)
try:
provenance = model.diagnostics()["provenance"]
assert provenance["selected_estimation_mode"] == "fpm_interpolation"
assert "gemm_perf.parquet" in provenance["selection_failures"][0]
# Exact measured fixture row: four decode requests, 4,100 total KV.
assert model.estimate_forward_pass_time_ms(
{
"version": 1,
"scheduled_requests": {"num_decode_requests": 4, "sum_decode_kv_tokens": 4100},
}
) == pytest.approx(4.5)
finally:
model.close()
from dataclasses import replace

from aiconfigurator_core.sdk.errors import PerfDataNotAvailableError

with pytest.raises(PerfDataNotAvailableError, match="required op-level data unavailable"):
RustForwardPassPerfModel.best_available(replace(cfg, estimation_mode="op_level"))

def test_sol_does_not_require_op_tables(self, fpm_systems_root):
from aiconfigurator_core.sdk import ForwardPassPerfModelConfig, RustForwardPassPerfModel

model = RustForwardPassPerfModel.best_available(
ForwardPassPerfModelConfig(
model="Qwen/Qwen3-32B",
system="b200_sxm",
backend="vllm",
backend_version=_FPM_VERSION,
worker_type="decode",
tp=2,
systems_paths=(str(fpm_systems_root),),
database_mode="SOL",
)
)
try:
assert model.diagnostics()["provenance"]["selected_estimation_mode"] == "op_level"
assert (
model.estimate_forward_pass_time_ms(
{
"version": 1,
"scheduled_requests": {"num_decode_requests": 4, "sum_decode_kv_tokens": 4100},
}
)
> 0
)
finally:
model.close()

"""forward_model='fpm' regression vs the frozen Python reference.

The Python FPM walk is gone (Phase 2 PR-3); the live side below is the
Expand Down Expand Up @@ -2417,7 +2509,11 @@ def test_fpm_arena_selects_the_fpm_engine(self, fpm_systems_root, monkeypatch):
"nextn": None,
"forward_model": "fpm",
}
model = RustForwardPassPerfModel.from_native(config)
from aiconfigurator_core.sdk import ForwardPassPerfModelConfig

model = RustForwardPassPerfModel.best_available(
ForwardPassPerfModelConfig.from_legacy_engine_config(config, "aggregated")
)
decode_only = [
{
"version": 1,
Expand Down Expand Up @@ -2471,7 +2567,13 @@ def test_fpm_spec_tags(self, fpm_systems_root, monkeypatch):
("static_gen", 4, 1024, 2, 0), # exact decode hit at B=4
("static_gen", 2, 1024, 2, 0), # uncollected batch -> transfer (SOL)
("static_gen", 4, 9_000_000, 2, 0), # out of domain -> both error
("static_ctx", 16, 256, 1, 0), # above the batch ceiling -> pure clamp (kv/T = 0)
(
"static_ctx",
16,
256,
1,
0,
), # above the batch ceiling -> pure clamp (kv/T = 0)
("static_ctx", 16, 320, 1, 256), # high KV pressure -> SOL-rescaled clamp
],
)
Expand All @@ -2490,7 +2592,12 @@ def test_fpm_static_parity(self, fpm_systems_root, monkeypatch, mode, batch, isl
(0, 4, 1024, 2), # gen-only keeps full decode
(0, 600, 100, 2), # gen-only across the decode regime boundary (eager side)
(1024, 0, 1024, 2), # prefill-only chunk
(4096, 0, 256, 1), # 16 whole prefills: certified batch clamp to the ceiling
(
4096,
0,
256,
1,
), # 16 whole prefills: certified batch clamp to the ceiling
],
)
def test_fpm_mixed_step_parity(self, fpm_systems_root, monkeypatch, ctx_tokens, gen_tokens, isl, osl):
Expand Down
41 changes: 41 additions & 0 deletions crates/core/src/engine/timing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub struct TimingOperationEvidence {
pub latency_ms: f64,
pub covered_latency_ms: f64,
pub source: TimingEvidenceSource,
pub details: Option<crate::perfmodel::engine::diagnostics::OperationDetails>,
}

impl TimingOperationEvidence {
Expand All @@ -88,6 +89,7 @@ impl TimingOperationEvidence {
latency_ms,
covered_latency_ms,
source,
details: None,
}
.canonicalized()
}
Expand Down Expand Up @@ -119,6 +121,18 @@ impl TimingOperationEvidence {
self.covered_latency_ms,
self.latency_ms
);
if let Some(sol) = self
.details
.as_ref()
.and_then(|details| details.sol.as_ref())
{
ensure!(
[sol.latency_ms, sol.math_ms, sol.memory_ms]
.iter()
.all(|v| v.is_finite() && *v >= 0.0),
"invalid SOL evidence"
);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
self.energy_wms = self.energy_wms.filter(|energy| *energy > 0.0);
if self.energy_wms.is_none() {
self.covered_latency_ms = 0.0;
Expand All @@ -137,6 +151,32 @@ impl TimingOperationEvidence {
(None, None) => None,
};
combined.source = combined.source.merge(other.source);
combined.details = match (combined.details, other.details) {
(Some(mut left), Some(right)) => {
left.sol = match (left.sol, right.sol) {
(Some(mut a), Some(b)) => {
a.latency_ms += b.latency_ms;
a.math_ms += b.math_ms;
a.memory_ms += b.memory_ms;
Some(a)
}
_ => None,
};
if left.sol.is_none() {
left.sol_unavailable_reason = left
.sol_unavailable_reason
.or(right.sol_unavailable_reason)
.or_else(|| Some("some accumulated operations lack SOL evidence".into()));
}
for fallback in right.fallbacks {
if !left.fallbacks.contains(&fallback) {
left.fallbacks.push(fallback);
}
}
Some(left)
}
_ => None,
};
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
*self = combined.canonicalized()?;
Ok(())
}
Expand Down Expand Up @@ -629,6 +669,7 @@ mod tests {
latency_ms: 10.0,
covered_latency_ms: 10.0,
source: TimingEvidenceSource::Empirical,
details: None,
};

let raw_phase = TimingPhaseEvidence {
Expand Down
31 changes: 22 additions & 9 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,31 @@ pub use replay::{ReplayReport, ReplaySpec, Replayer};
// the explicit `ReplayEngineConfig` alias above.
pub use perfmodel::EngineConfig;
pub use perfmodel::{
AicError, BackendKind, DataType, DatabaseMode, ENGINE_CONFIG_SCHEMA_VERSION,
ENGINE_SPEC_SCHEMA_VERSION, EstimateSource, FPM_VERSION, ForwardPassMetrics,
ForwardPassPerfDiagnostics, ForwardPassPerfModel, ForwardPassPerfOptions,
ForwardPassPerfReadiness, ForwardPassPerfSource, ForwardPassRegressionStoreDiagnostics,
ForwardPassRegressionWorkloadKind, ForwardPassWorkerType, KvCacheEstimate,
KvCacheEstimateAdjusted, KvCacheEstimateError, KvCacheEstimateOptions, KvCacheEstimateRequest,
KvCacheMemoryFraction, MemoryBreakdown, ParallelMapping, QuantizationConfig,
QueuedRequestMetrics, ScheduledRequestMetrics, SpeculativeConfig,
AicError, BackendKind, CorrectionConfig, DataType, DatabaseMode, ENGINE_CONFIG_SCHEMA_VERSION,
ENGINE_SPEC_SCHEMA_VERSION, EstimateSource, EstimationMode, EstimatorConfig, FPM_VERSION,
ForwardPassFallbackPolicy, ForwardPassMetrics, ForwardPassPerfDiagnostics,
ForwardPassPerfModel, ForwardPassPerfModelConfig, ForwardPassPerfOptions,
ForwardPassPerfProvenance, ForwardPassPerfReadiness, ForwardPassPerfSource,
ForwardPassRegressionStoreDiagnostics, ForwardPassRegressionWorkloadKind,
ForwardPassWorkerType, FpmRegressionConfig, KvCacheEstimate, KvCacheEstimateAdjusted,
KvCacheEstimateError, KvCacheEstimateOptions, KvCacheEstimateRequest, KvCacheMemoryFraction,
MemoryBreakdown, ParallelMapping, QuantizationConfig, QueuedRequestMetrics,
RegressionFeatureWeights, SamplingConfig, ScheduledRequestMetrics, SpeculativeConfig,
};
pub use perfmodel::{
CorrectionFactorBounds, CorrectionFeatureSpace, FpmInterpolationConfig, OpLevelConfig,
RegressionFitConfig, RegressionFitKind,
};

#[cfg(feature = "python")]
pub use perfmodel::{AicEngine, AicEngineBuilder, estimate_kv_cache};
pub use perfmodel::{
AicEngine,
// Low-level Rust embedder API for compiled step-latency handles. This is
// deliberately not registered on the Python module and is not an
// alternative ForwardPassPerfModel construction boundary.
AicEngineBuilder,
estimate_kv_cache,
};

// The imported perf-model sources historically used additional crate-root
// module paths. Keep these module aliases crate-private so the mirror subtree
Expand Down
Loading
Loading