Skip to content

fix(planner): use canonical AIC estimator config [AIC-1770] - #14065

Closed
jasonqinzhou wants to merge 2 commits into
mainfrom
jasonzho/aic-1770-forward-pass-construction
Closed

jasonqinzhou wants to merge 2 commits into
mainfrom
jasonzho/aic-1770-forward-pass-construction

Conversation

@jasonqinzhou

@jasonqinzhou jasonqinzhou commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Overview:

Migrate Dynamo Planner and the wheel smoke contract to AISimulate's canonical forward-pass estimator construction API.

This is the compatibility companion for ai-dynamo/aisimulate#13. It must merge before AISimulate PR 13 is merged or released.

Details:

  • Build ForwardPassPerfModelConfig and ForwardPassPerfOptions for every Planner construction path and call RustForwardPassPerfModel.best_available.
  • Preserve a temporary capability-detected bridge for the currently released pre-canonical wheel, so this PR can merge first without breaking Planner.
  • Migrate the Dynamo wheel smoke from the removed from_native constructor to the canonical typed API.
  • Keep the regression fallback tunable when Planner has no native AIC configuration.
  • Cover canonical, legacy-wheel, and real native-estimator paths.

Required order:

  1. Merge this Dynamo PR.
  2. Merge and release AISimulate PR 13.
  3. After Dynamo's minimum AISimulate version contains the canonical API, remove the temporary legacy branch in a follow-up.

Validation:

  • 33 passed across focused Planner unit and native integration tests.
  • Ruff 0.5.2 checks passed for all touched Python files.
  • Python compile checks passed.

Where should the reviewer start?

  • components/src/dynamo/planner/core/perf_model/engine_query.py
  • components/src/dynamo/planner/core/perf_model/aic_adapter.py
  • tests/wheels/smoke_install.py

Related Issues

🚫 This PR is NOT linked to a GitHub issue:

  • Confirmed — no related GitHub issue

Related Linear issue: AIC-1770.

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility when initializing performance models with current or legacy configuration formats.
    • Preserved fallback behavior for environments that do not support the latest configuration types.
    • Added clearer warnings when planner configuration is unavailable or unsupported.
  • Tests

    • Expanded coverage for speculative decoding, fallback behavior, typed configuration, and installation smoke checks.

Signed-off-by: Jason Zhou (Engrg-Hardware 1) <jasonzho@nvidia.com>
@jasonqinzhou
jasonqinzhou requested review from a team as code owners August 31, 2026 18:43
@copy-pr-bot

copy-pr-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7cf2489d-4eb7-4238-b73e-1fbb1300c961

📥 Commits

Reviewing files that changed from the base of the PR and between acda8d2 and 9b6cd83.

📒 Files selected for processing (6)
  • components/src/dynamo/planner/core/perf_model/aic_adapter.py
  • components/src/dynamo/planner/core/perf_model/engine_query.py
  • components/src/dynamo/planner/tests/integration/test_aic_native_estimator.py
  • components/src/dynamo/planner/tests/unit/test_aic_perf_adapter.py
  • components/src/dynamo/planner/tests/unit/test_engine_query.py
  • tests/wheels/smoke_install.py

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


Walkthrough

The planner now builds canonical and legacy AIC configurations. Engine creation supports typed canonical SDK inputs, legacy configurations, and regression fallback paths. Unit, integration, and wheel smoke tests cover these paths.

Changes

AIC configuration compatibility

Layer / File(s) Summary
Canonical and legacy configuration builders
components/src/dynamo/planner/core/perf_model/aic_adapter.py
The adapter builds canonical model, backend, parallelism, quantization, speculative-decoding, and fallback fields. It also supplies the legacy configuration and preserves legacy nextn handling.
Compatible engine construction
components/src/dynamo/planner/core/perf_model/engine_query.py, tests/wheels/smoke_install.py
The engine query detects canonical SDK types and constructs typed inputs when available. It uses the legacy path or regression fallback when canonical types are unavailable. The smoke test uses the typed factory path.
Configuration and fallback validation
components/src/dynamo/planner/tests/unit/test_aic_perf_adapter.py, components/src/dynamo/planner/tests/unit/test_engine_query.py, components/src/dynamo/planner/tests/integration/test_aic_native_estimator.py
Tests validate canonical and legacy payloads, typed facade wiring, pre-canonical fallback behavior, and unsupported configuration reporting.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 9b6cd

The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary change: updating the Planner to use the canonical AIC estimator configuration. It is concise and specific.
Description check ✅ Passed The description includes the required Overview, Details, reviewer-start guidance, and Related Issues sections. It explains the migration, compatibility bridge, validation, sequencing, and related Line…
Full details: Description check

Explanation

The description includes the required Overview, Details, reviewer-start guidance, and Related Issues sections. It explains the migration, compatibility bridge, validation, sequencing, and related Linear issue. It also confirms that no GitHub issue is linked.

  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

…-construction

Signed-off-by: Jason Zhou (Engrg-Hardware 1) <jasonzho@nvidia.com>
import msgspec
import aiconfigurator_core
from aiconfigurator_core.sdk import RustForwardPassPerfModel
from aiconfigurator_core.sdk import (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository still pins aiconfigurator-core==0.11.0.dev20260728, and the new planner bridge explicitly supports that pre-canonical wheel. This smoke script now unconditionally imports the canonical types, so the mocker-extra wheel smoke will fail with ImportError against the pinned release before validating the installed wheels. Keep the smoke test compatible with the supported legacy wheel or update every synchronized AIC dependency pin once the canonical API is published.

🤖 AI Fix

Gate the canonical imports and construction on API availability, using the legacy estimator API for the pinned pre-canonical wheel.

_DURATION_EXCLUSIVE_MAX_SECONDS = float(1 << 64)

AicForwardPassPerfModel = aic_sdk.RustForwardPassPerfModel
# Rolling-release bridge: merge this Dynamo migration before AISimulate PR #13.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Condense this migration narrative. Retain only that the legacy branch supports older wheels and that the SDK exports these types lazily; the AISimulate PR reference, release-order explanation, and planned-removal history are transient implementation history.

🤖 AI Fix

Replace these lines with a concise comment describing the older-wheel compatibility requirement and lazy SDK exports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants