Skip to content

Padding choice: per compute capability thresholds, RTX PRO 6000 / RTX 5090 peaks - #15216

Merged
danielhanchen merged 1 commit into
mainfrom
padcal-h100-sm120
Oct 25, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
padcal-h100-sm120

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Follow-up to #15185. Its padded-vs-padding-free rule was calibrated on A100, L4 and T4 only, with one threshold of 0.10 s of estimated GPU work per padded micro batch.

On faster GPUs that threshold picks losing cells:

  • H100 / B200: their larger datasheet peaks make the estimate smaller, so the rule switches cells nobody measured. On B200 that includes Qwen3-4B Alpaca bs 8, which lost 18-44% on every GPU measured.
  • RTX PRO 6000: measured on Colab G4. Adding its peak with the same 0.10 s threshold would pick a cell that loses 29%.

Change

  • padding_choice.py, per compute capability thresholds: used only where measured.

    • sm75 / sm80 / sm89 (T4 / A100 / L4): 0.10 s, decisions unchanged (a test checks every measured cell).
    • sm120 (RTX PRO 6000 Blackwell): 0.06 s.
    • Every other capability returns padding-free with reason smXY not measured, the behaviour before SFT: pick padded batches + block compile over padding-free when micro batches are host bound #15185. That includes H100 / H200 (sm90), B200 / B300 (sm100 / sm103) and sm86.
    • choose_padding(..., capability = None) keeps the old single threshold for callers that pass no capability; _decide passes the device's.
  • mfu.py, new dense 16-bit peaks: these also give MFU logging a peak on these GPUs.

    name key TFLOPs source
    RTX PRO 6000 BLACKWELL MAX-Q 438.9 RTX PRO Blackwell whitepaper v1.1, Table 4
    RTX PRO 6000 BLACKWELL SERVER 500.0 Server Edition page, sparse figure halved like the B200 entries
    RTX PRO 6000 BLACKWELL 503.8 same whitepaper, Table 4
    RTX 5090 209.5 RTX Blackwell whitepaper v1.1, Table 3 (FP32 accumulate at half rate on GeForce)

    RTX 5090 D and the laptop part map to unknown. Every new key needs "PRO", so "RTX 6000 Ada" and "Quadro RTX 6000" cannot match. A test checks that no key is shadowed by an earlier one.

Results

Method: Colab G4 ("NVIDIA RTX PRO 6000 Blackwell Server Edition"), using the #15185 method:

  • Qwen3 0.6B / 4B, LoRA r16, 16 and 4 bit;
  • Alpaca at bs 2 / 8 / 16, and 1-4k token documents at bs 2 / 8;
  • 3 rotated reps, every run a fresh process with fresh compile caches;
  • steady-state real tokens/s.

Padded vs padding-free, % (A/A band in brackets):

torch model alp b2 alp b8 alp b16 long b2 long b8
2.14.1 0.6B 16b +5.4 (3.8) +5.4 (32.2) -29.2 (1.1) -14.5 -37.0
2.14.1 0.6B 4b +6.9 (5.3) +5.1 (25.4) -23.7 (2.3) -14.0 -37.1
2.14.1 4B 16b +5.2 (4.0) -39.6 -53.6 -15.2 -35.2
2.14.1 4B 4b +7.2 (3.8) -38.3 -53.0 -15.2 -35.0
2.10.0 0.6B 16b +23.6 (5.8) +64.5 (15.2) +59.6 (2.8) -4.9 -16.5
2.10.0 0.6B 4b +21.5 (1.7) +55.9 (16.6) +63.2 (1.1) -4.8 -16.6
2.10.0 4B 16b +24.1 (3.6) -19.3 -40.3 -12.5 -25.4
2.10.0 4B 4b +14.8 (4.5) -18.1 -39.8 -12.4 -25.4

What the rule picks:

  • This PR: on G4 it picks only 0.6B Alpaca bs 2 / 8 and 4B Alpaca bs 2 (estimates 6-45 ms). Those win on both torch versions, and none loses beyond its A/A band.
  • The old 0.10 s threshold: would also pick 0.6B Alpaca bs 16 (estimate ~92 ms), which loses 29% (16-bit) and 24% (4-bit) on torch 2.14.1.

Memory and loss: in the picked cells, padded uses 0.02-0.33 GB more peak memory, the same order as the cells #15185 already picks. Per-step loss differences stay at or below 0.01.

Tests

New CPU tests in tests/test_padding_choice.py and tests/test_mfu_logging.py:

  • every G4 cell against the Server, Workstation and Max-Q peaks, so no losing cell is picked;
  • a guard that the old threshold would pick the losing cell;
  • T4 / A100 / L4 decisions unchanged;
  • unmeasured capabilities (sm86, sm90, sm100, sm103, sm121) keep padding-free;
  • name order and shadowing in the peak table.

Both files give 134 passed.

Not covered

  • H100: not measured; Colab gave no H100 in more than an hour of retries. H100 and B200 go back to padding-free until measured.
  • Other sm120 parts: the RTX 5090, Workstation and Max-Q peaks come from datasheets, with no timing.
  • Host CPU: the 0.06 s threshold comes from a 48 vCPU Colab host.
  • Scope: ROCm, Windows and Mac are unchanged (padding-free before this logic runs). Qwen3 dense models only, single GPU.

… 5090 peaks

Measured padded + block compile vs padding-free on Colab G4 (RTX PRO 6000 Blackwell Server
Edition, sm120) with torch 2.14.1 and 2.10.0: at the 0.10 s threshold the rule would pick the
Qwen3 0.6B Alpaca batch 16 cell, which loses 24-29% on torch 2.14.1. sm120 gets 0.06 s, which
keeps every measured win at <= 45 ms and drops that cell. T4 / A100 / L4 keep 0.10 s. A
capability with no measurement (H100 / H200 sm90, B200 / B300 sm100 / sm103) keeps
padding-free instead of extrapolating from the datasheet peak.

mfu.py gains dense 16 bit peaks for RTX PRO 6000 Blackwell Server / Workstation / Max-Q and
GeForce RTX 5090 from the NVIDIA whitepapers and server datasheet; RTX 5090 D and the laptop
5090 stay unknown.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T07:48:20.897903Z f82febb Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: f82febbe68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit fd6d9f6 into main Oct 25, 2026
3 of 30 checks passed
@danielhanchen
danielhanchen deleted the padcal-h100-sm120 branch October 25, 2026 07:53
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