Skip to content

docs(mthreads): fix device memory unit to 512 MiB and clarify sgpu-memory - #708

Open
veyron-kairo wants to merge 1 commit into
Project-HAMi:masterfrom
veyron-kairo:docs/mthreads-memory-unit
Open

docs(mthreads): fix device memory unit to 512 MiB and clarify sgpu-memory#708
veyron-kairo wants to merge 1 commit into
Project-HAMi:masterfrom
veyron-kairo:docs/mthreads-memory-unit

Conversation

@veyron-kairo

@veyron-kairo veyron-kairo commented Aug 3, 2026

Copy link
Copy Markdown

What this does

Fixes the device-memory unit and wording on the Moore Threads (mthreads) pages.

  • The enable page said each sgpu-memory unit is 512 MB, while the specify device memory page said 512 MiB. The device plugin multiplies the requested value by 512, and the doc's own example (32 → 16Gi) only works out in MiB (32 × 512 MiB = 16384 MiB = 16 GiB). So 512 MiB is correct — this makes both pages consistent.
  • Dropped the "allocate a percentage size of device memory" wording. The value isn't a percentage; it's a plain integer count of 512-MiB units. Reworded to match the style of the other device pages ("Each unit ... represents ...").
  • Clarified the example comment to show the arithmetic (32 units x 512 MiB = 16 GiB).

Scope

Applied to the current (/docs/next) docs and the v2.9.0 released snapshot, in both English and Chinese, following the "fixing the latest stable version" workflow in AGENTS.md (edit docs/ + i18n/zh/.../current/, then sync the changed files into versioned_docs/version-v2.9.0/ and the zh version-v2.9.0/ mirror). Older frozen version snapshots were left untouched.

Checks

npx prettier --check and npx markdownlint pass on the changed files. The change is in-line prose only (no links or structure changed).

AI assistance disclosure

used chat gpt to make the pr description more fluent and enhanced my writing.

Summary by CodeRabbit

  • Documentation
    • Clarified Mthreads GPU-sharing installation parameters and Helm settings.
    • Corrected sgpu-memory units from 512 MB to 512 MiB.
    • Explained that mthreads.com/sgpu-memory is an optional memory allocation resource.
    • Updated examples to show that 32 units provide 16 GiB of device memory.
    • Synchronized these corrections across English and Chinese documentation.

…mory

The enable-mthreads-gpu-sharing page said each `sgpu-memory` unit is "512 MB"
while the specify-device-memory page said "512 MiB". The device plugin
multiplies the requested value by 512 and the example (32 -> 16Gi) only holds in
MiB, so MiB is correct; make both pages consistent.

Also drop the "percentage size of device memory" wording: the value is a plain
integer count of 512-MiB units, not a percentage.

Applied to the current (next) docs and the v2.9.0 released snapshot, in both
English and Chinese, per the versioning workflow in AGENTS.md.

Signed-off-by: Shridhar Panigrahi <198173519+veyron-kairo@users.noreply.github.com>
@hami-robot

hami-robot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: veyron-kairo
Once this PR has been reviewed and has the lgtm label, please assign archlitchi for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 requested a review from rootsongjc August 3, 2026 11:48
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for project-hami ready!

Name Link
🔨 Latest commit 2034446
🔍 Latest deploy log https://app.netlify.com/projects/project-hami/deploys/6a708025d7fa22000811118a
😎 Deploy Preview https://deploy-preview-708--project-hami.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@hami-robot

hami-robot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Welcome @veyron-kairo! It looks like this is your first PR to Project-HAMi/website 🎉

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Mthreads documentation now uses 512 MiB units for sgpu-memory, describes optional unit-based allocation, updates the 32-unit example to 16 GiB, and corrects Helm installation parameter names in versioned guides.

Changes

Mthreads documentation

Layer / File(s) Summary
Device memory allocation semantics
docs/userguide/mthreads-device/specify-device-memory-usage.md, i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/specify-device-memory-usage.md, i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md, versioned_docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md
The guides describe optional unit-based allocation with mthreads.com/sgpu-memory. Each unit represents 512 MiB. The example states that 32 units equal 16 GiB.
GPU sharing installation and units
docs/userguide/mthreads-device/enable-mthreads-gpu-sharing.md, i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md, i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md, versioned_docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
The versioned installation guides use scheduler.kubeScheduler.image.tag and updated enablement syntax. All guides describe sgpu-memory units as 512 MiB.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested labels: kind/documentation

Suggested reviewers: rootsongjc

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the correction to the device memory unit and the clarification of sgpu-memory.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@coderabbitai coderabbitai Bot added the kind/documentation Improvements or additions to documentation label Aug 3, 2026
@hami-robot hami-robot Bot added the size/M label Aug 3, 2026

@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/userguide/mthreads-device/specify-device-memory-usage.md`:
- Around line 6-12: Document consistently that the mthreads.com/sgpu-memory
resource value is an integer count of 512 MiB units, not a percentage, in
docs/userguide/mthreads-device/specify-device-memory-usage.md lines 6-12,
versioned_docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md
lines 6-12, docs/userguide/mthreads-device/enable-mthreads-gpu-sharing.md line
72, and
versioned_docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
line 72; add the equivalent Chinese wording in
i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/specify-device-memory-usage.md
lines 7-13,
i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md
lines 7-13,
i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
line 74, and
i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
line 74.

In
`@i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md`:
- Line 74: Update the adjacent examples link in
i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
at lines 74-74 to use the HTTPS master examples path, and update the
corresponding link in
i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
at lines 74-74 to use the HTTPS v2.9.0 examples path instead of release-v2.6.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 57ddea82-5fcc-4dc5-8e9b-f8acd7c9e552

📥 Commits

Reviewing files that changed from the base of the PR and between c5f52fe and 2034446.

📒 Files selected for processing (8)
  • docs/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
  • docs/userguide/mthreads-device/specify-device-memory-usage.md
  • i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
  • i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/specify-device-memory-usage.md
  • i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
  • i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md
  • versioned_docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
  • versioned_docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md

Comment on lines +6 to +12
Allocate device memory by specifying the `mthreads.com/sgpu-memory` resource. This field is optional. Each unit of `mthreads.com/sgpu-memory` represents 512 MiB of device memory.

```yaml
resources:
limits:
mthreads.com/vgpu: 1 # requesting 1 GPU
mthreads.com/sgpu-memory: 32 # Each GPU contains 16G device memory
mthreads.com/sgpu-memory: 32 # 32 units x 512 MiB = 16 GiB of device memory

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Document the integer, non-percentage contract consistently.

All eight changed notes define 512 MiB units but do not state that the resource value is an integer count, not a percentage. Apply consistent wording at every site:

  • docs/userguide/mthreads-device/specify-device-memory-usage.md#L6-L12: state that the value is an integer count of 512 MiB units, not a percentage.
  • i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/specify-device-memory-usage.md#L7-L13: add the equivalent Chinese constraint.
  • i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md#L7-L13: add the equivalent Chinese constraint.
  • versioned_docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md#L6-L12: state the English constraint.
  • versioned_docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L72-L72: state the English constraint.
  • i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L74-L74: add the equivalent Chinese constraint.
  • docs/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L72-L72: state the English constraint.
  • i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L74-L74: add the equivalent Chinese constraint.
📍 Affects 8 files
  • docs/userguide/mthreads-device/specify-device-memory-usage.md#L6-L12 (this comment)
  • i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/specify-device-memory-usage.md#L7-L13
  • i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md#L7-L13
  • versioned_docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md#L6-L12
  • versioned_docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L72-L72
  • i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L74-L74
  • docs/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L72-L72
  • i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L74-L74
🤖 Prompt for 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.

In `@docs/userguide/mthreads-device/specify-device-memory-usage.md` around lines 6
- 12, Document consistently that the mthreads.com/sgpu-memory resource value is
an integer count of 512 MiB units, not a percentage, in
docs/userguide/mthreads-device/specify-device-memory-usage.md lines 6-12,
versioned_docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md
lines 6-12, docs/userguide/mthreads-device/enable-mthreads-gpu-sharing.md line
72, and
versioned_docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
line 72; add the equivalent Chinese wording in
i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/specify-device-memory-usage.md
lines 7-13,
i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/specify-device-memory-usage.md
lines 7-13,
i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
line 74, and
i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
line 74.

:::note

每一单位的 sgpu-memory 代表 512M 的显存。
每一单位的 sgpu-memory 代表 512MiB 的显存。

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix the version-inappropriate examples links.

Both Chinese enablement documents retain a release-v2.6 link that returns 404. Use master for the current document and v2.9.0 for the versioned snapshot. The corresponding target paths are available. ()

  • i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L74-L74: update the adjacent Line 80 link to the master examples path.
  • i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L74-L74: update the adjacent Line 80 link to the v2.9.0 examples path.

As per coding guidelines, external documentation links must be correct and use HTTPS where applicable.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~74-~74: 数词与名词之间一般应存在量词,可能缺少量词。
Context: ...threads.com/sgpu-core: 8 ``` :::note 每一单位的 sgpu-memory 代表 512MiB 的显存。 ::: :::no...

(wa5)

📍 Affects 2 files
  • i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L74-L74 (this comment)
  • i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md#L74-L74
🤖 Prompt for 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.

In
`@i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md`
at line 74, Update the adjacent examples link in
i18n/zh/docusaurus-plugin-content-docs/current/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
at lines 74-74 to use the HTTPS master examples path, and update the
corresponding link in
i18n/zh/docusaurus-plugin-content-docs/version-v2.9.0/userguide/mthreads-device/enable-mthreads-gpu-sharing.md
at lines 74-74 to use the HTTPS v2.9.0 examples path instead of release-v2.6.

Sources: Coding guidelines, MCP tools

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.

1 participant