Skip to content

Show every job in dstack metrics - #4108

Open
peterschmidt85 wants to merge 1 commit into
masterfrom
metrics-all-jobs
Open

Show every job in dstack metrics#4108
peterschmidt85 wants to merge 1 commit into
masterfrom
metrics-all-jobs

Conversation

@peterschmidt85

@peterschmidt85 peterschmidt85 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Reverses the single-job part of #4086. Metrics are most useful when replicas can be compared, and that meant running the command once per replica and remembering the numbers.

A task with one job:

$ dstack metrics llama-70b-sft

               UTILIZATION                       MEMORY
 job=0  cpu    ▁▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▂▂▂▂▂▂▂▂▂ 33%  ▃▃▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ 579GB/960GB
        gpu=0  ▁▃▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▁▆▆▆▆▆▆▆▆▆ 93%  ▄▅▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 71GB/80GB
        gpu=1  ▂▄▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▁▆▆▆▆▆▆▆▆▆▆ 93%  ▄▅▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 71GB/80GB
        gpu=2  ▃▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▁▆▆▆▆▆▆▆▆▆▆ 93%  ▄▅▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 71GB/80GB
        gpu=3  ▄▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▁▆▆▆▆▆▆▆▆▆▆▆ 93%  ▄▅▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆▆ 71GB/80GB

               6 Aug 17:13 ┄┄┄┄┄┄┄┄┄┄┄┄ now      6 Aug 17:13 ┄┄┄┄┄┄┄┄┄┄┄┄ now

A service with three replicas, one of them idle:

$ dstack metrics vllm-qwen

                         UTILIZATION                  MEMORY
 replica=0 job=0  cpu    ▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ 20%  ▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ 85GB/440GB
                  gpu=0  ▄▄▃▃▃▃▃▃▃▃▄▄▅▅▅▅▅▅▅▄▄▄▄ 51%  ▃▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅ 60GB/80GB

 replica=1 job=0  cpu    ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ 6%   ▁▁▁▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▁▁▁ 73GB/440GB
                  gpu=0  ▂▂▁▁▁▁▁▁▁▁▂▂▂▂▃▃▃▃▃▂▂▁▁ 14%  ▃▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅ 60GB/80GB

 replica=2 job=0  cpu    ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ 1%   ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ 61GB/440GB
                  gpu=0  ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ 2%   ▃▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅ 60GB/80GB

                         6 Aug 17:11 ┄┄┄┄┄┄┄ now      6 Aug 17:11 ┄┄┄┄┄┄┄ now
  • The job column follows dstack ps: replica=/group= appear only where they distinguish something, so a single-job run is just job=0. --replica/--job narrow to one.

🤖 Generated with Claude Code

#4086 narrowed the command to one job, on the grounds that the endpoint is
per-job and `dstack logs` reads the same way. That was the wrong call for
this command: metrics are most useful when replicas can be compared, and
comparing them meant running the command once per replica and holding the
numbers in your head.

Every job is shown again, keyed by a `replica=`/`job=` column that follows
`dstack ps` -- named only where it distinguishes something, so a
single-job run is just `job=0` and one replica across four nodes is
`job=0..3`. `--replica` and `--job` narrow it to one rather than select
the only one shown.

All jobs share a single time axis, fixed to the hour the server retains
rather than fitted to the data. A row then means the same thing in every
invocation, and a replica that started two minutes ago fills two minutes
of it with the rest left blank -- which is the fact worth seeing about it.

Drops the core count from the CPU number: the value is already normalised
to it, and unlike memory there is no total to give it meaning. Drops the
blank row between `cpu` and the devices.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant