Skip to content

fix(rdc): report every GPU in job statistics - #14043

Open
adam360x wants to merge 1 commit into
developfrom
users/adam360x/rdc-job-stats-all-gpus
Open

adam360x wants to merge 1 commit into
developfrom
users/adam360x/rdc-job-stats-all-gpus

Conversation

@adam360x

@adam360x adam360x commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #14041 as a draft: it shows only its own commit. When #14041 merges, this PR moves to develop, where RDC CI runs, and becomes ready for review.

Motivation

rdc_job_get_stats() returned from inside its per-GPU loop, so only the GPU with the lowest ID was summarized and the other GPUs' entries were not filled in. It wrote each GPU's entry at gpus[gpu_id], past the 16-entry array for a GPU ID above 15 or a partition entity, which crashed rdcd.

Technical Details

  • Fill gpus[0] to gpus[num_gpus - 1], ordered by GPU ID, after zeroing the output and marking every statistic as without samples. Average each summary statistic over the GPUs that have samples for it (the PCIe total had no averaging step).
  • rdc_job_start_stats() rejects a group of more than RDC_MAX_NUM_GPUS_PER_JOB GPUs with RDC_ST_MAX_LIMIT, and rdc_job_get_stats() checks the same bound before it fills anything.
  • A GPU without a total memory reading, such as a partition, reports memory utilization as unavailable instead of failing the call. The memory utilization divisor is no longer truncated to 32 bits, which inflated it on GPUs with 400 GiB of memory or more.
  • rdci stats -j labels each GPU by its ID. A statistic without samples prints as N/A (null in JSON) instead of zeros and a minimum of 18446744073709551615.

Issue Tracking

ISSUE ID : #14107

Part of a series of RDC fixes, which #14107 lists. No JIRA ticket.

Test Plan

test_fake_gpu_job_stats.py runs jobs against the fake amd-smi on GPUs 1 and 3, on GPUs 51 to 66, on a partition alone and with a GPU, and on 17 GPUs, and reads each job while it runs and after it stops.

Test Result

Fake-GPU suite: 110 passed, 24 skipped. tests/ci: 92 passed, 6 skipped.

Submission Checklist

rdc_job_get_stats() returned from inside its per-GPU loop, so only the
GPU with the lowest ID was summarized, and the entries of the other
GPUs were not filled in. It also wrote each GPU's entry at
gpus[gpu_id], past the 16-entry array for a GPU ID above 15 or a
partition entity, which crashed rdcd.

Fill gpus[0] to gpus[num_gpus - 1], ordered by gpu_id, after zeroing
the output and marking every statistic as without samples. Average
each summary statistic after the loop over the GPUs that have samples
for it; the PCIe total had no averaging step. rdc_job_start_stats()
rejects a group of more than RDC_MAX_NUM_GPUS_PER_JOB GPUs with
RDC_ST_MAX_LIMIT, and rdc_job_get_stats() checks the same bound before
it fills anything.

A GPU without a total memory reading, such as a partition, reports
memory utilization as unavailable instead of failing the call. The
divisor for memory utilization, 1% of the total memory, was truncated
to 32 bits, which inflated it on GPUs with 400 GiB of memory or more.

rdci stats -j labels each GPU by its ID instead of its position. A
statistic without samples prints as N/A, and as null values in JSON,
instead of zeros and a minimum of 18446744073709551615.
entity_to_string() moves to RdciSubSystem.cc, shared by the dmon and
stats subsystems.

test_fake_gpu_job_stats.py runs jobs on GPUs 1 and 3, on GPUs 51 to
66, on a partition alone and with a GPU, and on 17 GPUs against the
fake amd-smi, and reads each job while it runs and after it stops.

Signed-off-by: Adam360x <Adam.pryor@amd.com>
@adam360x

Copy link
Copy Markdown
Contributor Author

Reviewed, this one looks good

@adam360x
adam360x marked this pull request as ready for review October 23, 2026 15:48
@adam360x
adam360x requested review from a team as code owners October 23, 2026 15:48
Base automatically changed from users/adam360x/rdc-fake-gpu-tests to develop November 5, 2026 16:51
@therock-pr-bot

therock-pr-bot Bot commented Nov 5, 2026

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant