Skip to content

fix: fold DP_SIZE into single-node num_gpus for per-GPU throughput - #2715

Open
aistackdev wants to merge 1 commit into
SemiAnalysisAI:mainfrom
aistackdev:fix/dp-size-num-gpus
Open

fix: fold DP_SIZE into single-node num_gpus for per-GPU throughput#2715
aistackdev wants to merge 1 commit into
SemiAnalysisAI:mainfrom
aistackdev:fix/dp-size-num-gpus

Conversation

@aistackdev

@aistackdev aistackdev commented Aug 24, 2026

Copy link
Copy Markdown

Summary

Fixes #2714.

process_result.py's single-node branch computes:

num_gpus = tp_size * pp * pcp_size

with no data-parallel term. Any single-node config running
--tensor-parallel-size 1 --data-parallel-size N (N full-model
replicas on N GPUs) without also exporting that as TP/PP/PCP_SIZE
divides total_token_throughput by 1 instead of N, inflating
tput_per_gpu / output_tput_per_gpu / input_tput_per_gpu by a
factor of N.

Fix

Read an optional DP_SIZE env var (defaults to "1", so every
existing single-node config is unaffected) and fold it into
num_gpus = tp_size * pp * pcp_size * dp_size. Also record dp_size
in the output JSON alongside the existing pp/dcp_size/pcp_size
fields, for parity with how the other parallelism dimensions are
surfaced.

Test plan

  • Added test_throughput_per_gpu_single_node_default_dp_size
    confirms DP_SIZE unset behaves exactly as before (dp_size == 1).
  • Added test_throughput_per_gpu_single_node_with_dp_size — confirms
    DP_SIZE=2 halves tput_per_gpu/output_tput_per_gpu/input_tput_per_gpu.
  • Added test_invalid_dp_size_raises_errorDP_SIZE=0 fails loud,
    matching the existing PP_SIZE/DCP_SIZE/PCP_SIZE validation.
  • python -m pytest utils/test_process_result.py — 53 passed (50
    existing + 3 new), no regressions.

Recipes that run internal --data-parallel-size N today keep N as a
script-local constant not exported to process_result.py; wiring
DP_SIZE=N through for those recipes is a separate follow-up once
this lands.


Note

Low Risk
Narrow result-aggregation math change with a default of 1, so existing runs are unchanged unless DP_SIZE is set. Does not touch auth, serving, or recipe wiring.

Overview
Fixes inflated single-node tput_per_gpu (and related per-GPU metrics) when data-parallel replicas are used without encoding that width in TP/PP/PCP_SIZE.

The single-node path now reads optional DP_SIZE (default 1), multiplies it into num_gpus, validates it as a positive integer, and emits dp_size in the aggregated JSON. Existing configs that omit the env var keep the previous denominator. Recipes still need to export DP_SIZE for this to take effect.

Reviewed by Cursor Bugbot for commit c07cfda. Bugbot is set up for automated code reviews on this repo. Configure here.

process_result.py's single-node branch computed num_gpus as
tp_size * pp * pcp_size, with no data-parallel term. Any single-node
config running --data-parallel-size N without exporting that as TP/PP/
PCP_SIZE (e.g. tensor-parallel-size 1 + data-parallel-size 2, N full
replicas on N GPUs) divided total_token_throughput by 1 instead of N,
inflating tput_per_gpu / output_tput_per_gpu / input_tput_per_gpu by a
factor of N.

Read an optional DP_SIZE env var (defaults to 1, so existing configs
are unaffected) and fold it into num_gpus. Also record dp_size in the
output JSON alongside the existing pp/dcp_size/pcp_size fields.

Fixes SemiAnalysisAI#2714

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Single-node num_gpus ignores --data-parallel-size, inflating tput_per_gpu

1 participant