← Back to Pull requests

feat(validator): verify GPU access and isolation on Slinky Slurm #3057

Closed
unknown closed this pull request without merging on Oct 04, 2026 16:23 UTC
View on GitHub
unknown unknown commented on Oct 02, 2026 15:52 UTC
Author

Summary

Adds slinky-slurm-gpu-access, a conformance check that proves on every GPU-backed Slinky Slurm recipe that a Slurm job allocated one GPU can use exactly that GPU, and that a job with no GPU allocation on the same Slurm node cannot open any GPU device. It replaces the "not verified" statement #2723 put on the CNCF page.

Motivation / Context

secure-accelerator-access skips on Slinky recipes (#2724), and nothing else exercised Slurm's own GPU access path: slinky-slurm-health only runs cat /etc/os-release in a GPU job and slinky-slurm-imex-channel checks IMEX channel distinctness. A conformance run on a Slurm recipe could read as complete with GPU access and isolation unverified.

Fixes: #2756
Related: #2723, #2724

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

  • New feature (non-breaking change that adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

  • Documentation update

  • Refactoring (no functional changes)

  • Build/CI/tooling
  • Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)

  • API server (cmd/aicrd, pkg/server)

  • Recipe engine / data (pkg/recipe)

  • Bundlers (pkg/bundler, pkg/component/)

  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)

  • Validator (pkg/validator)

  • Core libraries (pkg/errors, pkg/k8s)

  • Docs/examples (docs/, examples/)

  • Other: validators/conformance, pkg/evidence/cncf, six Slinky overlays
  • Implementation Notes

  • Why the probe opens devices instead of listing them. Slurm job steps run inside the slurmd container, which the device plugin gave every GPU on the node, and enroot does not restrict /dev. Slurm isolates with the cgroup device controller (ConstrainDevices=yes plus task/cgroup), which leaves /dev/nvidiaN listed and refuses open() with EPERM. A ls /dev/nvidia absence probe, as proposed in the issue and as secure-accelerator-access uses for pods, would fail on a correctly confined cluster. The probe reports the errno of a read-only open of every GPU minor, and Go decides; any errno other than EPERM fails as inconclusive.

  • Two jobs from the login pod, bounded like the other Slinky checks (--immediate=30 --time=1:00 --nodes=1 --ntasks=1 --cpus-per-task=1 --mem=128M, no container image). Job A (--gpus=1) must list exactly one GPU through nvidia-smi and open exactly one minor, every other minor refused with EPERM. Job B has no GPU request and is pinned with --nodelist to job A's node, so it cannot pass by landing on a node with no GPUs; it must open no minor and nvidia-smi must list no GPU.

  • Fail closed. The shell only prints KEY=value facts; every step that produces evidence (find, the nvidia-smi line split, perl) runs outside a pipeline or under its own guard, and a missing DONE=1 marker, a repeated key, a hostlist node name or a dropped device line fails the check. A GPU with MIG mode Enabled fails job A (--query-gpu=uuid,mig.mode.current).

  • Selection and evidence. The six GPU Slinky leaves select the check; the kind leaf does not (it runs without task/cgroup, and the check skips on kind). The check maps onto the existing secure_accelerator_access requirement, so on Slinky recipes, where secure-accelerator-access skips, it alone fills secure-accelerator-access.md.

  • Guards added. conformanceChecks() plus a test keeps main.go and the catalog in step in both directions (an unregistered name otherwise only fails on a live cluster). A recipe test requires every GPU Slinky leaf to select the check. A test executes the probe shell with a failing find shim, so the earlier find | sort fail-open cannot return silently.

  • Goldens moved deliberately for exactly the six leaves: pkg/recipe/testdata/catalog_parity_golden.yaml and pkg/bundler/testdata/stock_render_golden.yaml (bundle-info.yaml, checksums.txt, recipe.yaml per leaf).
  • Testing

    make qualify   # at 14cd67305, with KUBECONFIG and GITLAB_TOKEN unset and bash 5 first on PATH
    

  • qualify_rc=0, "Codebase qualification completed". Lint: 0 issues.

  • Coverage (base 443fe43a7 -> head): validators/conformance 57.1% -> 59.0% (+1.9%); pkg/evidence/cncf 90.6% -> 90.6%; pkg/recipe 90.9% -> 90.9%; pkg/validator/catalog 98.1% -> 98.1%. New functions 92.3%-100% (CheckSlinkySlurmGPUAccess 95.1%).

  • Every pass rule, gate and guard was mutation-checked: each mutant (rule disabled, | sort restored, find guard removed, MIG rule disabled, old skip text restored, && to ||, check unregistered, check dropped from a leaf) fails a named test.

  • Offline probe smoke in the pinned slurmd-pyxis image (Docker; the cgroup v2 device filter is the same BPF mechanism Slurm's cgroup/v2 plugin uses):
  • NODE=slinky-0
    CUDA_VISIBLE_DEVICES=<unset>
    NVSMI_RC=127
    NVSMI_LINE=/p/slinky_slurm_gpu_probe.sh: 4: nvidia-smi: not found
    DEVICES_LISTED=0
    DONE=1
    rc=0
    == case 2: device nodes listed, cgroup denies open
    NODE=slinky-0
    CUDA_VISIBLE_DEVICES=<unset>
    NVSMI_RC=127
    NVSMI_LINE=/p/slinky_slurm_gpu_probe.sh: 4: nvidia-smi: not found
    DEVICES_LISTED=2
    DEV=/dev/nvidia1 1
    DEV=/dev/nvidia0 1
    DONE=1
    rc=0
    == case 3: cgroup allows nvidia0, no driver behind it
    NODE=slinky-0
    CUDA_VISIBLE_DEVICES=<unset>
    NVSMI_RC=127
    NVSMI_LINE=/p/slinky_slurm_gpu_probe.sh: 4: nvidia-smi: not found
    DEVICES_LISTED=2
    DEV=/dev/nvidia1 1
    DEV=/dev/nvidia0 6
    DONE=1
    rc=0
    == case 4: failing find (PATH shim)
    NODE=slinky-0
    CUDA_VISIBLE_DEVICES=<unset>
    NVSMI_RC=127
    NVSMI_LINE=/p/slinky_slurm_gpu_probe.sh: 4: nvidia-smi: not found
    find: shim failure
    PROBE_ERROR=find failed
    rc=1
    

    Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

  • Medium — Touches multiple components or has broader impact

  • High — Breaking change, affects critical paths, or complex rollout
  • Rollout notes: Nothing in CI runs a Slurm recipe on real GPUs (the cloud UAT lanes are kubeflow; the kind Slurm lane has simulated GPUs and no task/cgroup), so this stays draft until one live GPU Slinky run passes. Hypotheses that run must confirm: H1 an unallocated job's GPU minors are listed and open() returns EPERM; H2 a --gpus=1 job opens exactly one minor and nvidia-smi lists one GPU; H3 nvidia-smi resolves with the /usr/local/nvidia fallback on EKS, AKS and GKE COS; H5 SLURMD_NODENAME is set and accepted by --nodelist; H6 --query-gpu=uuid,mig.mode.current prints <uuid>, <mode> (H4, perl in the slurmd image, is confirmed for the pinned digest). A RED live result on some platform (for example AutoDetect=nvidia unable to load NVML inside slurmd, so Slurm never learns which device files to constrain) is a real isolation finding to file, not a reason to weaken the check.

    Checklist

  • Tests pass locally (make test with -race)

  • Linter passes (make lint)

  • I did not skip/disable tests to make CI green

  • I added/updated tests for new functionality

  • I updated docs if user-facing behavior changed

  • Changes follow existing patterns in the codebase

  • Commits are cryptographically signed (git commit -S) — GPG signing info
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: ArangoGutierrez Review duration: 2911m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3057"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository