Repository navigation
fix(mlsysim): give the T4 its FP32 and INT4 rates - #2192
Conversation
The T4 entry stored only an int8 rate, so Engine.solve with precision='fp32' fell through to peak_flops, the 65 TFLOP/s FP16 tensor-core rate, and warned "Results may be inaccurate". FP32 work on the T4 was modelled about 8x too fast, and INT4 4x too slow. Add the datasheet rates: FP32 8.1 TFLOP/s on the CUDA cores and INT4 260 TOPS. peak_flops (FP16 tensor, 65) and int8 (130) are unchanged, so FP16 and INT8 results, the appendix table and the hardware chapter's ridge point stay the same. test_precision_keys_use_canonical_vocabulary catches an aliased key such as 'fp32_cuda', but not a chip with no fp32 key at all, which is how the T4 slipped through. Add a T4 regression test and an Engine check that a compute-bound FP32 solve is limited by the FP32 rate without the fallback warning.
labs/tools/check_browser_wheels.py requires the committed mlsysim wheel to match the runtime source. Replace mlsysim/hardware/data/cloud/T4.yaml inside mlsysim-0.3.1-py3-none-any.whl with the updated file and its RECORD entry; every other entry is unchanged, and all 508 runtime files now match the source.
|
A note on the remaining red checks: Labs · Validate Notebooks is green now. MLSys·im · Run Tests: in a replica of this job on Kaggle (same Python, same No paper value changes (the hardware table uses the FP16 peak, still 65). Since Labs · Build Labs Site is not from this PR, which touches no styles: |
|
Thanks @Shakhtar-Sankur! 🎉 I added @Shakhtar-Sankur to labs, mlsysim for: bug, code, test, doc. The contributor tables are now handled directly by this workflow; no follow-up command is needed. |
Summary
The T4 entry stored only an INT8 rate, so
Engine.solve(..., precision="fp32")fell through topeak_flops, the 65 TFLOP/s FP16 tensor-core rate. FP32 work on the T4, the GPU students get on Colab and Kaggle, was modelled about 8x too fast. This adds the datasheet FP32 (8.1 TFLOP/s) and INT4 (260 TOPS) rates and two regression tests.Area
Changes
mlsysim/hardware/data/cloud/T4.yaml: addfp32: 8.1 TFLOPs / sandint4: 260 TOPSfrom the NVIDIA T4 datasheet, with a comment on why both keys are needed.peak_flops(FP16 tensor, 65) andint8(130) are unchanged, so FP16 and INT8 results, the accelerator table in the Vol 1 appendix and the hardware chapter's T4 ridge point stay the same.tests/test_hardware.py:test_precision_keys_use_canonical_vocabularycatches an aliased key such asfp32_cuda, but not a chip with nofp32key at all, which is how the T4 slipped through. Two new tests: the T4 resolvesfp32andint4to the datasheet rates, and a compute-bound FP32Engine.solve(ResNet-50, batch 256) is limited by the FP32 rate without the "not in precision_flops" fallback warning.Measured on a Tesla T4 (public Kaggle run: https://www.kaggle.com/code/sankurkundu/notebook9652c65b82), PyTorch matmul, TF32 off, best of n = 4096 and 8192:
Engine.solve(ResNet50, T4, batch_size=256), same run:Before the fix, FP32 and FP16 got the same latency; after it, FP32 is 7.97x slower, as the datasheet rates imply. FP16 and INT8 are unchanged.
Sixteen other accelerators also have no
fp32key (the TPUs, Gaudi 2 and 3, MI325X, Trainium2, Cerebras CS-3, Groq, Graphcore, DMatrix, Untether, GB200 NVL72). Some may not run FP32 matmul at all, so I left them out of this PR; happy to add the ones with a published FP32 rate if you want them.Testing
pytest tests/):tests/test_hardware.py, 19 passed on the Kaggle T4 run; full MLSys·im suite on this branch and on its parent ondev(https://www.kaggle.com/code/sankurkundu/notebook6040d01dac): the same 7 tests fail on both, none new: four intest_paper_integrity.py, two intest_downstream_impact.pyand one intest_v1_08_experiments.py, all failing the same way ondevin that environment (marimois not installed there)Related Issues
None; found while checking MLSys·im's T4 numbers against measurements on a T4.
By submitting this PR, you agree to release your contribution under the project's license.