Skip to content

docs(tutorials): add KAI Scheduler + HAMi-core lab on nvml-mock - #722

Open
maishivamhoo123 wants to merge 2 commits into
Project-HAMi:masterfrom
maishivamhoo123:docs/kai-scheduler-hami-lab
Open

docs(tutorials): add KAI Scheduler + HAMi-core lab on nvml-mock#722
maishivamhoo123 wants to merge 2 commits into
Project-HAMi:masterfrom
maishivamhoo123:docs/kai-scheduler-hami-lab

Conversation

@maishivamhoo123

@maishivamhoo123 maishivamhoo123 commented Aug 5, 2026

Copy link
Copy Markdown
Member

This PR adds a new tutorial lab (Lab 11) that shows how to run NVIDIA KAI Scheduler with HAMi-core memory isolation on a local kind cluster using nvml-mock, so people can try the integration without a real GPU. It builds on the existing nvml-mock lab and walks through installing the NVIDIA device-plugin, KAI Scheduler with the hamicore plugin, queues, and kai-resource-isolator, then verifies whole-GPU scheduling, fractional GPU-memory accounting, and HAMi-core's ld.so.preload injection. It also contains where a fake GPU stops Every command was run and every output is a real capture (KAI v0.17.0, kai-resource-isolator 1.1.0-chart). Includes English and Chinese versions plus the sidebar and overview entries. This docs contain the whole logs which i got during my testing. https://docs.google.com/document/d/1IxAtURfCziGarAyD2avN6b5V3BqpdmwJUTUSBy2Tvxs/edit?usp=sharing

fix :- #721

Summary by CodeRabbit

  • Documentation
    • Added an advanced lab tutorial for configuring and validating KAI Scheduler with HAMi-core and kai-resource-isolator.
    • Covers simulated GPU environments, whole- and shared-GPU scheduling, memory isolation, expected limitations, cleanup, and real-GPU follow-up steps.
    • Added the tutorial to the Labs navigation with an estimated duration of 50 minutes.

@hami-robot
hami-robot Bot requested review from rootsongjc and windsonsea August 5, 2026 03:27
@hami-robot

hami-robot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: maishivamhoo123
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

@netlify

netlify Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploy Preview for project-hami ready!

Name Link
🔨 Latest commit a062462
🔍 Latest deploy log https://app.netlify.com/projects/project-hami/deploys/6a72bb6d59c25a000816b5d5
😎 Deploy Preview https://deploy-preview-722--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.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@maishivamhoo123, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 seconds

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e8672069-dbef-4919-b8b1-18bc9ebb7bef

📥 Commits

Reviewing files that changed from the base of the PR and between c0e0f77 and a062462.

📒 Files selected for processing (3)
  • i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
  • sidebars-tutorials.js
  • tutorials/labs/kai-scheduler-hami.md
📝 Walkthrough

Walkthrough

Adds an advanced tutorial for installing and validating KAI Scheduler, HAMi-core, and kai-resource-isolator on an nvml-mock-backed kind cluster. It covers whole-GPU scheduling, shared-GPU injection, known NVML limitations, cleanup, and sidebar registration.

Changes

KAI Scheduler and HAMi lab

Layer / File(s) Summary
Cluster and simulated GPU setup
tutorials/labs/kai-scheduler-hami.md, i18n/zh/.../labs/kai-scheduler-hami.md, sidebars-tutorials.js
Adds prerequisites, kind cluster creation, nvml-mock deployment, device-plugin setup, simulated GPU labels, and Labs sidebar registration.
Scheduler and isolator configuration
tutorials/labs/kai-scheduler-hami.md, i18n/zh/.../labs/kai-scheduler-hami.md
Documents KAI GPU-sharing configuration, hamicore support, queue creation, kai-resource-isolator installation, webhook checks, and the nvidia RuntimeClass.
GPU scheduling and validation boundaries
tutorials/labs/kai-scheduler-hami.md, i18n/zh/.../labs/kai-scheduler-hami.md
Adds whole-GPU and shared-GPU Pod checks, HAMi-core injection verification, reservation-Pod diagnostics, and evidence tables.
Cleanup and follow-up
tutorials/labs/kai-scheduler-hami.md, i18n/zh/.../labs/kai-scheduler-hami.md
Adds resource cleanup commands and links for real-GPU validation and implementation references.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant kind
  participant nvml-mock
  participant device-plugin
  participant KAI Scheduler
  participant kai-resource-isolator
  participant Test Pod
  kind->>nvml-mock: Deploy simulated GPU support
  nvml-mock->>device-plugin: Provide GPU discovery
  device-plugin->>KAI Scheduler: Publish allocatable GPU resources
  Test Pod->>KAI Scheduler: Request whole GPU or gpu-memory
  KAI Scheduler->>Test Pod: Bind the Pod to a GPU allocation
  kai-resource-isolator->>Test Pod: Inject HAMi-core configuration
  Test Pod-->>Test Pod: Report Running or NVML library failure
Loading

Possibly related issues

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 added KAI Scheduler and HAMi-core tutorial using nvml-mock.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 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 5, 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: 4

🧹 Nitpick comments (2)
tutorials/labs/kai-scheduler-hami.md (2)

49-60: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Pin the Kubernetes version used by the lab.

The prerequisites constrain kind and kubectl, but kind create cluster leaves the Kubernetes node image implicit. Different installations can produce different cluster versions and captured outputs. Add a tested kindest/node image or document the exact Kubernetes version.

  • tutorials/labs/kai-scheduler-hami.md#L49-L60: pin the English lab cluster version.
  • i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md#L50-L61: apply the same pin in the Chinese lab.
🤖 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 `@tutorials/labs/kai-scheduler-hami.md` around lines 49 - 60, Pin the kind
Kubernetes node image in the cluster creation command to a tested kindest/node
version, replacing the implicit default. Apply the same pin to the corresponding
command in tutorials/labs/kai-scheduler-hami.md (lines 49-60) and
i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
(lines 50-61); keep the existing NODE_NAME assignment unchanged.

128-149: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Do not mutate or delete KAI's generated default queues.

KAI v0.17.0 creates default-parent-queue and default-queue during installation. This block creates another root, reparents the generated leaf, and later deletes default-queue. Use the generated queues, or create unique lab queues and clean up only those resources. (github.com)

  • tutorials/labs/kai-scheduler-hami.md#L128-L149: remove the manual default-queue mutation or use unique names.
  • tutorials/labs/kai-scheduler-hami.md#L320-L320: do not delete KAI's generated queue in cleanup.
  • i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md#L129-L150: apply the same queue change.
  • i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md#L321-L321: do not delete KAI's generated queue in cleanup.
🤖 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 `@tutorials/labs/kai-scheduler-hami.md` around lines 128 - 149, Do not mutate
or delete KAI-generated queues: in tutorials/labs/kai-scheduler-hami.md lines
128-149 and
i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
lines 129-150, remove the manual default-queue setup or replace it with uniquely
named lab queues; in both files’ cleanup lines 320 and 321, delete only
resources created by the lab, not KAI’s generated default-queue.

Source: MCP tools

🤖 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 `@tutorials/labs/kai-scheduler-hami.md`:
- Around line 298-303: The reservation Pod lookup is arbitrary and may select no
Pod or the wrong workload. In tutorials/labs/kai-scheduler-hami.md:298-303, wait
for the reservation Pod and select the Pod associated with
gpu-sharing-with-isolation using its owner, label, or exact BindingError name
before running kubectl logs; apply the same correlated selection in
i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md:299-304.
- Line 292: Correct the GPU fraction arithmetic in both tutorials: update
tutorials/labs/kai-scheduler-hami.md lines 292-292 and
i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
lines 293-293 so 20480 / 40960 is stated as 0.50; if retaining the reported 1.51
total, explain it through scheduler rounding or base-memory calculation rather
than the incorrect equation.
- Around line 97-100: Update the prerequisite lists in
tutorials/labs/kai-scheduler-hami.md at lines 49-52 and 97-100, and in
i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
at lines 50-53 and 98-101, to include NVCR/NGC access or document a mirrored
image for the NVIDIA device-plugin image used by the kubectl apply step. Keep
the English and Chinese prerequisite guidance consistent.
- Around line 121-153: Wait for KAI admission/webhook readiness after the Helm
install and before applying Queue resources in both
tutorials/labs/kai-scheduler-hami.md (lines 121-153) and
i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
(lines 122-154). Add a readiness wait or retry loop that handles certificate and
webhook startup delays, while preserving the existing Queue manifests and
subsequent kubectl checks.

---

Nitpick comments:
In `@tutorials/labs/kai-scheduler-hami.md`:
- Around line 49-60: Pin the kind Kubernetes node image in the cluster creation
command to a tested kindest/node version, replacing the implicit default. Apply
the same pin to the corresponding command in
tutorials/labs/kai-scheduler-hami.md (lines 49-60) and
i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
(lines 50-61); keep the existing NODE_NAME assignment unchanged.
- Around line 128-149: Do not mutate or delete KAI-generated queues: in
tutorials/labs/kai-scheduler-hami.md lines 128-149 and
i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
lines 129-150, remove the manual default-queue setup or replace it with uniquely
named lab queues; in both files’ cleanup lines 320 and 321, delete only
resources created by the lab, not KAI’s generated default-queue.
🪄 Autofix

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: 2455f650-913e-4d91-afae-78f83f06b565

📥 Commits

Reviewing files that changed from the base of the PR and between c0e0f77 and badda80.

📒 Files selected for processing (3)
  • i18n/zh/docusaurus-plugin-content-docs-tutorials/current/labs/kai-scheduler-hami.md
  • sidebars-tutorials.js
  • tutorials/labs/kai-scheduler-hami.md

Comment thread tutorials/labs/kai-scheduler-hami.md
Comment thread tutorials/labs/kai-scheduler-hami.md
Comment thread tutorials/labs/kai-scheduler-hami.md Outdated
Comment thread tutorials/labs/kai-scheduler-hami.md
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
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