Repository navigation
Conversation
salexo
requested review from
AVSuni,
bjorn-amd and
williamanzen
as code owners
November 6, 2026 08:54
This was referenced Nov 6, 2026
bjorn-amd
requested changes
Nov 30, 2026
bjorn-amd
left a comment
Contributor
There was a problem hiding this comment.
Review summary
Verdict: Approve, with one small ask before merge
Before merge
- Guard the
maketargets against the wrong kube context. The fake-fleet targets act on whatever context is current. Run from a terminal pointed at the shared GPU vcluster, they would add ten fake GPU nodes there. A check that the context is a kind cluster, or an explicit override variable, would prevent that.
Kind has no GPUs and its labelled workers advertise no amd.com/gpu, so e2e tests cannot check where GPU workloads are scheduled, and there is no way to exercise DRA. This adds fake AMD GPU nodes that exist only in the API, run by KWOK, that the scheduler treats like real GPU nodes. hack/fakegpu generates them from a fleet file: Node objects with the AMD GPU Operator's and the AcceleratorDetector's labels, an amd.com/gpu taint, and either allocatable amd.com/gpu (device-plugin groups) or a gpu.amd.com ResourceSlice in the AMD GPU DRA driver's format (dra groups), including compute partitions. Its unit tests compare the devices with ResourceSlices the driver's own discovery code published for the same node shapes. - hack/kwok/install.sh installs a pinned KWOK release. - make kwok-install, fake-gpu-fleet, fake-gpu-fleet-delete and test-chainsaw-kwok run the lane. Tests labelled requires=kwok are excluded from every other selector, because the fleet's GPU-labelled nodes change other tests' node counts. - The kind config enables the ExtendedResourceToleration admission plugin, so pods requesting amd.com/gpu tolerate the fake nodes' taint. - tests/e2e/kwok checks device-plugin and DRA placement, including CPX partitions and unsatisfiable requests.
The fleet now has the node shapes the DRA work needs to test against: - dp-mixed-models and dra-mixed-models: 4 x MI350P and 2 x Radeon AI PRO R9700 on one node. The device-plugin node advertises them as one amd.com/gpu pool; on the DRA node each device carries its own deviceID. - dra-mixed-partitions: 4 x MI300X in SPX-NPS1 and 4 in CPX-NPS1 on one node. The generator gains the MI350P (from AMD's specifications; not partitionable until checked against hardware) and rejects device-plugin groups whose GPUs are in different partition modes, which the AMD device plugin supports only with its mixed resource naming. The KWOK tests check that a claim on the mixed-model node gets only the model it selects, that one claim can take a whole GPU and partitions from the mixed-partition node, and that the device-plugin mixed node is a single pool.
Adds a test-e2e-kwok job that creates a kind cluster from hack/kind/config.yaml, installs KWOK and the fake GPU fleet, and runs make test-chainsaw-kwok. It runs on its own cluster because the fleet's GPU-labelled nodes would change the node counts the main e2e suite asserts on, and it is the first check of the kind config's ExtendedResourceToleration admission plugin.
kind v0.31 generates a kubeadm v1beta3 ClusterConfiguration and skips patches with another apiVersion, so the v1beta4 patch was never applied and the KWOK lane's device-plugin test stayed Pending without its toleration. Use the v1beta3 form, and check in the KWOK CI job that the API server runs with the plugin before the tests start.
kwok-install, fake-gpu-fleet and fake-gpu-fleet-delete act on the current kubectl context. From a terminal pointed at a shared GPU cluster they would add fake GPU nodes to it. They now refuse non-kind contexts unless FAKE_GPU_CONTEXT names the current one.
salexo
force-pushed
the
feature/kwok-fake-gpu-nodes
branch
from
December 1, 2026 08:45
b724674 to
9d7cae8
Compare
Contributor
Author
|
Done in 9d7cae8: |
The fixtures are what the AMD GPU DRA driver's discovery code computes on sysfs trees written from the GPU models' specifications, not slices taken from real nodes. Their PCI addresses follow those trees and the test compares them, so the old advice to refresh them from a real node would make the test fail.
This branch has not been 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.
Why
Kind has no GPUs, and the labelled worker nodes in
hack/kind/config.yamladvertise noamd.com/gpu. Pods that request GPUs therefore never schedule in e2e, profile capacity checks are skipped, and there is no way to exercise DRA at all. This adds fake AMD GPU nodes that exist only in the API, run by KWOK, which the scheduler treats like real GPU nodes. It is the test harness for the upcoming DRA work, and is useful on its own for device-plugin placement tests.What changes
hack/fakegpu: a small Go generator. It reads a fleet file (hack/fakegpu/fleet.yaml) of node groups and prints:amd.com/gpu:NoScheduletaint, and capacity.device-plugingroups, allocatableamd.com/gpu, one per GPU or compute partition (resource_naming_strategy: single).dragroups, agpu.amd.comResourceSlice in the AMD GPU DRA driver's format: one device per GPU or partition, withtype,deviceID,productName,partitionProfile,numaNode, PCI attributes andmemory/computeUnits/simdUnitscapacities.gpu.amd.comDeviceClass, for clusters without the driver.hack/fakegpu/fleet.yaml): device-plugin and DRA nodes with whole GPUs and CPX partitions; two GPU models on one node (4 x MI350P and 2 x Radeon AI PRO R9700) in both modes; and a DRA node whose MI300X GPUs are in two partition modes (SPX-NPS1 and CPX-NPS1). The generator rejects mixed partition modes on device-plugin nodes, which the AMD device plugin supports only with itsmixedresource naming. MI350P comes from AMD's specifications and is modelled as not partitionable until checked against hardware.hack/fakegpu/testdata): 8 x MI300X on two NUMA nodes, 2 x MI300X in CPX-NPS4, and a mixed MI210 + W7900 node. That code ran on sysfs trees written from the GPU models' specifications, not on real nodes.hack/kwok/install.sh: installs a pinned KWOK release (v0.8.0) and its fast stages.kwok-install,fake-gpu-fleet,fake-gpu-fleet-deleteandtest-chainsaw-kwok.requires=kwokare excluded from every other selector, because the fleet's GPU-labelled nodes change the node counts other tests assert on.ExtendedResourceTolerationadmission plugin. Pods requestingamd.com/gpu, such as inference pods, then tolerate the fake nodes' taint without changes, and other pods stay off them.tests/e2e/kwok: device-plugin placement (whole node, CPX partitions, unsatisfiable request, a mixed-model node as oneamd.com/gpupool) and DRA placement (whole GPUs by device ID, CPX partitions bypartitionProfile, one model of a mixed-model node, a whole GPU plus partitions from a mixed-partition node in one claim, and a model the node doesn't have).docs/docs/contributing/testing.md.Notes for reviewers
amd.com/gpu, so the admission plugin doesn't add a toleration for them. The DRA tests carry their own. AIM Engine currently has no way to give inference pods tolerations, which the DRA work will need to address.amd.com/gpupods to HAMi, which rejects nodes it didn't register. This is documented, with the namespace label that bypasses it.Testing
go test ./hack/fakegpu/passes, including the fixture comparison. gofmt and vet are clean, andgolangci-lint2.5.0 reports 0 issues.amd.com/gpucapacity kept on creation.kwok-dra-placementpasses as committed.kwok-device-plugin-placementpasses with tolerations added to its pods, because that cluster lacks the admission plugin (and runs HAMi, which had to be bypassed).ExtendedResourceTolerationpatch inhack/kind/config.yaml, andkwok-device-plugin-placementwithout tolerations. Creating a fresh kind cluster failed on the host's inotify instance limit, which is unrelated to this change.