Skip to content

refactor: (9/N) add accelerator packages and route inference through drivers - #2565

Merged
Fei-Guo merged 7 commits into
kaito-project:mainfrom
zhuangqh:qzhuang/accelerator-pkg
Nov 25, 2026
Merged

Fei-Guo merged 7 commits into
kaito-project:mainfrom
zhuangqh:qzhuang/accelerator-pkg

Conversation

@zhuangqh

Copy link
Copy Markdown
Collaborator

Reason for Change:
Part 9 of the code-layout refactor (RFC #2506). Adds pkg/accelerator (vendor-neutral Type, Device, Vendor) with the NVIDIA rules in pkg/accelerator/nvidia, tags every SKU row with its accelerator type, and adds internal/accelerator drivers (NVIDIA, CPU) that internal/inference now uses for device requests, tolerations, shared-device env, base images and exclusive placement. No change to generated pod specs.

Requirements

  • added unit tests and e2e tests (if applicable).

Issue Fixed:
Part of #2506

Notes for Reviewers:

  • No behavior change: toleration order, MIG resources, CPU placement labels and images are unchanged. AMD and Neuron SKUs keep the NVIDIA driver, as they did before drivers existed.
  • Size: about 1.5k lines, because the pkg/accelerator and internal/accelerator parts were squashed into one PR so reviewers see the interfaces with their first caller.
  • Breaking for importers of pkg/sku: sku.CanonicalGPUModel is removed. Use (*sku.GPUConfig).CanonicalGPUModel() or nvidia.CanonicalGPUModel.
  • Existing test edits are call-site changes required by the new signatures; no expected values changed, except two assertions that compared the code with itself and now use literal values.
  • Remaining isCPUInference branches (distributed, benchmark, max-model-len, KV-events port, graceful shutdown, lmcache) describe the CPU vLLM run shape, not device rendering, so they stay.
  • Follow-ups: tuning, RAG, node provisioning and node checks move to the drivers in the next PR; accelerator.Device and sku.GPUConfig field duplication is a separate PR.
  • Conflicts: feat: enable lmcache for all preset models #2543 and fix: lower gpu-memory-utilization for DeepSeek-V4-Flash-0731 on 8xH100 #2505 also edit pkg/catalog/hfgen/generator.go and pkg/estimator/budget.go; whichever merges second needs a rebase.

…drivers

- pkg/accelerator: Type (nvidia, amd, neuron, cpu), Device and Vendor.
- pkg/accelerator/nvidia: Vendor reads devices from GFD labels; CanonicalGPUModel,
  canonical GPU model constants and the GPU-model-only vLLM rules move here.
- sku.GPUConfig gains Accelerator, set on every SKU row, and a
  CanonicalGPUModel method that dispatches to the vendor. sku.CanonicalGPUModel
  is removed.
- internal/accelerator: Driver interface with NVIDIA and CPU drivers for device
  requests, tolerations, shared-device env, inference base image and exclusive
  placement. AMD and Neuron keep the NVIDIA driver. internal/inference and the
  LMCache sidecar use the drivers instead of NVIDIA literals. No behavior change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Qinghui Zhuang <qzhuang@microsoft.com>
The default e2e region (polandcentral) allows only A10 VM sizes, so adding the
Standard_NC24ads_A100_v4 node pool fails. Use eastus with a Standard_D4d_v4
system pool, as preset-model-regression does for A100, and add a region input.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Qinghui Zhuang <qzhuang@microsoft.com>
Pass the driver's accelerator.Type into the vLLM command builder instead of
a CPU-only bool, so device-specific arguments key off one value.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Qinghui Zhuang <qzhuang@microsoft.com>

Copilot AI 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.

🔵 Needs a closer look

The MIG workflow changes require cluster validation of driver/kernel compatibility and successful partitioning, unavailable in this review, plus explicit maintainer approval.

No open issues 🎉

What changed in this PR

Part 9 of #2506 introduces an accelerator abstraction for KAITO, separating vendor-specific rules and pod rendering from inference generation while aiming to preserve existing pod specs.

Changes:

  • Adds public accelerator types, NVIDIA rules, and accelerator tags for all SKU entries.
  • Routes inference resources, tolerations, images, placement, and LMCache device settings through CPU/NVIDIA drivers, with corresponding test updates.
  • Updates MIG e2e configuration with a selectable region, pinned node OS and driver version, and additional diagnostics.
File Description
pkg/​sku/​mig.go Tags MIG configurations as NVIDIA.
pkg/​sku/​helpers.go Delegates node-label parsing to the NVIDIA vendor implementation.
pkg/​sku/​helpers_test.go Updates coverage for vendor delegation and model canonicalization.
pkg/​sku/​cloud_sku_handler.go Adds accelerator type and model canonicalization to GPUConfig.
pkg/​sku/​cloud_sku_handler_test.go Checks that every SKU declares an accelerator type.
pkg/​sku/​azure_sku_handler.go Tags Azure SKUs with NVIDIA or AMD types.
pkg/​sku/​aws_sku_handler.go Tags AWS SKUs with NVIDIA, AMD, or Neuron types.
pkg/​sku/​arc_sku_handker.go Tags Azure Local SKUs as NVIDIA.
pkg/​model/​interface.go Replaces the CPU runtime flag with an accelerator type.
pkg/​estimator/​budget.go Delegates GPU-specific overhead values to NVIDIA rules.
pkg/​catalog/​hfgen/​generator.go Uses NVIDIA model constants and memory-utilization rules.
pkg/​accelerator/​nvidia/​models.go Houses model canonicalization and GPU-specific memory policies.
pkg/​accelerator/​nvidia/​mig.go Defines the whole-GPU resource constant.
pkg/​accelerator/​nvidia/​device.go Extracts device information and MIG state from node labels.
pkg/​accelerator/​nvidia/​device_test.go Relocates node-label parsing tests to the vendor package.
pkg/​accelerator/​accelerator.go Defines vendor-neutral accelerator types and interfaces.
internal/​inference/​preset_inferences.go Uses drivers for device-specific inference pod generation.
internal/​inference/​preset_inferences_test.go Adapts tests to drivers and adds literal expected values.
internal/​inference/​lmcache_sidecar.go Uses the resolved driver for eligibility and device environment settings.
internal/​accelerator/​nvidia/​driver.go Implements NVIDIA resources, tolerations, images, and shared-device settings.
internal/​accelerator/​nvidia/​driver_test.go Tests NVIDIA resources, tolerations, and image selection.
internal/​accelerator/​driver.go Defines the driver interface, registry, and target resolution.
internal/​accelerator/​driver_test.go Tests driver selection and compatibility fallbacks.
internal/​accelerator/​cpu/​driver.go Implements CPU tolerations, images, and exclusive placement labels.
internal/​accelerator/​cpu/​driver_test.go Tests CPU rendering and unsupported-runtime rejection.
api/​v1beta1/​workspace_validation.go Uses GPUConfig.CanonicalGPUModel() during validation.
.github/​workflows/​mig-e2e-test.yaml Updates region, node sizing, OS/driver pins, and failure diagnostics.

Review effort: Balanced

@Fei-Guo
Fei-Guo merged commit 1f2d3e8 into kaito-project:main Nov 25, 2026
16 of 22 checks passed

This branch is waiting to be deployed

1 inactive and 1 waiting deployments
e2e-test — e5657bd0 Waiting Nov 20, 2026 by zhuangqh via h100 (australiaeast) #956
unit-tests — e5657bd0 Deployed Nov 20, 2026 by zhuangqh via unit-tests #5397
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants