Skip to content

[Bug] Handle uppercase L40S device names - #4299

Merged
tianyu-l merged 1 commit into
pytorch:mainfrom
taking-lying-flat:fix/l40s-peak-flops-case
Aug 24, 2026
Merged

[Bug] Handle uppercase L40S device names#4299
tianyu-l merged 1 commit into
pytorch:mainfrom
taking-lying-flat:fix/l40s-peak-flops-case

Conversation

@taking-lying-flat

@taking-lying-flat taking-lying-flat commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Make the L40S peak-FLOPS check case-insensitive by matching against device_name.casefold().

Why

get_peak_flops() currently searches for the lowercase substring l40s in the original device name. CUDA commonly reports this accelerator as NVIDIA L40S, so the case-sensitive check misses it and falls through to the unknown-GPU A100 fallback.

That fallback reports 312 BF16 TFLOPS instead of the configured L40S value of 362 BF16 TFLOPS. Since peak FLOPS is the denominator of MFU, this causes L40S utilization metrics to be calculated against the wrong hardware limit and appear artificially high.

Using casefold() only at the L40S comparison accepts both common uppercase names and lowercase variants without changing any other device-detection branch.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 23, 2026
@tianyu-l
tianyu-l merged commit e6344c7 into pytorch:main Aug 24, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants