Skip to content

test: restore B200 power CI contract - #1610

Open
jasonqinzhou wants to merge 1 commit into
mainfrom
codex/aic-1940-restore-b200-power-data-ci
Open

test: restore B200 power CI contract#1610
jasonqinzhou wants to merge 1 commit into
mainfrom
codex/aic-1940-restore-b200-power-data-ci

Conversation

@jasonqinzhou

@jasonqinzhou jasonqinzhou commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • restore the shipped B200 power-data invariant: rows must be either a finite positive power / power_limit measurement pair or the exact 0.0 / 0.0 unavailable-measurement sentinel
  • refresh the two affected TRT-LLM current-slot per-op goldens with the repository pinning tool and activate their anti-vacuous energy coverage
  • keep this maintenance-only under the AIC code freeze; no parquet data or runtime behavior changes

Linear: AIC-1940

Related: #1584, #1590, AIC-1934

Why

PR #1584 added matched B200 TRT-LLM 1.3.0rc20 power data with 487,422 measured rows and 40,549 intentional 0.0 / 0.0 sentinels for unmatched rows. A later invariant test rejected every non-positive power_limit, while the compile-engine goldens still pinned the pre-power current slot. That merge-order drift made main fail despite the shipped data satisfying its documented paired-value contract.

Validation

  • pytest tests/unit/sdk/database/test_power_data_invariants.py: 2 passed
  • compile-engine parity: 64 passed
  • full engine-step parity: 276 passed
  • Rust crate and public API tests: 539 passed, 2 ignored
  • broader Python unit/build suite: 4,857 passed, 11 skipped
  • ruff check .: passed
  • ruff format --check .: 678 files already formatted
  • golden audit: 29 intended energy_wms updates, two provenance SHA updates, zero other case-field changes, zero parquet changes

The broad local Python lane excludes tests/unit/sdk/database/test_moe_dispatch.py because the repository's macOS development environment does not install Torch; hosted container CI remains authoritative for that test.

Summary by CodeRabbit

  • Tests

    • Expanded energy-measurement validation to require complete, valid power data and support explicit zero-value cases.
    • Added focused coverage for accepted and rejected power measurements.
    • Extended performance parity checks to cover energy reporting across additional model operations and routing scenarios.
  • Chores

    • Refreshed benchmark reference data and compatibility baselines to reflect current energy measurements and runtime versions.

Signed-off-by: Jason Zhou (Engrg-Hardware 1) <jasonzho@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 8, 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.

@github-actions github-actions Bot added the test label Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview 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: 34bfeaa5-7789-4874-a448-5ad7f7c1429b

📥 Commits

Reviewing files that changed from the base of the PR and between 77fd077 and 7e75458.

📒 Files selected for processing (3)
  • aic-core/rust/aiconfigurator-core/parity_tests/goldens/per_op.json
  • aic-core/rust/aiconfigurator-core/parity_tests/test_compile_engine_parity.py
  • tests/unit/sdk/database/test_power_data_invariants.py

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

📜 Recent review details
⏰ Context from checks skipped due to timeout. (13)
  • GitHub Check: Collect snapshot (new)
  • GitHub Check: Collect snapshot (old)
  • GitHub Check: Build and Test (e2e)
  • GitHub Check: Python 3.11 compatibility
  • GitHub Check: Rust/Python engine-step parity
  • GitHub Check: Build and Test (unit)
  • GitHub Check: Build wheels (manylinux_2_28_aarch64)
  • GitHub Check: aic-core public API contract
  • GitHub Check: Build wheels (macosx_arm64)
  • GitHub Check: Python 3.12 compatibility
  • GitHub Check: Python 3.13 compatibility
  • GitHub Check: Build wheels (manylinux_2_28_x86_64)
  • GitHub Check: Cargo Deny
🧰 Additional context used
📓 Path-based instructions (2)
Check that tests cover the changed behavior rather than only the happy path.

⚙️ CodeRabbit configuration file

Files:

  • tests/unit/sdk/database/test_power_data_invariants.py
Prefer applicable inline comments.

⚙️ CodeRabbit configuration file

Files:

  • aic-core/rust/aiconfigurator-core/parity_tests/test_compile_engine_parity.py
  • tests/unit/sdk/database/test_power_data_invariants.py
  • aic-core/rust/aiconfigurator-core/parity_tests/goldens/per_op.json
🪛 OpenGrep (1.27.1)
aic-core/rust/aiconfigurator-core/parity_tests/goldens/per_op.json

[ERROR] 918-918: Possible credit card number (PAN) detected in source code. Credit card numbers should never be hardcoded or stored in source files. Use a secrets manager or tokenization service instead.

(coderabbit.pii.credit-card-number)

🔇 Additional comments (3)
aic-core/rust/aiconfigurator-core/parity_tests/goldens/per_op.json (1)

16-16: LGTM!

Also applies to: 26-26, 31-31, 51-51, 56-56, 61-61, 78-78, 88-88, 93-93, 98-98, 118-118, 123-123, 128-128, 898-898, 903-903, 908-908, 918-918, 923-923, 928-928, 938-938, 943-943, 965-965, 970-970, 975-975, 985-985, 990-990, 995-995, 1005-1005, 1010-1010, 1165-1165, 1193-1193

aic-core/rust/aiconfigurator-core/parity_tests/test_compile_engine_parity.py (1)

83-86: LGTM!

Also applies to: 107-112

tests/unit/sdk/database/test_power_data_invariants.py (1)

11-15: LGTM!

Also applies to: 20-21, 58-62, 74-82


Walkthrough

The change updates GPT-OSS and Nemotron-NAS per-operation energy goldens, enables energy checks for two TRT-LLM cases, and strengthens power-data invariant tests for paired measurements.

Changes

Energy validation updates

Layer / File(s) Summary
Golden energy measurements and pins
aic-core/rust/aiconfigurator-core/parity_tests/goldens/per_op.json
Adds measured energy values for GPT-OSS and Nemotron-NAS operations and updates both Rust commit pins.
TRT-LLM energy coverage
aic-core/rust/aiconfigurator-core/parity_tests/test_compile_engine_parity.py
Updates the TRT-LLM slot documentation and enables power-backed checks for GPT-OSS-20B and Nemotron-Super-49B.
Power measurement pair validation
tests/unit/sdk/database/test_power_data_invariants.py
Requires paired finite positive measurements or paired zero values and tests missing, mismatched, negative, NaN, and infinite values.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 7e754

The updated invariant and energy parity coverage introduce no demonstrated runtime or data risk, so the PR is ready to merge after normal checks.

🚥 Pre-merge checks | ✅ 4
✅ 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 main change: restoring the B200 power CI contract.
Description check ✅ Passed The description is detailed and covers the change, rationale, validation, scope, and related work. It does not use the template headings exactly, and it omits an explicit reviewer-start section and ac…

Energy numbers wake in rows
GPT and Nemotron glow
Parity checks trace the light
Power pairs stay clean and right
Golden pins align the flow

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

@jasonqinzhou
jasonqinzhou marked this pull request as ready for review September 8, 2026 22:35
@jasonqinzhou
jasonqinzhou requested review from a team as code owners September 8, 2026 22:35

@Arsene12358 Arsene12358 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for one P2 regression in the power-data invariant: nullable numeric Parquet columns can cause null measurement pairs to pass the check. This violates AIC-1940's explicit fail-closed requirement; the inline comment includes a base/head reproduction and the minimal correction.

Validation: 342 local invariant/compile-engine/engine-step tests passed, Ruff checks passed, and both refreshed per-op golden records exactly matched the repository pinning tool's live computation. Current committed power data is valid; this finding concerns the invariant's handling of invalid input.

finite = np.isfinite(power) & np.isfinite(power_limit)
measured = (power > 0.0) & (power_limit > 0.0)
unmeasured = (power == 0.0) & (power_limit == 0.0)
return ~(finite & (measured | unmeasured))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Reject nullable missing values in the invalid-pair mask

When a Parquet file preserves pandas nullable Float64 columns, np.isfinite and the comparisons above propagate pd.NA. This return expression then produces missing booleans, which bad.any() at line 66 skips. Consequently, the invariant accepts null measurement pairs instead of rejecting them.

I reproduced this through the complete invariant function, pointing _DATA_ROOT at a temporary directory containing a real nullable_perf.parquet written from:

frame = pd.DataFrame(
    {
        "power": [None, 100.0, 100.0],
        "power_limit": [1000.0, None, 1000.0],
    },
    dtype="Float64",
)
frame.to_parquet(tmp_path / "nullable_perf.parquet", engine="pyarrow")

After the test's normal pq.read_table(...).to_pandas() call, the mask is [pd.NA, pd.NA, False] and bad.any() is False. Base 77fd077 rejects the two invalid rows; head 7e754583 passes the same file. With ordinary float64, both revisions reject it, which explains why the added synthetic examples miss the regression.

Please treat missing mask entries as invalid and add a nullable-Parquet round-trip regression test. This minimal correction makes the complete invariant reject both invalid rows while preserving the existing synthetic test results:

Suggested change
return ~(finite & (measured | unmeasured))
return (~(finite & (measured | unmeasured))).fillna(True)

This is an introduced regression in the guard required by AIC-1940, not a claim that current shipped data contains null pairs.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants