Skip to content

docs: add AMD Instinct vGPU design draft (#1707) - #1985

Merged
hami-robot[bot] merged 4 commits into
Project-HAMi:masterfrom
midokura:docs/amd-vgpu-design
Jul 1, 2026
Merged

docs: add AMD Instinct vGPU design draft (#1707)#1985
hami-robot[bot] merged 4 commits into
Project-HAMi:masterfrom
midokura:docs/amd-vgpu-design

Conversation

@kenji-mido

@kenji-mido kenji-mido commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind documentation

What this PR does / why we need it:

Adds a design document (docs/develop/amd-vgpu.md) for AMD Instinct GPU isolation
(per-pod memory limiting + CU partitioning) on ROCm. It covers the scheduler<->device-plugin protocol
(node/pod annotations), the CU-count -> ROC_GLOBAL_CU_MASK model, and open discussion points.

Submitted as a design draft per the discussion in #1707
(#1707 (comment)).

Which issue(s) this PR fixes:

Relates to #1707

Special notes for your reviewer:

AI assistance disclosure: I used Claude Code to (double) fact-check claims against the HAMi source
(annotation keys, DeviceInfo fields, per-vendor conventions) and to draft wording.
The final text was authored, edited, and reviewed by me, and all technical claims were verified against the codebase.

Does this PR introduce a user-facing change?:

NONE

Summary by CodeRabbit

  • Documentation
    • Added a new design document for AMD Instinct vGPU support on Kubernetes pods.
    • Documented fractional GPU sharing via per-pod GPU memory and compute-unit (CU) limits.
    • Explained how allocation details are conveyed between scheduling components and containers.
    • Included current limitations and guidance for required CU mask handling and enforcement.

@hami-robot hami-robot Bot added kind/documentation Improvements or additions to documentation dco-signoff: yes labels Jun 29, 2026
@hami-robot
hami-robot Bot requested review from DSFans2014 and archlitchi June 29, 2026 07:27
@hami-robot hami-robot Bot added the size/L label Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new design document for AMD Instinct vGPU support in Kubernetes, covering fractional GPU memory allocation, CU partitioning, scheduler-device-plugin annotations, resource mapping, limitations, and plugin layering discussion.

Changes

AMD vGPU Design Documentation

Layer / File(s) Summary
Protocol, resource mapping, and constraints
docs/develop/amd-vgpu.md
Describes per-pod GPU memory and CU semantics, node and pod annotations, CU mask handling, memory environment injection, non-overlap enforcement, limitations, and plugin layering discussion.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Poem

🐇 I hop through docs with CU bits in tow,
Memory caps and masks in tidy flow.
Annotations dance, the limits align,
One vGPU tale, concise and fine.
Hop hop — AMD dreams glow ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change: it adds an AMD Instinct vGPU design draft document.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a design proposal document for AMD Instinct vGPU support in HAMi, detailing the motivation, goals, architecture approach, and resource allocation protocol. The review feedback focuses on minor grammatical, punctuation, and formatting improvements to enhance the readability and correctness of the documentation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/develop/amd-vgpu.md Outdated
Comment thread docs/develop/amd-vgpu.md Outdated
Comment thread docs/develop/amd-vgpu.md Outdated
Comment thread docs/develop/amd-vgpu.md Outdated
Comment thread docs/develop/amd-vgpu.md Outdated
Comment thread docs/develop/amd-vgpu.md Outdated
Comment thread docs/develop/amd-vgpu.md Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/develop/amd-vgpu.md`:
- Around line 58-60: Add a language tag to the remaining fenced example blocks
in the AMD vGPU docs so they render cleanly and avoid MD040; update the fenced
snippets around the hami.io/amd-devices-allocated examples to use text fences
consistently, matching the other documentation examples in this file.
- Around line 16-20: The AMD GPU docs section on LD_AUDIT vs LD_PRELOAD needs a
source and tighter scope. Update the explanation in the documented ROCm/HIP area
to cite the upstream issue or release note that describes the LD_PRELOAD
symbol-resolution failure, and explicitly state that this workaround applies
only to the affected ROCm 7.x/HIP releases or the recursive interception failure
mode. Keep the existing NVIDIA LD_PRELOAD note unchanged while making the
ROCm-specific limitation clear in the same paragraph.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a7386b3a-3956-4869-a19b-03764911ff80

📥 Commits

Reviewing files that changed from the base of the PR and between 03eed2e and e2b4412.

📒 Files selected for processing (1)
  • docs/develop/amd-vgpu.md

Comment thread docs/develop/amd-vgpu.md Outdated
Comment thread docs/develop/amd-vgpu.md Outdated
Design document for AMD Instinct GPU isolation (per-pod memory limiting +
CU partitioning) on ROCm. Covers the scheduler<->device-plugin protocol
(node/pod annotations), the CU-count -> ROC_GLOBAL_CU_MASK model, and open
discussion points. Submitted as a design draft per discussion in Project-HAMi#1707.

Signed-off-by: Kenji SHIMIZU <kenji.shimizu@midokura.com>
…e tags)

Signed-off-by: Kenji SHIMIZU <kenji.shimizu@midokura.com>
Comment thread docs/develop/amd-vgpu.md Outdated
@archlitchi

Copy link
Copy Markdown
Member

thanks @kenji-mido, i've assigned the development of device-plugin to @FouoF, he will finish his part in July, and find a digital-ocean environment to validate, after that, we will release that part on Aug, before the release of v2.10

Comment thread docs/develop/amd-vgpu.md Outdated
Address review feedback on hami.io/amd-cu-mask delimiters (Project-HAMi#1985):
switch the CU-mask annotation from a delimited <UUID>=<mask>:; string to
a JSON array under the amd.com/ namespace, matching the per-device
allocation-data convention used by other vendors (e.g. Ascend's huawei.com/<model>).
Avoids the :/; collision with ROC_GLOBAL_CU_MASK's own grammar.

Signed-off-by: Kenji SHIMIZU <kenji.shimizu@midokura.com>
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 59.05% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Address review feedback (Project-HAMi#1985): AMDDevices.LockNode / ReleaseNodeLock
currently return nil, so CU-bitmap exclusivity is not enforced yet.
Change the wording from present tense to "will be enforced" and add a
TODO note in both the protocol and resource-model sections.

Signed-off-by: Kenji SHIMIZU <kenji.shimizu@midokura.com>
@archlitchi

Copy link
Copy Markdown
Member

CC @mesutoezdil

@wawa0210

wawa0210 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


CC @mesutoezdil

@mesutoezdil

Copy link
Copy Markdown
Contributor

/lgtm

@Shouren Shouren left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@hami-robot

hami-robot Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kenji-mido, Shouren

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

@hami-robot hami-robot Bot added the approved label Jul 1, 2026
@hami-robot
hami-robot Bot merged commit 3b466ff into Project-HAMi:master Jul 1, 2026
14 checks passed
@kenji-mido
kenji-mido deleted the docs/amd-vgpu-design branch July 2, 2026 07:33
kenji-mido added a commit to midokura/HAMi that referenced this pull request Jul 3, 2026
The CU-mask annotation key is amd.com/cu-mask (per merged design doc Project-HAMi#1985),
not hami.io/amd-cu-mask. Fix three stale references in comments/test message,
and note reconstruction now happens in Fit (not AddResourceUsage).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kenji-mido added a commit to midokura/HAMi that referenced this pull request Jul 3, 2026
The CU-mask annotation key is amd.com/cu-mask (per merged design doc Project-HAMi#1985),
not hami.io/amd-cu-mask. Fix stale references in comments/test message, and
note reconstruction happens in Fit (not AddResourceUsage).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kenji-mido

Copy link
Copy Markdown
Contributor Author

thanks @kenji-mido, i've assigned the development of device-plugin to @FouoF, he will finish his part in July, and find a digital-ocean environment to validate, after that, we will release that part on Aug, before the release of v2.10

@archlitchi @FouoF

Could you share the current status of the AMD device-plugin?
I'd like to align the scheduler side (pkg/device/amd) with the revised design in #2067, and I'd also like to think about where I could be of help. Thanks!

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.

5 participants