Page MenuHomePhabricator

ml-serve-eqiad: Repartition two MI300X nodes from 24GB to 96GB partitions
Closed, ResolvedPublic

Description

Summary

Change the partitioning of the eqiad MI300X nodes so that the 20B-27B models (gpt-oss-safeguard-20b, cope-b-a4b, Qwen 27B) can run on 96GB partitions instead of full 192GB ones.

NodeCurrentTarget
ml-serve10128x192GBunchanged
ml-serve101364x24GB16x96GB
ml-serve101464x24GB16x96GB
ml-serve101564x24GBunchanged

Resulting capacity: 8x192GB, 32x96GB, 64x24GB.

Acceptance criteria

  • ml-serve1013 and ml-serve1014 expose 16 GPU partitions each to Kubernetes.
  • ml-serve1012 and ml-serve1015 keep their current partitioning.

Event Timeline

isarantopoulos renamed this task from [draft] ml-serve-eqiad: Repartition two MI300X nodes from CPX (24GB) to DPX (96GB) partitions to ml-serve-eqiad: Repartition two MI300X nodes from CPX (24GB) to DPX (96GB) partitions.Sep 3 2026, 2:59 PM
isarantopoulos renamed this task from ml-serve-eqiad: Repartition two MI300X nodes from CPX (24GB) to DPX (96GB) partitions to ml-serve-eqiad: Repartition two MI300X nodes from 24GB to 96GB partitions.
isarantopoulos updated the task description. (Show Details)

I'll be updating this today, will have to drain the 2 nodes soon one by one

Change #1343981 had a related patch set uploaded (by Dpogorzelski; author: Dpogorzelski):

[operations/puppet@production] ml-serve: repartition ml-serve1013 and 1014 to 16x96GB

https://gerrit.wikimedia.org/r/1343981

Change #1343981 merged by Dpogorzelski:

[operations/puppet@production] ml-serve: repartition ml-serve1013 and 1014 to 16x96GB

https://gerrit.wikimedia.org/r/1343981

I had to rollback the change as I ran into issues with the amd-device-k8s-plugin while applying the change only on ml-serve1013. the plugin seems to report only 8 partitions regardless of how the gpu is partitioned, even on nodes that were not touched and should be report a different number and i need to investigate this further. i'm not sure how this is possible but i need more time on this.

Seems that 1.31.0.9 of amd-k8s-device-plugin fixes the issue described above. I will look into updating the package and then rolling out the partitioning change again.

Change #1344242 had a related patch set uploaded (by Dpogorzelski; author: Dpogorzelski):

[operations/debs/amd-k8s-device-plugin@master] Release upstream version 1.31.0.10

https://gerrit.wikimedia.org/r/1344242

Change #1344242 merged by Dpogorzelski:

[operations/debs/amd-k8s-device-plugin@master] Release upstream version 1.31.0.10

https://gerrit.wikimedia.org/r/1344242

The new package fixes the issue of detecting the count of allocatable partitions:
before:
kubectl get node ml-serve1014.eqiad.wmnet -o jsonpath='{.status.allocatable.amd\.com/gpu}{"\n"}'
8

after:
kubectl get node ml-serve1014.eqiad.wmnet -o jsonpath='{.status.allocatable.amd\.com/gpu}{"\n"}'
64

and preserves the count on nodes which had 8 raw devices.

I will now reapply the partitioning change

Change #1344593 had a related patch set uploaded (by Dpogorzelski; author: Dpogorzelski):

[operations/puppet@production] ml-serve: repartition ml-serve1013 and 1014 to 16x96GB

https://gerrit.wikimedia.org/r/1344593

Change #1344593 merged by Dpogorzelski:

[operations/puppet@production] ml-serve: repartition ml-serve1013 and 1014 to 16x96GB

https://gerrit.wikimedia.org/r/1344593

ml-serve1013 and ml-serve1014 are now DPX/NPS1, 16x96GB each, and both advertise amd.com/gpu: 16 to Kubernetes. ml-serve1012 (SPX/NPS1, 8x192GB) and ml-serve1015 (CPX/NPS4, 64x24GB) keep their layouts.

hostmodelayoutallocatable
ml-serve1012SPX/NPS18x192GB8
ml-serve1013DPX/NPS116x96GB16
ml-serve1014DPX/NPS116x96GB16
ml-serve1015CPX/NPS464x24GB64

Why the first attempt was reverted

amd-k8s-device-plugin 1.31.0.8 advertised one device per physical card in every partition mode. It matched each partition to its parent card through the KFD unique_id property, assuming the two share a value. On these hosts every partition has a distinct unique_id (64 of them for 64 partitions), so no partition ever matched, and every secondary partition was dropped.

Upstream fixed this in 1.31.0.9 by grouping partitions on location_id/domain instead. I imported 1.31.0.10 into operations/debs/amd-k8s-device-plugin and published 1.31.0.10-1 to trixie-wikimedia. I stopped short of 1.31.0.11 because it needs Go 1.26.7, which only trixie-backports has.

Side effect worth noting: until the upgrade, ml-serve1013-1015 exposed 8x24GB, i.e. 192GB of each node's 1536GB, to Kubernetes. ml-serve1015 went from 8 to 64 allocatable on the upgrade alone.

MI300X partitioning, as observed on this hardware

  • The supported modes are SPX/NPS1, DPX/NPS1, QPX/NPS1-4 and CPX/NPS1-4. NPS2 is not available, although AMD's docs list DPX+NPS2, so 96GB partitions mean DPX+NPS1.
  • Memory-mode writes are only staged until amd-smi reset -r (a driver reload, 1-2 minutes).
  • A driver reload does not keep the compute mode. It falls back to the default for the memory mode (SPX for NPS1, CPX for NPS4), so the compute mode has to be set after the reload. Setting it live needs no reload.
  • After a reboot, the memory mode is kept and the compute mode is not.
  • amd-smi exits 0 even when it rejects a write, so the script now reads state back from sysfs instead of trusting the exit code.
  • amd-smi GPU indices count partitions, not cards, and they renumber mid-loop when a card changes mode, so cards are addressed by BDF.
  • On ml-serve1014, amd-smi set -C DPX fails because its parser builds the list of valid modes from a string and splits it into single characters. Writing current_compute_partition in sysfs works on both nodes. The amd-smi-lib version is the same on 1013 and 1014, and I haven't found why the two nodes behave differently.

Puppet

3b9ec9eea1 adds profile::amd_gpu::gpu_compute_partition_mode and reworks amd-smi-gpu-partition:

  • the memory mode is staged and the driver reloaded only if the memory mode differs, so a normal boot skips the reload; the compute mode is set after any reload;
  • the unit waits until the KFD topology shows every partition before the device plugin starts. The plugin enumerates GPUs only once, at startup.

On a reboot of ml-serve1013 the unit restored DPX in about 3 seconds with no driver reload.

Nodes also carry amd.com/gpu.compute-partition next to amd.com/gpu.memory-partition.

Change #1344685 had a related patch set uploaded (by Dpogorzelski; author: Dpogorzelski):

[operations/puppet@production] amd_gpu: set the compute partition mode through sysfs

https://gerrit.wikimedia.org/r/1344685

@DPogorzelski-WMF Could you also update the doc https://wikitech.wikimedia.org/wiki/Machine_Learning/AMD_GPU to reflect the current GPU partitioning when you get a chance? Thanks!