The training job has finished, and you have a GPU utilization graph. To explain how much Tensor Core throughput the job used, you need two readings per GPU, tensor pipe activity and the streaming multiprocessor (SM) clock. To report Tensor Flop Utilization (TFU) for the job, you also need to know which readings actually paired. A job average can look plausible even when half the allocation disappears from the query.
This tutorial is for an ML infrastructure engineer with read access to historical Prometheus data from DCGM Exporter 4.9.0 or later, a Slurm job ID, and a record of the job’s start, end and GPU allocation. It uses full H100 SXM 80 GB GPUs on one cluster, with one authoritative scrape source per GPU. You’ll get a per-GPU PromQL expression, a recording rule with a separate missing-clock metric, and a test that makes a GPU disappear from TFU while it remains visible in the coverage check. The test and all job values below are illustrative expected observations.
NVIDIA published the method on December 4, 2026. It multiplies the fraction of cycles with tensor pipe activity by the ratio of the observed SM clock to the reference clock. The reference used for H100 SXM 80 GB is 1,830 MHz, or 1.83e9 Hz. NVIDIA’s worked query caps the clock ratio at one. This tutorial uses the same cap. NVIDIA Technical Blog

NVIDIA Technical Blog’s article introducing the Tensor Flop Utilization method.
Match the exporter series to the Slurm allocation
- Pull the start and end from your Slurm accounting record. Use a single time zone for both, preferably UTC. For illustrative job
123456, use December 4, 2026 from10:00:00to10:02:00UTC. Its allocation lists two full H100 SXM 80 GB devices, represented here by the synthetic UUIDsGPU-example-aandGPU-example-b. For a real job use UUIDs from the allocation or your scheduler-to-device mapping record. Node-local GPU indices can repeat on separate hosts, so a list of indices alone can’t verify the allocation. - Open Prometheus’s Table view at an interior time, such as
10:00:30UTC in the example. EvaluateDCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456"}andDCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456"}separately. Compare the UUIDs on both results with the allocation. Check the model and target labels while the full series labels are visible. Choose a historical time before you run either selector. A query evaluated now can come back empty because the job’s labels have already gone stale. Prometheus querying basics - Confirm the effective exporter version and units. On a host with the binary installed,
dcgm-exporter --versionidentifies its version. From that host,curl --fail http://localhost:9400/metricsis NVIDIA’s check for a default local metrics endpoint. Use the existing deployment’s endpoint if it differs. The live endpoint tells you what the exporter emits today. Use historical Prometheus samples to check what it emitted during the completed job. The example clock for GPU A should appear as1464000000in hertz. A reading of1464would fit a megahertz field and warrants checking the actual metric before dividing. NVIDIA exporter installation and verification - Look for one activity and one clock series per
hpc_job, UUIDat each evaluation. The exporter inventory documents upper-caseUUIDby default, lower-caseuuidunder the old namespace setting, andhpc_jobwhen the HPC mapping applies. Compare actual labels before copying the expression. If the job is present only on one field, investigate the scheduler-managed mapping on the affected host. If the deployed collector emits the older names in the inventory, those are a different input path. NVIDIA’s method identifies the legacy clock as MHz with a divisor of1830. The rule and fixture here use the hertz pair. NVIDIA exporter metrics and labels
If you see two rows for the same physical GPU and job, compare their target and entity labels. The cause might be two scrape paths or a mix of full-device and MIG series. Use the authoritative scrape scope on both inputs and stay with full-device series for this example. If this Prometheus queries more than one cluster, scope both sides to the intended cluster first. The job ID should resolve to one allocation in the queried scope. A count of two alone is insufficient if one expected UUID disappeared and a different one took its place.
If the historical query shows A and an unexpected UUID C, inspect the full labels on C at the same instant and compare them against the allocation record before aggregating. The query uses hpc_job to select the allocation, so an incorrectly labeled GPU can still produce a plausible TFU sample. Check the mapping for B and C separately. Keep B in the expected coverage because it was allocated, and exclude C from the reported calculation once you establish it was outside that allocation. Record the actual UUIDs you used so another operator can repeat the check even after the live mapping has changed.
For a separate serving task where the decision depends on request latency at a chosen concurrency, see the NVIDIA NIM benchmarking tutorial. Keep the training job’s measurement tied to its own devices and run window.
Pair activity and clock before averaging
- With the historical instant still selected, paste the expression below.
on (hpc_job, UUID)keeps the two measurements tied to the same job and device.UUID!=""excludes samples without that identity, and the explicit job selector limits the query to the intended allocation. The range comparisons filter each selected gauge before it participates in the multiplication. PromQL vector arithmetic drops unmatched entries. PromQL operators and vector matching - Confirm GPU A’s
0.50 × (1.464 ÷ 1.83) = 0.40. The clock contributes a ratio of0.80, so half the cycles active at that clock gives 40% of the reference rate. At the same activity and the reference clock, the result would be 50%. Keep the recorded value as a fraction and format it as a percent in the panel.clamp_maxapplies the upper bound to the clock ratio. Prometheus query functions - Check the other GPU at
10:01:00UTC. In the example GPU B still reports activity0.60, but its clock becomes stale. Its TFU series should disappear at that instant. Inspect activity and clock individually at that time to distinguish a missing pair from a present activity sample of zero. With zero activity and a valid clock the join yields a real zero, which belongs in the mean.
(
((DCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456",UUID!=""} >= 0) <= 1)
and (time() - timestamp(DCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456",UUID!=""}) < 30)
)
* on (hpc_job, UUID)
clamp_max(
(
(DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID!=""} > 0)
and (time() - timestamp(DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID!=""}) < 30)
) / 1.83e9,
1
)
The 30-second age filter is an explicit policy for this example. A bare instant selector can reuse the previous sample within Prometheus’s lookback period if there is no stale marker. The filter discards any input whose Prometheus sample timestamp is at least 30 seconds old. The standard and on each side retains the original gauge value where its corresponding age check returns a series. This check bounds sample age at evaluation time. It still allows the two samples to be taken at different times within the same 30-second period. The exporter can serve a cached DCGM reading, so a recent Prometheus sample timestamp gives you the age of the stored sample, with DCGM collection cadence still to check separately. NVIDIA recommends collecting and scraping every 30 seconds or faster for TFU. If a healthy scrape occasionally arrives too late for the chosen evaluation schedule, inspect the timestamps and cadence before treating apparent gaps as job behavior. NVIDIA exporter collection cadence · Prometheus lookback and staleness
For example, if a clock was last stored at 10:00:30 and there is no stale marker, the raw selector may still show that value at 10:01:00. At that instant time() - timestamp(...) is exactly 30 seconds, so the strict age check drops the clock. If the selector itself is empty, the timestamp query is empty as well. These two observations point to different things to inspect. In the first case, check why there was no more recent stored reading. In the second, check whether the clock was marked stale, never appeared under that job label or has aged out of lookback. Prometheus query functions · Prometheus querying basics
PromQL’s one-to-one arithmetic join produces TFU for eligible pairs. The separate unless check retains activity-side UUIDs that lack an eligible clock.
Test the recording rule with a stale clock
- In a scratch directory, save the first block as
h100-tfu.rules.ymland the second ash100-tfu.test.yml. The rule is scoped to job123456so a fixed H100 SXM reference cannot accidentally be applied to every GPU on the server. It records one TFU value per matched UUID and a1per UUID with eligible activity but no eligible clock. The missing-clock series is sparse. A blank result means the check found no activity-side orphan at that instant. Compare TFU counts with the allocation to catch GPUs missing on both sides. - From that directory, run the two
promtoolcommands after the blocks. The first checks the recording rule file. The second loads it and asserts the values and label sets at30sand1m, then checks the aggregate at2m. The test uses a 30-second interval andstalefor GPU B’s clock at1m. The clock’s later_entries add no samples.fuzzy_compareaccounts for last-bit floating-point differences when comparing the expected fraction. Prometheus rule test format - To verify the test catches the change it describes, temporarily replace
stalewith1830000000and rerun the test. At1mthe expected failure is an extra TFU series for GPU B and the disappearance of its expected missing-clock flag. Restore the file and rerun. This failure probe changes only synthetic data.
# h100-tfu.rules.yml
groups:
- name: h100-tfu-job-123456
interval: 30s
rules:
- record: h100_job_gpu:tfu:ratio
expr: |
(
((DCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456",UUID!=""} >= 0) <= 1)
and (time() - timestamp(DCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456",UUID!=""}) < 30)
)
* on (hpc_job, UUID)
clamp_max(
(
(DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID!=""} > 0)
and (time() - timestamp(DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID!=""}) < 30)
) / 1.83e9,
1
)
- record: h100_job_gpu:tfu_missing_clock:flag
expr: |
group by (hpc_job, UUID) (
(
((DCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456",UUID!=""} >= 0) <= 1)
and (time() - timestamp(DCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456",UUID!=""}) < 30)
)
unless on (hpc_job, UUID)
(
(DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID!=""} > 0)
and (time() - timestamp(DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID!=""}) < 30)
)
)
# h100-tfu.test.yml
rule_files:
- h100-tfu.rules.yml
evaluation_interval: 30s
fuzzy_compare: true
tests:
- name: job-123456-clock-becomes-stale
interval: 30s
input_series:
- series: 'DCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456",UUID="GPU-example-a"}'
values: '0.5x4'
- series: 'DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID="GPU-example-a"}'
values: '1464000000x4'
- series: 'DCGM_FI_PROF_TENSOR_UTIL_RATIO{hpc_job="123456",UUID="GPU-example-b"}'
values: '0.6x4'
- series: 'DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID="GPU-example-b"}'
values: '1830000000 1830000000 stale _ _'
promql_expr_test:
- expr: h100_job_gpu:tfu:ratio{hpc_job="123456"}
eval_time: 30s
exp_samples:
- labels: 'h100_job_gpu:tfu:ratio{hpc_job="123456",UUID="GPU-example-a"}'
value: 0.4
- labels: 'h100_job_gpu:tfu:ratio{hpc_job="123456",UUID="GPU-example-b"}'
value: 0.6
- expr: h100_job_gpu:tfu_missing_clock:flag{hpc_job="123456"}
eval_time: 30s
exp_samples: []
- expr: h100_job_gpu:tfu:ratio{hpc_job="123456"}
eval_time: 1m
exp_samples:
- labels: 'h100_job_gpu:tfu:ratio{hpc_job="123456",UUID="GPU-example-a"}'
value: 0.4
- expr: h100_job_gpu:tfu_missing_clock:flag{hpc_job="123456"}
eval_time: 1m
exp_samples:
- labels: 'h100_job_gpu:tfu_missing_clock:flag{hpc_job="123456",UUID="GPU-example-b"}'
value: 1
- expr: sum(sum_over_time(h100_job_gpu:tfu:ratio{hpc_job="123456"}[2m])) / sum(count_over_time(h100_job_gpu:tfu:ratio{hpc_job="123456"}[2m]))
eval_time: 2m
exp_samples:
- labels: '{}'
value: 0.44
- expr: sum(count_over_time(h100_job_gpu:tfu:ratio{hpc_job="123456"}[2m]))
eval_time: 2m
exp_samples:
- labels: '{}'
value: 5
promtool check rules h100-tfu.rules.yml
promtool test rules h100-tfu.test.yml
The first command should exit with status zero and print the parsed-rule check. A syntax error produces a diagnostic and status one. A successful second command means the tested rule produced the expected samples, including the empty flag vector in the healthy case. If the syntax check passes but the fixture fails, start by comparing expected and returned labels and evaluation times. A renamed UUID or a clock selector returning MHz can change the test result even when the expression parses. Keep the first two assertions at 30s so the fixture establishes that both devices can pair before testing the interruption. Prometheus recording rule syntax and checks
The repeated sample notation includes the initial point. For GPU A, 0.5x4 supplies activity at 0s, 30s, 60s, 90s and 120s. GPU B’s clock list starts with two valid points at 0s and 30s. A failure at 30s therefore points to the healthy baseline, before the fixture introduces the interruption. If the two per-device assertions pass but the end-of-window count fails, check the evaluation interval and range bounds first. A count that includes 0s is counting outside the fixture’s reporting window. Prometheus rule test format · Prometheus querying basics
| Input | Action | Expected result |
|---|---|---|
task:slurm-tfu-123456, GPU A at 30s, activity 0.50, clock 1464000000 Hz |
Run promtool test rules h100-tfu.test.yml with both files in the same directory |
Illustrative GPU A’s h100_job_gpu:tfu:ratio sample is 0.40 at 30s. GPU B has a separate 0.60 sample. |
task:slurm-tfu-123456, GPU B at 1m, activity 0.60, clock marked stale |
Run promtool test rules h100-tfu.test.yml and check the two assertions at 1m |
Illustrative GPU A still returns 0.40. GPU B is absent from TFU and has h100_job_gpu:tfu_missing_clock:flag equal to 1. |
task:slurm-tfu-123456, two GPUs and four eligible evaluation times through 2m |
Run promtool test rules h100-tfu.test.yml and use the count and mean assertions at 2m |
Illustrative result of 0.44 mean TFU over five observed pairs. The allocation implies eight slots, so coverage is 5 / 8. |
The fixture uses the same rule timestamps on every run so you can reproduce the gap deliberately. In a live development server, the rule group also runs at regular intervals, but scrape availability and rule evaluation each have their own timing. If adding the file for a comparable run, have the Prometheus operator append its path to the existing rule_files sequence and reload the process with SIGHUP. Preserve the existing configuration and panel query together so the reversal is one coherent change. For a fixed-ID test, use the exact ID of the run you intend to record and update it throughout the rule. Prometheus recording rule configuration
Read the completed job over its actual window
- Use the raw pair expression for a run that finished before the rule was installed. In a Prometheus range query, evaluate it from
10:00:30through10:02:00UTC at a 30-second step for this example. Read the series by UUID and count the returned points. Prometheus evaluates the same instant expression at every step. The first evaluation is one step after the start so the 30-second freshness check won’t admit a pre-start Prometheus sample. For a longer run, use its actual start and end and keep the step fixed. If the last full step falls before job end, report that partial interval and your chosen grid. DCGM’s own collection window can still straddle a job boundary. Prometheus instant and range evaluation - If the rule was active for the job, use the instant queries below at the actual end. Substitute the actual elapsed duration for
2m. A range selector includes the end and excludes the start, so the recorded example counts the evaluations at30s,60s,90sand120s. Use the rule’s evaluation schedule for the coverage denominator. If the rule started late, the missing early slots still belong in the expected coverage for the job. - Compare UUIDs and per-GPU counts with that denominator before reading the aggregate. In this example the counts are four for A and one for B. For the raw historical path the calculation is the same on the returned points. Add four
0.40values and one0.60value, then divide2.20by5. The illustrative observed-pair mean is0.44. Coverage is5 / 8, or62.5%, and the samples missed on B span three consecutive slots. Record the mean as partial and withhold it as a whole-job comparison point.
count_over_time(h100_job_gpu:tfu:ratio{hpc_job="123456"}[2m])
sum(count_over_time(h100_job_gpu:tfu:ratio{hpc_job="123456"}[2m]))
sum(sum_over_time(h100_job_gpu:tfu:ratio{hpc_job="123456"}[2m]))
/
sum(count_over_time(h100_job_gpu:tfu:ratio{hpc_job="123456"}[2m]))
The sum divided by the count weights every returned GPU observation equally. Averaging each instant across GPUs first and then taking the mean of those instants would give 0.425 in the same example. That calculation gives the instant with two GPUs the same weight as each instant with one. If you compare reports, record the weighting along with the numerator, denominator and sampling interval so two people can reproduce the same number. Prometheus over-time functions
Illustrative paired sample coverage for job 123456. GPU B contributes one of four expected samples. The bars measure coverage, while the TFU mean uses the five observed pairs. Method context comes from NVIDIA’s December 4, 2026 article.
A GPU with no recorded pairs in the window may be absent from the per-GPU count result. Read the result against the allocation list. For example, if only A appears with 4, write down A 4/4 and B 0/4 for an overall 4/8. Here 0/4 describes coverage. GPU B’s utilization is unknown for that window. If neither GPU appears, the paired-sample query may be empty and the observed mean is unavailable. Check the allocation and the raw selectors at an interior time before investigating the dashboard formatting. Prometheus querying basics · Prometheus over-time functions
If you display this in Grafana, first reproduce the bounded query result before wiring the number into a panel. For adjacent dashboard work, see how to inspect a Grafana dashboard and verify a bounded query. The same distinction between missing rows and zeros comes up when checking SQL joins in Datasette Lite. Keep the allocation and evaluation window beside the query output so they can travel with the result, a practice covered more broadly in the AgentOps guide.
Trace gaps and decide whether to keep the panel
| Observation | Where to look | Decision |
|---|---|---|
Activity is present and the missing-clock flag is 1 |
Inspect the raw hertz clock and its timestamp() at the affected instant. Check the field selection and scrape scope for that host. |
Mark the pair unavailable and keep the other valid observations. |
| Both inputs are missing for an allocated UUID | Inspect the device’s target and its workload mapping during the job window. Compare with other UUIDs from the same host. | Keep the device in expected coverage. Its absence alone cannot produce a missing-clock flag. |
| The multiplication reports a vector matching error | Run count by (hpc_job, UUID) (DCGM_FI_DEV_SM_CLOCK_HERTZ{hpc_job="123456",UUID!=""}) and the equivalent count on the activity selector. Inspect counts above one. |
Choose the authoritative series on each side before recomputing. |
| Recorded values are missing where raw pairs exist | Check the rule’s load time, errors and evaluation gaps. Prometheus can skip an iteration when the previous one is still running. | Use the historical raw expression for the affected window and document the evaluation grid. |
A suspicious value can also survive a successful join. For example, a clock ratio near one across every interval could reflect an actual clock or simply the cap hiding a bad input. Inspect the raw hertz series before accepting the clipped result. If a whole host vanishes at once, inspect whether both metrics disappeared together before spending time on individual GPU settings. If the exporter continues emitting the fields but the job label is absent, search the same historical window using the known UUID and return to the mapping problem. A query that substitutes zero for lost telemetry makes all three causes harder to distinguish.
For a controlled training comparison, record steady-state tokens per second or step time alongside TFU. Use the same model, batch and sequence settings where those are outside the change being tested. For example, suppose a baseline processes 10,000 tokens per second at 40% TFU and a candidate processes 9,800 at 44%, both with comparable coverage and the same amount of training work per step. The candidate is 2% slower in this illustrative comparison. Investigate the extra work before adopting it for speed. NVIDIA notes that padding and activation recomputation can increase measured Tensor Core work. Use throughput and the run’s quality checks to judge a precision or workload change. NVIDIA’s interpretation guidance
For job 123456, a report can say that the observed pairs averaged 44% TFU over 10:00:00 to 10:02:00 UTC, with five of eight expected pairs at 30-second resolution. Give GPU B’s three consecutive missing-clock slots alongside that number. This lets the training team see that the mean leans heavily on GPU A and that the gap occurred in one stretch. If the next job has full coverage, keep the original 44% as a partial observation and use comparable training throughput to judge the change. If the clock history is gone, the fixture can establish how the rule behaves, but recovering the job’s missing measurement requires actual retained telemetry.
If you decide to withdraw the panel, restore its previous query or remove the new panel, remove the added rule_files entry and reload the previous Prometheus configuration via the managed deployment or SIGHUP for a directly managed process. Check that the rule group is gone from the active configuration and that the raw activity and clock queries still return their retained history for the affected run. Historical recording samples can still exist, so use the active rule configuration to verify the reversal. Save the affected UUID, evaluation time and raw selectors with the investigation. For another example of checking chart output against the rows it summarizes, see Verify Datasette Charts Against the SQL Behind Them.
Sources
- NVIDIA Technical Blog, Measure GPU Compute Efficiency at Scale with NVIDIA Tensor Flop Utilization
- NVIDIA, Install DCGM Exporter
- NVIDIA, DCGM Exporter Metrics
- Prometheus, Defining recording rules
- Prometheus, Unit testing for rules
- Prometheus, Operators
- Prometheus, Querying basics
- Prometheus, Query functions

