← Back to Pull requests

feat(hygon): add resourcePrefix for DCU/HCU upgrade compat… #3375

Closed
unknown closed this pull request without merging on Nov 16, 2026 03:54 UTC
View on GitHub
unknown unknown commented on Nov 06, 2026 01:15 UTC
Author

What type of PR is this?

/kind feature

What this PR does / why we need it:

Hygon renamed DCU to HCU. Newer HAMi and device-plugin builds advertise hygon.com/hcunum (and related keys), while older clusters still report hygon.com/dcunum. Upgrading the scheduler without aligning those names leaves pods unschedulable.

This PR adds a single resourcePrefix (Helm: devices.hygon.resourcePrefix, default hcu) that must match the Hygon device plugin. Only one prefix is accepted: lowercase alphanumeric and must contain cu (practically hcu or dcu). No dual-stack / *cu wildcard.

From that prefix the scheduler derives:

  • resource names: hygon.com/<prefix>num|mem|cores

  • type annotations: hygon.com/use-<prefix>type, hygon.com/nouse-<prefix>type

  • node / allocation annotations: hami.io/node-handshake-<prefix>, hami.io/node-<prefix>-register, hami.io/<prefix>-devices-to-allocate, hami.io/<prefix>-devices-allocated
  • UUID annotations (hygon.com/use-gpuuuid / nouse-gpuuuid) and the node lock stay unchanged. The chart derives the three resource names from the prefix for the device ConfigMap and extender managed-resources list. An explicit custom resource name still wins. The historical defaults hygon.com/hcunum, hygon.com/hcumem, and hygon.com/hcucores are treated as unset when resourcePrefix is not hcu, so a Helm upgrade that still carries those defaults follows the new prefix.

    The scheduler device id stays HCU. Changing it to DCU would drop pods already recorded under HCU. Card models are matched against resourcePrefix instead: DCU-K100_AI matches dcu, and HCU-K100_AI matches hcu.

    Which issue(s) this PR fixes:
    Fixes #

    Special notes for your reviewer:

  • Upgrade path for old DCU clusters: set devices.hygon.resourcePrefix: dcu on HAMi and keep the same prefix on the Hygon device plugin.

  • New / HCU clusters can keep the default hcu.

  • Removed top-level dcuResourceName / hcuResourceName rejection messages are unchanged.

  • --hcu-name, --hcu-memory, and --hcu-cores stay registered so existing command lines still parse. They are not a source of resource names.

  • Helm unittest covers prefix-derived names, historical hcu defaults, and explicit custom names. Hygon package tests cover Apply() and model matching.
  • Does this PR introduce a user-facing change?:
    ``release-note
    Add devices.hygon.resourcePrefix (default hcu) to select the Hygon resource/annotation prefix for DCU↔HCU upgrades. Set dcu when the device plugin still reports DCU resources. The scheduler device id stays HCU.
    ``

    Diff: 329 lines (+246 / -83) across 4 files Reviewer: spencercjh Review duration: 14558m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 329 lines diff across 4 files
    0.42
    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.347
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3375"
    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: 42.1% (MEDIUM) · Higher = larger blast radius
    42.1%
    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: 18.2% · Safe to merge
    18.2%