Repository navigation
fix(training): correct RTX 3070 Ti BF16 peak FLOPS - #83
Conversation
# 🐛 Bug Fix ## Correct RTX 3070 Ti entry in _DEVICE_FLOPS - Change `21.75e12` to `43.5e12` in `relax/utils/training/flops_counter.py` - `21.75e12` is the card's FP32 non-Tensor peak, not its BF16 Tensor peak - The table is documented as "BF16 theoretical peak FLOPS per device", and every other entry is a dense BF16 Tensor Core figure - MFU is `achieved_tflops / device_peak_tflops`, so the too-low peak inflated reported MFU by roughly 2x on this GPU - The failure was silent: the value is finite and positive, so it passed every existing guard and rendered as a plausible number on the dashboard - NVIDIA lists the RTX 3070 at 20.3 TFLOPS FP32 and 40.6 TFLOPS dense BF16 Tensor (a 2x ratio); applying that ratio to the Ti's 21.75 TFLOPS FP32 gives 43.5 TFLOPS
There was a problem hiding this comment.
Pull request overview
This PR corrects the RTX 3070 Ti entry in Relax’s BF16 theoretical peak device FLOPS table, which is used to compute MFU (achieved TFLOPS / device peak TFLOPS) in training metrics.
Changes:
- Update
_DEVICE_FLOPS["RTX 3070 Ti"]from21.75e12to43.5e12inget_device_peak_flops()’s backing table.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "910B": 354e12, | ||
| "Ascend910": 354e12, | ||
| "RTX 3070 Ti": 21.75e12, | ||
| "RTX 3070 Ti": 43.5e12, | ||
| } |
There was a problem hiding this comment.
同意补充这一用例,并补充一个使它更有必要的回归风险证据:
_DEVICE_FLOPS 表整体改编自 verl(见文件头部来源说明,随 7c534c9 引入),而 verl 上游 main 至今仍是 "RTX 3070 Ti": 21.75e12。因此本 PR 属于对上游数据源的有意偏离——今后若有人从 verl 重新同步该表,这处修正会被静默回退,且现有测试全部通过,MFU 会再次被无声放大约 2 倍。
按现有参数化约定补一行 ("NVIDIA GeForce RTX 3070 Ti", 43.5e12) 即可把这一偏离固化为可回归验证的契约。非阻塞建议,修正本身的正确性我已核对无误。
Nyanpasu 审查看板审查状态: 💬 已完成 · 有补充意见 审查版本: 7a346d3 常规审查完成,无阻塞问题:diff 仅为 _DEVICE_FLOPS 中 RTX 3070 Ti 一处常量修正(21.75e12 → 43.5e12),旧值为 FP32 非张量峰值,与表声明的 dense BF16 张量峰值约定不符;新值 43.5e12 与 PR 引用的 NVIDIA 白皮书及表内其余条目约定一致,本地 20 项测试通过,设备名解析与 MFU 链路核对无误。唯一建议(P2,非阻塞):按现有参数化约定为该条目补一行测试,防止将来从 verl 上游(仍为旧值)同步该表时修正被静默回退。
审查发现待处理
已解决或已取代
提交范围 · 接收 1 · 建议移出 0 · 待确认 0接收 1 个文件 · 建议移出 0 个文件 · 待确认 0 个文件。移出与待确认部分暂停深审,不代表审查通过。
精简审查与验证依据
生产代码的必要性与替代方案
测试的必要性与替代方案
Powered by Nyanpasu with glm-5.3[1m] xhigh, please check the suggestions carefully.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rai-studio-bot
left a comment
There was a problem hiding this comment.
审查结论:无阻塞问题,建议合并前顺手处理一条非阻塞补充(见 F1 线程)
针对 7a346d3 完成全量审查,diff 仅为 relax/utils/training/flops_counter.py 中 RTX 3070 Ti 的单常量修正(21.75e12 → 43.5e12)。核对确认:旧值恰为该卡 FP32 非张量峰值(2×6144×1.77GHz = 21.75e12),与表头声明的 dense BF16 张量峰值约定不符;新值 43.5e12 为 GA104 dense BF16 Tensor(FP32 累加)峰值,与 PR 引用的 NVIDIA 白皮书表(43.5 dense / 87 sparse)及表内其余条目的 dense 约定一致。本地 pytest tests/utils/test_flops_counter.py 20 项全部通过,get_device_peak_flops 对 "NVIDIA GeForce RTX 3070 Ti" 解析为 43.5、未知设备仍返回 inf,MFU 链路(train_metric_utils.py:66-74)随峰值修正恢复正确比例。
唯一待处理项为非阻塞建议(P2):按现有参数化约定补一行该条目的测试用例,防止将来从 verl 同步该表时修正被静默回退,详见审查线程;其余无问题。
审查看板:#83 (comment)

What
Correct the
RTX 3070 Tientry in_DEVICE_FLOPSfrom21.75e12to43.5e12.Why
_DEVICE_FLOPSis documented as "BF16 theoretical peak FLOPS per device"(
relax/utils/training/flops_counter.py:12), and every other entry is a denseBF16 Tensor Core figure — for example
H100: 989e12andA100: 312e12, whichare the dense (non-sparsity) Tensor Core numbers.
The
RTX 3070 Tientry instead held21.75e12, which is that card's FP32non-Tensor peak. It is the only entry in the table whose value equals the
card's plain FP32 rate rather than its Tensor Core rate.
Because MFU is computed as
achieved_tflops / device_peak_tflops(
relax/utils/training/train_metric_utils.py:69-73), a peak that is ~2x too lowinflates reported MFU by roughly 2x on this GPU. The failure is silent: the value
is finite and positive, so it passes every existing guard and renders as a
plausible-looking number on the dashboard.
How
NVIDIA's RTX Blackwell GPU Architecture whitepaper (Appendix B, Table 5) lists
both figures for the RTX 3070 Ti in the same table:
The current entry (
21.75e12) matches the non-Tensor row. Since_DEVICE_FLOPSis a BF16 Tensor Core table and MFU is measured against Tensor Core throughput,
the correct value is the dense Tensor figure with FP32 accumulate — 43.5.
BF16 always accumulates in FP32, so that is the applicable row.
Note the argument does not rest on this document alone: the entry is also
inconsistent with the table's own stated convention, which is verifiable from
the surrounding entries by themselves.
Only the single value is changed. The lookup logic, the unknown-device sentinel,
and all other entries are untouched.
Testing
Device lookups after the change — all existing known-GPU entries resolve
unchanged, the corrected entry resolves to 43.5 TFLOPS, and unknown devices
still return
float("inf"):pre-commit run --all-filespassespytest tests/) (rantests/utils/test_flops_counter.py: 20 passed; the full suite needs a distributed GPU environment)Type of Change
Screenshots / Logs
Before this change, on an RTX 3070 Ti,
perf/device_peak_tflopswas reported as21.75and allperf/mfu/*values were consequently ~2x too high. After thechange the peak is
43.5and MFU is scaled correctly.