Repository navigation
Conversation
This was referenced Oct 15, 2026
scttfrdmn
force-pushed
the
fix/948
branch
2 times, most recently
from
October 17, 2026 01:39
041810e to
15f64a7
Compare
…and AMD (#954) getGPUUtilization returned 0, a measured "GPU idle", when nvidia-smi was present but failed, and when every line was [N/A]/[Not Supported]. Neuron, Gaudi and AMD accelerators were never looked at. - accel.go (untagged, tested everywhere): gpuUtilization returns (pct, measured, why) like the counters. Unknown is assumed active and warned once per accelerator family. A busy device decides "active" even beside an unreadable one; otherwise any unreadable one is unknown. No accelerator is a measured 0. - Presence is structural, not "is the tool on PATH": GPUs and Gaudi by PCI vendor (0x10de/0x1002 in a display class, 0x1da3) from /sys/bus/pci/devices, Neuron by /dev/neuronN (Annapurna's PCI vendor is also ENA's and EBS NVMe's). A DLAMI on a GPU-less instance has nvidia-smi but no GPU, and keying on the tool would make it unknown for ever. Windows: nvidia-smi present means NVIDIA (no /sys there). - Measurement: nvidia-smi and hl-smi CSV, rocm-smi --showuse --json, neuron-monitor's first streamed report (killed after one line). Only a successful parse of real numbers can read as idle; an empty neuron_runtime_data list is a measured idle (cores are only usable through a runtime, and neuron-monitor reports every runtime). - Removed three monitoring_test.go GPU tests that re-implemented the parsing inline and asserted it, including "Empty output -> 0". (#954)
commented
Oct 17, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Fixes #954. Stacked on #977 (fix/948) → #969 → #960 → #955 → #936. The base is
fix/948, so the diff shows only #954.What was wrong
getGPUUtilizationreturned 0, which the idle check reads as a measured "GPU idle", in three cases:nvidia-smiis present but failing: driver/kernel mismatch, "No devices were found", or a GPU that has fallen off the bus.[N/A]or[Not Supported].nvidia-smiis absent, which is correct only when there is no NVIDIA GPU.Trainium/Inferentia, Gaudi and AMD accelerators were never checked, so a device-bound job with little host CPU could be idle-stopped.
What changed (
pkg/agent/accel.go, untagged)gpuUtilization() (pct, measured, why)uses the same semantics ascpuUsage/networkBytes/diskIOBytes. Unknown means assume active, with one warning per accelerator family saying idle-stop will not trigger. A busy device decides "active" even next to an unreadable one. Otherwise any unreadable device makes the reading unknown. No accelerator at all is a measured 0.idleDecisionlogsNot idle: accelerator utilization could not be measured (<why>); assuming active.nvidia-smion GPU-less instances, where it can only fail, so keying on the tool would disable idle-stop there./sys/bus/pci/devices/*/{vendor,class}: NVIDIA0x10deand AMD0x1002in a display class (0x03xxxx), and Habana0x1da3./dev/neuronN. The Annapurna PCI vendor0x1d0fis also used by ENA and the EBS NVMe controller, and the fixture includes both./sys), the presence ofnvidia-smimeans NVIDIA.nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounitshl-smi -Q utilization.aip -f csv,noheader,nounits(a%suffix is tolerated)rocm-smi --showuse --json(card*→"GPU use (%)")neuron-monitor: the first streamed JSON report, after which the process is killed. The value is the max ofneuron_runtime_data[].report.neuroncore_counters.neuroncores_in_use.*.neuroncore_utilization. An emptyneuron_runtime_datais a measured idle, because NeuronCores are only usable through a runtime and neuron-monitor reports every runtime. A missing list, a runtime/counter error, or a missing utilisation is unknown.<family> device present but <tool> is not installed).monitoring_test.goGPU tests. They re-implemented the parsing inline and asserted it, including"Empty output" → 0.0, which was the bug (rule 5).Tests (
pkg/agent/accel_test.go)Detection fixtures cover a plain instance (ENA, EBS NVMe, an AMD EPYC host bridge, Nitro VGA), g4dn T4, g4ad V520, dl1 Gaudi, trn1
/dev/neuron0,neuron/neuronxnames that are not device nodes, and an NVIDIA audio function. There are parser tables for all four tools. The other tests are:idleDecisionstays not idle whennvidia-smifails;neuron-monitoron PATH returns its first line and is killed.I checked the
/sys/bus/pci/devicesvendor/class format in an AL2023 container (0x1af4 0x020000).Revert checks. Each revert compiled, and the test ran and failed:
ParsePercentLines(4 cases),ParseRocmSmiJSON,ParseNeuronMonitorFailingToolIsUnknownAndWarnedOnce,IdleDecision_UnmeasurableAcceleratorIsNotIdleDeviceWithoutToolIsUnknownFailingToolIsUnknownAndWarnedOnceDetectAccelerators_ByStructure/NVIDIA audio function is not a GPUgo test -race ./pkg/agentpasses, and the wholepkg/agentsuite passes on Linux (an arm64 test binary run in AL2023).make checkpasses except for the known Docker-only test, andmake check-nestedpasses (9/9). Every test run used the credential-stripping environment from #968.Caveats (read these before the demo)
neuroncore_counterspath. It should be checked on a trn1/inf2 before relying on idle-stop there. Gaudihl-smi -Q utilization.aipandrocm-smi --showuse --jsonshould be checked the same way.neuron-monitorprints its first report after one period, 5 s by default, so on Neuron hosts the tick takes about 5 s longer. The tool runs only when every earlier idle check has passed.amd-smi(the successor torocm-smi) is not used. With onlyamd-smiinstalled, an AMD GPU is unknown.GetGPUStatsis still NVIDIA-only and unchanged.