Skip to content

Architecture

HAMi scheduling

Three layouts in one file: a step-by-step control plane, a grid of GPU nodes and a monitoring column. Each group arranges itself, so changing one never moves the others.

HAMi scheduling

# SPDX-FileCopyrightText: 2026 Reza Jelveh
#
# SPDX-License-Identifier: CC-BY-4.0

# HAMi scheduling flow: three balancing styles in one file
graph dir=LR balance=median route=curve edge-width=1.5 rank-gap=70
css "theme.css"

user "Data scientist" image=icons/user.svg img-width=40

group cp "Control plane" layout=layered dir=TB balance=center {
  api "kube-apiserver"
  hook "HAMi webhook" .hami
  sched "HAMi scheduler" .hami shape=pill
  api -> hook -> sched
}

group nodes "GPU nodes" layout=grid cols=2 gap=14 {
  default node .gpu
  g0 "A100\n80 GB"
  g1 "A100\n80 GB"
  g2 "H100\n80 GB"
  g3 "L40S\n48 GB"
}

group mon "Observability" layout=radial center=prom {
  prom "Prometheus" shape=circle
  graf "Grafana"
  alert "Alertmanager"
  dash "HAMi WebUI" .hami
}

db "etcd" shape=cylinder

user -> api "submit pod"
api <..> db arrow=both
sched ==> g1 "bind vGPU" .hot
nodes -> prom "metrics" width=1 head=open

Same file, square corners

Only the graph line changes: route=ortho draws edges with right angles.

HAMi scheduling, right-angle edges

# SPDX-FileCopyrightText: 2026 Reza Jelveh
#
# SPDX-License-Identifier: CC-BY-4.0

# HAMi scheduling flow: three balancing styles in one file
graph dir=LR balance=median route=ortho radius=8 edge-width=1.5 rank-gap=70
css "theme.css"

user "Data scientist" image=icons/user.svg img-width=40

group cp "Control plane" layout=layered dir=TB balance=center {
  api "kube-apiserver"
  hook "HAMi webhook" .hami
  sched "HAMi scheduler" .hami shape=pill
  api -> hook -> sched
}

group nodes "GPU nodes" layout=grid cols=2 gap=14 {
  default node .gpu
  g0 "A100\n80 GB"
  g1 "A100\n80 GB"
  g2 "H100\n80 GB"
  g3 "L40S\n48 GB"
}

group mon "Observability" layout=radial center=prom {
  prom "Prometheus" shape=circle
  graf "Grafana"
  alert "Alertmanager"
  dash "HAMi WebUI" .hami
}

db "etcd" shape=cylinder

user -> api "submit pod"
api <..> db arrow=both
sched ==> g1 "bind vGPU" .hot
nodes -> prom "metrics" width=1 head=open

GPU box to GPU cloud

A layered stack from hardware to platform, converted from a Graphviz diagram.

GPU box to GPU cloud

# SPDX-FileCopyrightText: 2026 Reza Jelveh
#
# SPDX-License-Identifier: CC-BY-4.0

# Blueprint: GPU box to GPU cloud
graph theme=default dir=TB route=bend rank-gap=34 node-gap=22
css {
  node  { text-align: left; font-size: 13px; padding: 6px 10px; }
  group { font-size: 11px; letter-spacing: 1px; }
  group.bare { fill: none; stroke: none; padding: 0; }
}

group tenants "TENANTS" layout=row gap=24 {
  ns  "ResourceQuota per namespace\nlimits.nvidia.com/gpumem\nlimits.nvidia.com/gpucores" .red
  pod "1  tenant pod\nnvidia.com/gpu\n+ gpumem + gpucores" .red
}

group cp "CONTROL PLANE" layout=row gap=18 {
  dra "HAMi-DRA (later)\nResourceClaims\nK8s 1.34+" .cyan stroke-dasharray=5,3
  wh  "2  webhook vgpu.hami.io\nsets schedulerName:\nhami-scheduler" .cyan
  sch "3  hami-scheduler pod :9395\nkube-scheduler\n+ vgpu-scheduler-extender" .cyan
  bs  "optional brain\nVolcano\nKueue / KAI" stroke-dasharray=5,3
}

group lower "" layout=row gap=28 .bare {
  group pools "NODE POOLS" layout=grid cols=2 gap=16 {
    nv   "4  NVIDIA nodes, gpu=on\nhami-device-plugin DaemonSet\ndevice-plugin + vgpu-monitor :9394" .green row=0 col=0
    core "5  libvgpu.so in the pod\nvia /etc/ld.so.preload\ncaps memory, paces compute" .yellow row=1 col=0
    oth  "Ascend / Kunlunxin / Hygon\nown limiter: vNPU-Core,\nvXPU, vDCU" .green row=1 col=1
  }
  group obs "OBSERVE AND SELL" layout=column gap=16 {
    prom "6  Prometheus\n:9395 reserved\n:9394 used"
    out  "allocation vs utilization\nKEDA scaling\nmetering, billing"
  }
}

ns -> pod
pod -> wh
pod ..> dra
wh -> sch
sch .. bs arrow=none
sch -> nv
dra ..> nv
nv -> core
nv -> prom
sch -> prom
prom -> out

Animated blueprint

The same idea with moving edges showing where requests go.

Animated blueprint

# SPDX-FileCopyrightText: 2026 Reza Jelveh
#
# SPDX-License-Identifier: CC-BY-4.0

# Blueprint: GPU box to GPU cloud
# Converted from the Graphviz `dot` block in talks/containerdays_neocloud_story.md
graph theme=nord dir=TB route=bend rank-gap=34 node-gap=22
css {
  node  { text-align: left; font-size: 13px; padding: 6px 10px; }
  group { font-size: 11px; letter-spacing: 1px; }
  group.bare { fill: none; stroke: none; padding: 0; }
}

group tenants "TENANTS" layout=row gap=24 {
  ns  "ResourceQuota per namespace\nlimits.nvidia.com/gpumem\nlimits.nvidia.com/gpucores" .red
  pod "1  tenant pod\nnvidia.com/gpu\n+ gpumem + gpucores" .red
}

group cp "CONTROL PLANE" layout=row gap=18 {
  dra "HAMi-DRA (later)\nResourceClaims\nK8s 1.34+" .cyan stroke-dasharray=5,3
  wh  "2  webhook vgpu.hami.io\nsets schedulerName:\nhami-scheduler" .cyan
  sch "3  hami-scheduler pod :9395\nkube-scheduler\n+ vgpu-scheduler-extender" .cyan border=pulse
  bs  "optional brain\nVolcano\nKueue / KAI" stroke-dasharray=5,3
}

group lower "" layout=row gap=28 .bare {
  group pools "NODE POOLS" layout=grid cols=2 gap=16 {
    nv   "4  NVIDIA nodes, gpu=on\nhami-device-plugin DaemonSet\ndevice-plugin + vgpu-monitor :9394" .green row=0 col=0
    core "5  libvgpu.so in the pod\nvia /etc/ld.so.preload\ncaps memory, paces compute" .yellow row=1 col=0
    oth  "Ascend / Kunlunxin / Hygon\nown limiter: vNPU-Core,\nvXPU, vDCU" .green row=1 col=1
  }
  group obs "OBSERVE AND SELL" layout=column gap=16 {
    prom "6  Prometheus\n:9395 reserved\n:9394 used"
    out  "allocation vs utilization\nKEDA scaling\nmetering, billing"
  }
}

ns -> pod
pod -> wh flow=forward
pod ..> dra
wh -> sch flow=forward
sch .. bs arrow=none
sch -> nv flow=forward
dra ..> nv
nv -> core flow=forward
nv -> prom flow=forward flow-speed=2s
sch -> prom flow=forward flow-speed=2s
prom -> out

Trunkline backbone

A dual-path backbone on the trunkline theme: ring flows, a draw-in route and fan=spread branches.

Trunkline backbone

# Dual-path backbone on the trunkline theme: draw-in route, ring flows, background grid.
graph dir=LR theme=trunkline route=ortho radius=0 diagonal=always grid=40 rank-gap=170 balance=center
dc "Data center" sub="GPU racks"
group fabric "Spine fabric" .rail layout=column gap=60 {
  spa "Spine A" sub="400G"
  spb "Spine B" sub="400G"
}
group svc .list layout=column align=start {
  obj "Object store" sub="S3 · 4 PB"
  train "Training cluster" sub="512 × H100"
  infer "Inference" sub="vLLM pool"
  feat "Feature store" sub="Redis"
  log "Logging" sub="Loki"
  peer "Peering" sub="IX · 2 × 100G"
}
dc -> spa "primary" .primary flow=forward flow-speed=.9s
dc -> spb "backup" .backup flow=forward flow-speed=1.4s
spa -> spb .primary flow=forward flow-speed=1.2s
spa -> obj, infer fan=spread stub=24
spa -> train .primary fan=spread stub=24 flow=draw flow-speed=2.5s
spb -> feat, log, peer fan=spread stub=24

Edges to groups

An edge can end on a whole group instead of a single node.

Edges to groups

# SPDX-FileCopyrightText: 2026 Reza Jelveh
#
# SPDX-License-Identifier: CC-BY-4.0

# Edges can end on a group box itself, or on square nodes
graph dir=LR route=ortho radius=8

sched "HAMi scheduler" shape=square
group pool "GPU pool" layout=grid cols=2 {
  g0 "A100"; g1 "A100"; g2 "H100"; g3 "L40S"
}
prom "Prometheus" shape=square

sched ==> pool "bind"
pool -> prom "metrics"

HAMi documentation figures

Three figures from the HAMi docs, redrawn with the hami theme. They use second lines (sub=), numbered steps, header bands, accent bars, a legend and a caption.

A Pod's path to a shared GPU

Two panels with their own column layouts, numbered steps, and a notes panel.

Pod to GPU

# SPDX-FileCopyrightText: 2026 Reza Jelveh
#
# SPDX-License-Identifier: Apache-2.0

# How HAMi gets a Pod onto a shared GPU (after the HAMi docs figure).
# Shows: sub= second lines, numbered steps, header bands, accent bars, a dashed box,
# and a notes panel.
graph layout=row align=stretch theme=hami caption="How a Pod with nvidia.com/gpumem gets a slice of a GPU"

group cp "Control plane" sub="decides where the Pod runs" layout=column gap=40 {
  pod "Pod" sub="nvidia.com/gpumem: 3000"
  webhook "MutatingWebhook" sub="sets schedulerName: hami-scheduler" .blue
  sched "HAMi scheduler" sub="extender next to kube-scheduler\npicks a node and a card" .blue
  group talk "How the two sides talk" layout=column .notes {
    nodeann "Node annotation" sub="device plugin → scheduler\nUUID, memory, cores of each card" .green .note
    podann "Pod annotation" sub="scheduler → device plugin\nthe chosen card and the Pod's share" .purple .note
  }
}

group node "GPU node" sub="sets up the container and enforces the limits" layout=column gap=40 .green {
  kubelet "kubelet" sub="starts the Pod"
  plugin "HAMi device plugin" sub="reads the Pod annotation" .green
  group ctr "Container" layout=column .container {
    app "Your application"
    core "HAMi-Core · libvgpu.so" sub="checks memory and kernel calls\nCUDA_DEVICE_MEMORY_LIMIT_0=3000m" .core
    cuda "CUDA / NVML libraries"
  }
  gpu "GPU"
}

pod -> webhook step=1
webhook -> sched step=2
sched -> kubelet "bind to node"
kubelet -> plugin "Allocate()" step=3
plugin -> ctr "mounts the GPU and libvgpu.so" step=4
ctr -> gpu step=5

css {
  group.notes { fill: #ffffff; stroke-dasharray: 4 3; title-fill: none; font-size: 12px; }
  node.note { fill: #ffffff; stroke: none; text-align: left; font-weight: 600; }
  node.note.green  { color: var(--green); accent-bar: 3px var(--green); }
  node.note.purple { color: var(--purple); accent-bar: 3px var(--purple); }
  group.container { fill: #ffffff; stroke: #64748b; stroke-dasharray: 6 4; title-fill: none;
                    font-weight: normal; }
  node.core { fill: var(--green); stroke: var(--green); color: #ffffff; }
  node.core sub { color: #dcfce7; }
  #gpu { stroke: var(--green); }
}

The GPU stack

align=stretch gives five tiers of equal width; the HAMi component is highlighted and named in the legend.

GPU stack

# SPDX-FileCopyrightText: 2026 Reza Jelveh
#
# SPDX-License-Identifier: Apache-2.0

# The GPU software stack, bottom to top, with HAMi's place in it (after the HAMi docs figure).
# Shows: align=stretch for equal-width tiers, a highlighted node, legend.
graph layout=column align=stretch gap=14 theme=hami caption="Where HAMi sits in the GPU stack"

default group layout=row align=center gap=12 .tier

group l5 "Layer 5: Kubernetes Scheduling" {
  k8s_sched "Kubernetes Scheduler"
  hami_sched "HAMi Scheduler" .hami
  pod "Pod"
}
group l4 "Layer 4: Container Runtime" {
  containerd "containerd"
  nct "NVIDIA Container Toolkit"
  container "Container"
}
group l3 "Layer 3: User-Space Libraries/Tools" {
  cuda "CUDA Runtime / Toolkit"
  nvml "NVML (libnvidia-ml.so)"
  smi "nvidia-smi"
  dcgm "DCGM"
  mig "MIG"
}
group l2 "Layer 2: Kernel Driver" {
  ko "nvidia.ko (Kernel Module)"
  uvm "nvidia-uvm.ko"
  modeset "nvidia-modeset.ko"
}
group l1 "Layer 1: Hardware" {
  gpu "NVIDIA GPU"
  pcie "PCIe Bus"
  nvlink "NVLink (Optional)"
}

legend .hami "HAMi component"
legend .plain "Kubernetes / NVIDIA"

css {
  group.tier { fill: #ffffff; stroke: var(--border); title-fill: none; font-size: 14px; }
  node { font-weight: normal; font-size: 13px; padding: 8px 16px; }
  node.hami { fill: var(--green); stroke: var(--green); color: #ffffff; font-weight: 600; }
}

NVIDIA kernel modules

Three stacked panels with vertical titles (label-position: left), a dashed box marking the compute modules, an edge that goes around the display modules (exit=left enter=left), and two side brackets (bracket nvidia, drm "...").

NVIDIA kernel modules

# SPDX-FileCopyrightText: 2026 Reza Jelveh
#
# SPDX-License-Identifier: Apache-2.0

# NVIDIA kernel module hierarchy and the path from user space to the GPU
# (after the HAMi docs figure). Shows: sub= lines, a dashed box inside a panel,
# edge labels, vertical panel labels (label-position: left) and side brackets.
graph layout=column align=stretch gap=10 theme=hami caption="NVIDIA driver modules and the path from user space to the GPU"

group user "User space" layout=row gap=60 .space {
  group smi_col layout=column gap=18 align-x=nvidia .bare {
    smi "nvidia-smi" .plain
    nvml "libnvidia-ml.so" sub="NVML" .blue
  }
  group cuda_col layout=column gap=18 align-x=uvm .bare {
    app "CUDA application" .plain
    libcuda "libcuda.so" sub="CUDA driver API" .blue
  }
}

group kernel "Kernel space" layout=column gap=34 .green {
  group compute "needed by compute workloads" layout=row gap=60 .compute {
    nvidia "nvidia" sub="core GPU driver" .green
    uvm "nvidia_uvm" sub="unified virtual memory" .green
  }
  group display layout=row gap=60 .bare {
    modeset "nvidia_modeset" sub="display mode setting" .plain
    drm "nvidia_drm" sub="Linux DRM interface" .plain
  }
}

group hw "Hardware" layout=row .space {
  gpu "NVIDIA GPU" .plain
}

smi -> nvml
app -> libcuda
nvml -> nvidia
libcuda -> uvm "ioctl on /dev/nvidia*"
uvm -> nvidia "depends on"
modeset -> nvidia "depends on"
drm -> modeset "depends on"
nvidia -> gpu exit=left enter=left route=ortho stub=10

bracket smi, gpu "nvidia-smi needs\nthe whole path"
bracket nvidia, drm "lsmod checks\nonly this layer"

css {
  group.space, group.green { label-position: left; font-size: 13px; padding: 14px 14px 14px 28px; }
  #user, #hw { color: var(--blue); }
  #kernel { color: var(--green); }
  group.space { fill: #eff6ff; stroke: none; title-fill: none; }
  group.green { title-fill: none; stroke: none; }
  group.bare  { fill: none; stroke: none; padding: 0; }
  group.compute { fill: none; stroke: #4ade80; stroke-dasharray: 6 4; padding: 10px;
                  color: var(--green); font-weight: normal; font-size: 11px; label-position: bottom;
                  text-align: right; }
  node.plain { font-weight: 600; }
  node.blue  { color: var(--blue); accent-bar: none; stroke: #38bdf8; }
  node.green { color: var(--green); accent-bar: none; }
  edge { stroke: #4b83a8; }
}