← Back to Pull requests

feat: share virtual device count between hami-core and ENPU modes #144

Merged
spencercjh merged 12 files (157 lines) on Oct 17, 2026 02:25 UTC
View on GitHub
spencercjh spencercjh commented on Oct 09, 2026 15:15 UTC
Author

What type of PR is this?

/kind bug

What this PR does / why we need it:

Use vnpus.deviceSplitCount for both hami-core and enpu, defaulting to 10, instead of deriving hami-core capacity from hard-slicing templates.

  • A positive node vDeviceCount takes priority; ENPU caps the effective count at 100.

  • Template mode keeps its template-based capacity calculation.

  • The standalone Chart exposes deviceSplitCount.
  • Which issue(s) this PR fixes:

    Fixes #128. Related: Project-HAMi/HAMi#2727.

    Special notes for your reviewer:

    Go tests and Helm checks passed. I plan to update the HAMi Chart in a follow-up PR after this PR is merged, including scheduler support for the renamed shared field. Codex assisted with implementation and validation.

    Earlier Ascend-310P validation, before the shared-setting rename:

    <img width="1799" height="398" alt="image" src="https://github.com/user-attachments/assets/0da8c297-9905-40e3-a903-ef52506d1d9b" />

    With a separate ConfigMap:

    <img width="1781" height="579" alt="image" src="https://github.com/user-attachments/assets/a4e8f0c9-a0d2-4521-81c5-e9df9f4ca302" />

    Does this PR introduce a user-facing change?:

    Yes. Both soft-slicing modes default to 10 slots per NPU. ENPU previously defaulted to 100. Configuration now uses deviceSplitCount instead of vnpuDeviceSplitCount.

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

    Summary by CodeRabbit

    New Features
    HAMi vNPU-core and ENPU modes now support configurable virtual-device slots per physical NPU, defaulting to 10 when no positive split count is set.
    A positive node-level virtual-device count takes precedence. ENPU counts are capped at 100; template mode continues to use template-derived capacity.
    The Ascend device plugin chart exposes the split-count setting, with a minimum supported value of 1.
    Documentation
    Updated deployment guides with configuration options, capacity behavior, and rollout requirements.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 157 lines (+144 / -13) across 12 files Reviewer: archlitchi Review duration: 10750m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.49) × (1 − Review Confidence (0.88)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.49 · 157 lines diff across 12 files
    0.49
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.92 · 5 substantive comment(s)
    0.92
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    87%
    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.303
    Real PR Conversation Timeline
    17 items
    hami-robot[bot] hami-robot[bot] commented on Oct 09, 2026 15:15 UTC
    Bot

    @spencercjh: The label(s) kind/bug cannot be applied, because the repository doesn't have them.

    <details>

    In response to this:

    >What type of PR is this?

    >/kind bug

    >What this PR does / why we need it:

    >hami-core mode currently derives slot capacity from hard-slicing templates, limiting the reported 910B4-1 configuration to four slots per NPU even when memory and cores remain available.

    >- Use vnpus.vnpuDeviceSplitCount for hami-core slot capacity, defaulting to 10.

    >- A positive node vDeviceCount takes precedence.
    >- Template and ENPU capacity rules are unchanged.
    >- Update the standalone Chart and documentation.
    >Which issue(s) this PR fixes:

    >Fixes #128.

    >Related: Project-HAMi/HAMi#2727.

    >Special notes for your reviewer:

    >- I have tested it on an Ascend-310p cluster.

    >- Codex assisted with code, tests, documentation, and validation.
    >Does this PR introduce a user-facing change?:

    >Yes.

    >Without a positive node override, hami-core mode advertises 10 slots per NPU by default, configurable through vnpuDeviceSplitCount.

    Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

    </details>

    coderabbitai[bot] coderabbitai[bot] commented on Oct 09, 2026 15:15 UTC
    Bot

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- review_stack_entry_start -->

    <a href="https://app.coderabbit.ai/change-stack/Project-HAMi/ascend-device-plugin/pull/144?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a>

    <!-- review_stack_entry_end -->
    <!-- This is an auto-generated comment: rate limited by coderabbit.ai -->

    [!WARNING]

    ## Review limit reached

    > You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

    > Next included review available in 17 minutes.

    > Check out review usage here.

    > <details>

    <summary><strong>View limit details</strong></summary>

    <dl>

    <dd>

    > Limit details: You’ve used the included review currently available.

    > Learn how review limits work.

    > Review configuration:

    > <details>

    <summary><strong>⚙️ Run configuration</strong></summary>

    <dl>

    <dd>

    > - Configuration used: Organization UI

    - Review profile: CHILL

    - Plan: Advanced

    - Run ID: 10414856-d9fe-4269-8cd5-897c72a807e9

    > </dd>

    </dl>

    </details>

    > <details>

    <summary><strong>📥 Commits</strong></summary>

    <dl>

    <dd>

    > Reviewing files that changed from the base of the PR and between cd2f6f5a33b3111734aef27383400e9a39e1a7e5 and cc3da71d9836c91a6def08828806c549815b2f4e.

    > </dd>

    </dl>

    </details>

    > <details>

    <summary><strong>📒 Files selected for processing: 2</strong></summary>

    <dl>

    <dd>

    > charts/ascend-device-plugin/Chart.yaml

    charts/ascend-device-plugin/README.md

    > </dd>

    </dl>

    </details>

    > </dd>

    </dl>

    </details>

    <!-- end of auto-generated comment: rate limited by coderabbit.ai -->

    <!-- recent_review_start -->

    No actionable comments were generated in the recent review. 🎉

    <details>
    <summary><strong>ℹ️ Recent review info</strong></summary>
    <dl>
    <dd>

    <details>
    <summary><strong>⚙️ Run configuration</strong></summary>
    <dl>
    <dd>

  • Configuration used: Organization UI

  • Review profile: CHILL

  • Plan: Advanced

  • Run ID: 3f3c1759-6642-42da-abd8-beeec9280a75
  • </dd>
    </dl>
    </details>

    <details>
    <summary><strong>📥 Commits</strong></summary>
    <dl>
    <dd>

    Reviewing files that changed from the base of the PR and between ab0c8ff704566df4756b9c2248fbd00feffa7e50 and cd2f6f5a33b3111734aef27383400e9a39e1a7e5.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>📒 Files selected for processing: 10</strong></summary>
    <dl>
    <dd>

    ascend-device-configmap.yaml
    charts/ascend-device-plugin/README.md
    charts/ascend-device-plugin/values.schema.json
    charts/ascend-device-plugin/values.yaml
    docs/hami.md
    docs/hami_cn.md
    internal/manager/manager.go
    internal/manager/manager_test.go
    internal/vnpu.go
    internal/vnpu_test.go

    </dd>
    </dl>
    </details>

    Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

    </dd>
    </dl>
    </details>

    <!-- recent_review_end -->
    <!-- walkthrough_start -->

    <details>
    <summary><strong>📝 Walkthrough</strong></summary>
    <dl>
    <dd>

    The change adds a configurable virtual-device split count for hami-core and ENPU modes. A positive node-level vDeviceCount takes precedence. Otherwise, the global count defaults to 10, and ENPU counts are capped at 100. Template mode retains its template-derived capacity.

    Changes: Virtual-device split count

    |Layer / File(s)|Summary|
    |:---|:---|
    |Split-count configuration and documentation <br> internal/vnpu.go, internal/vnpu_test.go, charts/ascend-device-plugin/values.yaml, charts/ascend-device-plugin/values.schema.json, ascend-device-configmap.yaml, charts/ascend-device-plugin/README.md, docs/hami.md, docs/hami_cn.md|Adds deviceSplitCount to the configuration and chart, with a chart default of 10 and a minimum value of 1. The generated configuration includes the chart value. Documentation describes count defaults, node-level precedence, ENPU’s cap, template-mode behavior, and restart and image requirements.|
    |Mode selection and device registration <br> internal/manager/manager.go, internal/manager/manager_test.go, internal/server/watch_and_register_test.go|VDeviceCount uses a positive node-level count first. Otherwise, hami-core and ENPU use the global split count, defaulting to 10; ENPU counts above 100 are capped. Template mode continues to use template-derived capacity. Tests cover mode selection, overrides, kubelet device counts and IDs, and HAMi registration counts.|

    <!-- change_assessment_start -->
    Priority: ➖ Normal

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

    <!-- change_assessment_commit:"cd2f6f5a33b3111734aef27383400e9a39e1a7e5" -->
    Change: Feature · Severity of issue fixed: Medium
    <!-- change_assessment_end -->

    Sequence Diagram(s)

    sequenceDiagram
      participant ConfigMap
      participant LoadConfig
      participant VDeviceCount
      participant apiDevices
      participant Kubelet
      participant registerHAMi
      participant HAMi
      ConfigMap->>LoadConfig: Provide deviceSplitCount
      LoadConfig->>VDeviceCount: Supply VNPUsConfig
      VDeviceCount->>apiDevices: Provide selected virtual-device count
      apiDevices->>Kubelet: Advertise healthy virtual-device IDs
      VDeviceCount->>registerHAMi: Provide per-device count
      registerHAMi->>HAMi: Register physical devices and counts
    

    Suggested labels: enhancement

    </dd>
    </dl>
    </details>

    <!-- walkthrough_end -->
    <details>
    <summary><strong>Merge Risk:</strong> <strong>⚪ Minimal</strong> · up to <code>cd2f6</code></summary>
    <dl>
    <dd>

    <!-- final_review_risk_start -->
    <!-- final_review_risk_label
    Merge Risk: ⚪ Minimal · up to cd2f6
    -->
    <!-- final_review_risk_coverage:{"sourceCommitId":"cd2f6f5a33b3111734aef27383400e9a39e1a7e5","coveredCommitId":"cd2f6f5a33b3111734aef27383400e9a39e1a7e5","kind":"reviewed"} -->

    The split-count setting appears consistent across configuration and device registration. No actionable merge-blocking issue remains after normal checks.
    <!-- final_review_risk_end -->

    </dd>
    </dl>
    </details>
    <!-- pre_merge_checks_walkthrough_start -->

    <details>
    <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 3 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> 2</strong></summary>
    <dl>
    <dd>

    <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 2 warnings</strong>

    | Check name | Status | Explanation | Resolution |
    | :------------------------ | :----------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Out of Scope Changes check | !Warning | The PR states that ENPU capacity rules remain unchanged. The supplied change summary instead states that ENPU now uses the global DeviceSplitCount and that its previous default of 100 changed to 10.… | Keep the configurable split-count change limited to hami-core. Preserve the previous ENPU default and capacity behavior, including its default of 100 and its existing cap, unless a separate ENPU requirement is added. |
    | Docstring Coverage | !Warning | Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 5 files. (6 skipped: 6… | Write docstrings for the functions missing them to satisfy the coverage threshold. |

    <details>
    <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 3 passed</strong></summary>
    <dl>
    <dd>

    | Check name | Status | Explanation |
    | :----------------- | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Linked Issues check | !Passed | Issue #128 concerns the four-slot limit in Ascend hami-core mode. The supplied change summary shows that a positive node VDeviceCount now takes precedence, and hami-core otherwise uses DeviceSplitC… |
    | Description Check | !Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
    | Title check | !Passed | The title clearly summarizes the main change: configuring and sharing virtual-device slot counts across hami-core and ENPU modes. |

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Full details: Out of Scope Changes check</strong></summary>
    <dl>
    <dd>

    Explanation

    The PR states that ENPU capacity rules remain unchanged. The supplied change summary instead states that ENPU now uses the global DeviceSplitCount and that its previous default of 100 changed to 10. This is unrelated to issue #128 and changes ENPU behavior.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong>Full details: Docstring Coverage</strong></summary>
    <dl>
    <dd>

    Explanation

    Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 5 files. (6 skipped: 6 unsupported.)

    </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- pre_merge_checks_walkthrough_end -->
    <!-- finishing_touch_checkbox_start -->

    <details>
    <summary><strong>✨ Finishing Touches</strong></summary>
    <dl>
    <dd>

    <details open>
    <summary><strong>🧪 Generate unit tests (beta)</strong></summary>
    <dl>
    <dd>

  • <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create a new PR
  • </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- finishing_touch_checkbox_end -->

    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- tips_start -->

    Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

    <details>
    <summary><strong>❤️ Share</strong></summary>
    <dl>
    <dd>

  • X

  • Mastodon

  • Reddit

  • LinkedIn
  • </dd>
    </dl>
    </details>

    <!-- poem_footer_start -->
    <sub>A rabbit counts the slots in rows, <br>Ten virtual doors for each NPU shows. <br>A node may set a different score, <br>ENPU stops at one hundred, no more. <br>Template mode keeps its own design, <br>And registered counts mark the line. <br>Hop, config travels down the chain!</sub>
    <!-- poem_footer_end -->

    <sub>Comment @coderabbitai help` to get the list of available commands.</sub>

    <!-- tips_end -->

    spencercjh spencercjh commented on Oct 10, 2026 05:31 UTC
    Author

    /assign @DSFans2014

    spencercjh spencercjh commented on Oct 10, 2026 05:31 UTC
    Author

    /assign @archlitchi

    spencercjh spencercjh commented on Oct 10, 2026 08:45 UTC
    Author

    /assign @Shouren

    DSFans2014 DSFans2014 commented on code on Oct 12, 2026 03:25 UTC
    Code Review
    internal/manager/manager.go:1
    @@ -163,7 +163,13 @@ func (am *AscendManager) VDeviceCount() int {
     		}
     		return am.nodeConfig.VDeviceCount
     	}
    -	if am.IsEnpu() && !am.IsHamiVnpuCore() {
    +	if am.IsHamiVnpuCore() {
    +		if am.globalConfig.VNPUs.VNPUDeviceSplitCount > 0 {
    +			return am.globalConfig.VNPUs.VNPUDeviceSplitCount

    Is this configuration only for hami-vnpu-core? Can it be defined as a global configuration like VDeviceCount in ascend-device-node-configmap , used by both hami-vnpu-core and epu?

    spencercjh spencercjh commented on code on Oct 12, 2026 04:18 UTC
    Code Review
    internal/manager/manager.go:1
    @@ -163,7 +163,13 @@ func (am *AscendManager) VDeviceCount() int {
     		}
     		return am.nodeConfig.VDeviceCount
     	}
    -	if am.IsEnpu() && !am.IsHamiVnpuCore() {
    +	if am.IsHamiVnpuCore() {
    +		if am.globalConfig.VNPUs.VNPUDeviceSplitCount > 0 {
    +			return am.globalConfig.VNPUs.VNPUDeviceSplitCount

    I would prefer to keep the current design and implementation.

    hamiVnpuCore.vnpuDeviceSplitCount makes its scope clear, so users can easily understand what changing this value will affect. A shared setting is technically possible, but it may be harder to understand.

    The current rule is simple: this setting controls the global slot count for hami-core, and vDeviceCount can override it for a specific node.

    If we share this setting between hami-core and ENPU, we would need to explain a few more rules:

  • Without this setting, hami-core defaults to 10 slots, while ENPU defaults to 100.

  • If the value is 20, does it affect both modes, or only the mode selected in the global configuration?

  • If a node selects a different mode, does the global count still apply?

  • hami-core can use a value above 100, while ENPU would need to limit it to 100.
  • We can define these rules, but the same setting would behave differently depending on the mode. In a cluster where different nodes use different modes, it would be harder to understand the effect of changing this global value.

    DSFans2014 DSFans2014 commented on code on Oct 12, 2026 05:02 UTC
    Code Review
    internal/manager/manager.go:1
    @@ -163,7 +163,13 @@ func (am *AscendManager) VDeviceCount() int {
     		}
     		return am.nodeConfig.VDeviceCount
     	}
    -	if am.IsEnpu() && !am.IsHamiVnpuCore() {
    +	if am.IsHamiVnpuCore() {
    +		if am.globalConfig.VNPUs.VNPUDeviceSplitCount > 0 {
    +			return am.globalConfig.VNPUs.VNPUDeviceSplitCount

    .

    If a node selects a different mode, does the global count still apply?

    As far as I know, only one mode can take effect on a node.

    This configuration represents the maximum number of virtual devices that can be split from a single card

  • I think there's no problem with setting the default values to the same. if not, please let me know

  • If we want to set a global value for epu later, we would have to add a separate configuration for it

  • Currently, they all prioritize the node's vDeviceCount, so no matter what, we need to explain limit it to 100
  • spencercjh spencercjh commented on code on Oct 12, 2026 07:01 UTC
    Code Review
    internal/manager/manager.go:1
    @@ -163,7 +163,13 @@ func (am *AscendManager) VDeviceCount() int {
     		}
     		return am.nodeConfig.VDeviceCount
     	}
    -	if am.IsEnpu() && !am.IsHamiVnpuCore() {
    +	if am.IsHamiVnpuCore() {
    +		if am.globalConfig.VNPUs.VNPUDeviceSplitCount > 0 {
    +			return am.globalConfig.VNPUs.VNPUDeviceSplitCount

    You are right that only one mode takes effect on a node. You are also right that we already need to explain the 100-slot limit in enpu mode for the node-level vDeviceCount. My earlier point was about different nodes using different modes in the same cluster. This alone is not a sufficient reason to reject a shared global setting.

    My main concern is that this part of the Ascend configuration is already unclear, including vDeviceCount. Users need to understand the code to know how a value behaves in each mode. For example, in template mode, a node override changes the advertised device count, but it does not increase the number of slices the hardware can actually provide. The name vDeviceCount does not explain this difference.

    Before we define clear rules for the whole configuration, discussing whether this one parameter should be shared or separate will not solve the main problem.

    The three modes, template, hami-core, and enpu, work differently and have different limits. I would prefer three separate configuration files, one for each mode. I think this would follow the single-responsibility principle and make the scope of each parameter clearer.

    Users should not have to read the code or guess:

  • Does this parameter apply to the selected mode?

  • What happens when it is not set?

  • Does the node setting override the global setting?

  • What happens when the value exceeds the supported limit?
  • I agree that the current design has problems. However, I am not yet convinced that sharing this global parameter between hami-core and enpu would make the configuration easier to understand.

    DSFans2014 DSFans2014 commented on code on Oct 13, 2026 07:11 UTC
    Code Review
    internal/manager/manager.go:1
    @@ -163,7 +163,13 @@ func (am *AscendManager) VDeviceCount() int {
     		}
     		return am.nodeConfig.VDeviceCount
     	}
    -	if am.IsEnpu() && !am.IsHamiVnpuCore() {
    +	if am.IsHamiVnpuCore() {
    +		if am.globalConfig.VNPUs.VNPUDeviceSplitCount > 0 {
    +			return am.globalConfig.VNPUs.VNPUDeviceSplitCount

    If you prefer to use separate configurations, it would be better to add one for enpu as well.

    spencercjh spencercjh commented on code on Oct 13, 2026 07:15 UTC
    Code Review
    internal/manager/manager.go:1
    @@ -163,7 +163,13 @@ func (am *AscendManager) VDeviceCount() int {
     		}
     		return am.nodeConfig.VDeviceCount
     	}
    -	if am.IsEnpu() && !am.IsHamiVnpuCore() {
    +	if am.IsHamiVnpuCore() {
    +		if am.globalConfig.VNPUs.VNPUDeviceSplitCount > 0 {
    +			return am.globalConfig.VNPUs.VNPUDeviceSplitCount

    @FouoF What's your opinion ❤️

    FouoF FouoF commented on code on Oct 13, 2026 08:02 UTC
    Code Review
    internal/manager/manager.go:1
    @@ -163,7 +163,13 @@ func (am *AscendManager) VDeviceCount() int {
     		}
     		return am.nodeConfig.VDeviceCount
     	}
    -	if am.IsEnpu() && !am.IsHamiVnpuCore() {
    +	if am.IsHamiVnpuCore() {
    +		if am.globalConfig.VNPUs.VNPUDeviceSplitCount > 0 {
    +			return am.globalConfig.VNPUs.VNPUDeviceSplitCount

    I prefer one option for both hami-core and enpu mode for:
    1. People familiar with vgpu can easily understand it.
    2. This is consistent with NVIDIA implementation, both hami-core and enpu mode are soft slice.
    3. Though enpu has the limit of 100 slices at most, in practical use process running in one card will never reach it. The scheduling overhead will be unacceptable as the count grow.

    So I suggest one configuration looks like devicesplitcount and default to 10.

    spencercjh spencercjh commented on code on Oct 13, 2026 08:25 UTC
    Code Review
    internal/manager/manager.go:1
    @@ -163,7 +163,13 @@ func (am *AscendManager) VDeviceCount() int {
     		}
     		return am.nodeConfig.VDeviceCount
     	}
    -	if am.IsEnpu() && !am.IsHamiVnpuCore() {
    +	if am.IsHamiVnpuCore() {
    +		if am.globalConfig.VNPUs.VNPUDeviceSplitCount > 0 {
    +			return am.globalConfig.VNPUs.VNPUDeviceSplitCount

    Okay, I'll make the change.

    FouoF FouoF commented on Oct 16, 2026 09:38 UTC
    Contributor

    /lgtm

    archlitchi archlitchi approved these changes on Oct 17, 2026 02:25 UTC
    Approved Reviewer

    /lgtm

    hami-robot[bot] hami-robot[bot] commented on Oct 17, 2026 02:25 UTC
    Bot

    [APPROVALNOTIFIER] This PR is APPROVED

    This pull-request has been approved by: <a href="https://github.com/Project-HAMi/ascend-device-plugin/pull/144#pullrequestreview-5555554196" title="LGTM">archlitchi</a>, <a href="https://github.com/Project-HAMi/ascend-device-plugin/pull/144#" title="Author self-approved">spencercjh</a>

    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:

  • ~~OWNERS~~ [archlitchi]
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":[]} -->

    Reviewers
    Assignees
    spencercjh spencercjh
    Labels
    risk: low confidence: 87.6% 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: 49.4% (MEDIUM) · Higher = larger blast radius
    49.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: 87.6% · Lower = rushed or shallow review
    87.6%
    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: 6.1% · Safe to merge
    6.1%