Skip to content

[release-1.15] Support vnpus.configs wrapper format for HAMi vNPU device config - #5769

Merged
volcano-sh-bot merged 4 commits into
volcano-sh:release-1.15from
volcano-sh-bot:cherry-pick-5399-to-release-1.15
Jul 29, 2026
Merged

[release-1.15] Support vnpus.configs wrapper format for HAMi vNPU device config#5769
volcano-sh-bot merged 4 commits into
volcano-sh:release-1.15from
volcano-sh-bot:cherry-pick-5399-to-release-1.15

Conversation

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

This is an automated cherry-pick of #5399

Support both the new HAMi vnpus.configs wrapper format and the legacy vnpus direct array format in device config parsing for Ascend vNPU.

Add backward-compatible support for the new HAMi vnpus.configs wrapper
struct format while preserving the legacy vnpus direct array format.

The HAMi/ascend-device-plugin shared ConfigMap now uses:
  vnpus:
    hamiVnpuCore: false
    configs:
      - chipName: 910A
        ...

But Volcano previously only parsed the old format:
  vnpus:
    - chipName: 910A
      ...

This adds a VNPUsConfig wrapper struct with a custom UnmarshalYAML
that probes the YAML node type (map vs array) to auto-detect the
format: maps are parsed as the new wrapper format, arrays as legacy.

Changes:
- Add VNPUsConfig struct with custom UnmarshalYAML in vnpu.go
- Change Config.VNPUs field type from []VNPUConfig to VNPUsConfig
- Update all consumer call sites to use .VNPUs.Configs
- Add tests for new wrapper, legacy array, and empty configs formats

Signed-off-by: Shivansh Sahu <sahushivansh142@gmail.com>
Signed-off-by: Shivansh Sahu <sahushivansh142@gmail.com>
Signed-off-by: Shivansh Sahu <sahushivansh142@gmail.com>
Signed-off-by: Shivansh Sahu <sahushivansh142@gmail.com>
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@volcano-sh-bot volcano-sh-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 29, 2026
@JesseStutler

Copy link
Copy Markdown
Member

/approve
/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2026
@volcano-sh-bot

Copy link
Copy Markdown
Contributor Author

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JesseStutler

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 29, 2026
@volcano-sh-bot
volcano-sh-bot merged commit b00fd64 into volcano-sh:release-1.15 Jul 29, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants