classify_workload
Identify whether a GPU is actually training, inferencing, or idle from telemetry alone, catching misreported or unauthorized workloads.
Instructions
Classify what a GPU is actually doing right now (TRAINING, INFERENCE, or IDLE) from raw telemetry alone -- utilization, memory-growth slope, and power draw -- with no reliance on a job's self-reported label and no inspection of its code, weights, or data.
Call this to catch cost misallocation (a job billed as low-priority "inference" that is really running full training) or an unauthorized workload change (an inference endpoint that quietly starts training on live traffic). Do not call it for compliance/regulatory reporting -- no such requirement exists for this signal, see the README's "What WorkloadTruth is not" section.
Prerequisites: backend="nvml" (the default) requires an NVIDIA GPU
and driver on the host running this MCP server, plus the mcp+nvml
extras (pip install "workloadtruth-cli[mcp,nvml]"). backend= "synthetic" needs neither a GPU nor extra driver setup -- it replays
a documented synthetic trace selected by profile, so use it to test
agent integrations or CI without hardware.
Side effects: read-only and safe to call repeatedly by default. It
blocks for roughly samples * interval_seconds seconds while it
collects telemetry (defaults: 10 x 1.0s = 10s), then returns. No
network calls are made, ever. Setting write_to_audit_log=True is
the one mutating path: it appends one hash-chained line to the local
workloadtruth.log.jsonl file (each call adds a new entry, so this
is not idempotent) -- everything else about the call is idempotent.
If backend="nvml" is requested with no NVIDIA GPU/driver present,
the call raises rather than returning a fabricated result.
Parameters: backend -- "nvml" or "synthetic". profile -- one of
"training"/"inference"/"idle", synthetic backend only. gpu_index
-- which GPU to sample, 0-indexed, ignored for synthetic. samples
-- telemetry samples to collect. interval_seconds -- delay between
samples. write_to_audit_log -- append the result to the hash chain.
Example calls: {"backend": "synthetic", "profile": "training", "samples": 10, "interval_seconds": 0} to try it with no GPU;
{"backend": "nvml", "samples": 20, "interval_seconds": 1.0, "write_to_audit_log": true} for a real 20s hardware sample that
also logs the result.
Returns a dict with workload_type ("TRAINING"/"INFERENCE"/"IDLE"),
confidence (0-1), gpu_index, window_seconds, sample_count,
reasons (the specific thresholds that fired, e.g. "avg GPU
utilization 82.3% >= 65.0% training threshold"), and features
(the raw avg/std utilization, memory-growth, and power numbers the
decision was based on -- nothing here is a black box).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| backend | No | nvml | |
| profile | No | training | |
| samples | No | ||
| gpu_index | No | ||
| interval_seconds | No | ||
| write_to_audit_log | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||