← Back to Pull requests

feat: advertise hami-core Devcore via deviceCoreScaling #132

Closed
unknown closed this pull request without merging on Sep 18, 2026 08:39 UTC
View on GitHub
unknown unknown commented on Aug 31, 2026 03:41 UTC
Author

Scheduler counterpart: https://github.com/Project-HAMi/HAMi/pull/2952
That HAMi PR keeps a 100-point hami-core Fit budget unless this plugin advertises Devcore > 100.

What this PR does / why we need it:

NVIDIA already applies deviceCoreScaling when the plugin registers Devcore. This plugin hardcoded Devcore = 100 in hami-core (HamiVnpuCoreMaxPercent), so compute oversell could not be advertised no matter what the scheduler did.

  • vnpus.deviceCoreScaling (default 1), optional per-node override in NodeConfig

  • chart value hamiVnpuCore.deviceCoreScaling, schema minimum: 1

  • hami-core registers Devcore = round(100 deviceCoreScaling)

  • template / hard-slice still reports hardware AICore

  • default 1 keeps today's 100-point budget
  • The scheduler keeps a 100-point Fit budget unless advertised Devcore > 100, so this plugin change is what actually enables oversell. Physical AICore counts (8/20/24/30) are not treated as that percentage.

    The first commit left deviceCoreScaling: 1 as a literal inside deviceConfig (# @ignored), so --set / a values file could not reach it. c98d025 renders {{ .Values.hamiVnpuCore.deviceCoreScaling }} next to hamiVnpuCore.enabled. Fractional ratios need --set-json (--set 1.5 becomes a string and the schema rejects the type). That is in the chart README.

    $ helm template adp ./charts/ascend-device-plugin --set hamiVnpuCore.enabled=true \
        --set-json hamiVnpuCore.deviceCoreScaling=1.5 | grep deviceCoreScaling
          deviceCoreScaling: 1.5
    
    $ helm template adp ./charts/ascend-device-plugin --set-json hamiVnpuCore.deviceCoreScaling=0.5
    Error: values don't meet the specifications of the schema(s) in the following chart(s):
    ascend-device-plugin:
    - at '/hamiVnpuCore/deviceCoreScaling': minimum: got 0.5, want 1
    

    Ratios below 1 are rejected. AdvertisedDevcore(true, 0.5, 20) used to return 50, but HAMi cannot tell that apart from a hardware AICore count (8/20/24/30) and clamps anything <= 100 back to the base, so the cut disappeared with no log. The plugin now falls back to the percentage base and warns; NaN / Inf / out-of-int32 warn too. Rounding: 1.234 -> 123. Per-node override is shown in ascend-device-node-configmap.yaml and the chart README.

    f53444f only corrects the HamiVnpuCoreMaxPercent comment. registerHAMi now calls internal.AdvertisedDevcore, so 100 is the base percentage, not the advertised total once scaling is above 1. No behavior change.

    Special notes for your reviewer:

    AI assistance: I used Cursor to draft the patch. I reviewed the registration path. Commit messages were written by me.

    Validation: go test ./internal/... passes, helm lint is clean, README.md / values.schema.json regenerated with make update-chart-docs so make verify-helm-chart stays green.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    New Features
    Added configurable VNPU device core scaling with global and per-node overrides.
    Supports fractional scaling ratios for compute overselling.
    Advertised compute capacity now reflects scaling while memory and virtual-device limits remain unchanged.
    Invalid, unsupported, or below-minimum values fall back safely to the default behavior.

    Documentation
    Added Helm configuration guidance, validation details, examples, and compute overselling limitations.

    Tests
    Added coverage for defaults, overrides, rounding, and invalid values.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 448 lines (+336 / -112) across 5 files Reviewer: DSFans2014 Review duration: 26217m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.45) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.45 · 448 lines diff across 5 files
    0.45
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.365
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #132"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.4% (MEDIUM) · Higher = larger blast radius
    45.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.6% · Safe to merge
    19.6%