Repository navigation
refactor: (9/N) add accelerator packages and route inference through drivers - #2565
Merged
Merged
Conversation
…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>
Contributor
There was a problem hiding this comment.
🔵 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
approved these changes
Nov 25, 2026
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason for Change:
Part 9 of the code-layout refactor (RFC #2506). Adds
pkg/accelerator(vendor-neutralType,Device,Vendor) with the NVIDIA rules inpkg/accelerator/nvidia, tags every SKU row with its accelerator type, and addsinternal/acceleratordrivers (NVIDIA, CPU) thatinternal/inferencenow uses for device requests, tolerations, shared-device env, base images and exclusive placement. No change to generated pod specs.Requirements
Issue Fixed:
Part of #2506
Notes for Reviewers:
pkg/acceleratorandinternal/acceleratorparts were squashed into one PR so reviewers see the interfaces with their first caller.pkg/sku:sku.CanonicalGPUModelis removed. Use(*sku.GPUConfig).CanonicalGPUModel()ornvidia.CanonicalGPUModel.isCPUInferencebranches (distributed, benchmark, max-model-len, KV-events port, graceful shutdown, lmcache) describe the CPU vLLM run shape, not device rendering, so they stay.accelerator.Deviceandsku.GPUConfigfield duplication is a separate PR.pkg/catalog/hfgen/generator.goandpkg/estimator/budget.go; whichever merges second needs a rebase.