fix: fp8 scaling_mode is not validated before use - #3366
Conversation
Greptile SummaryThis PR adds early validation for FP8 scaling modes in the context-parallel attention test helper.
Confidence Score: 5/5The PR appears safe to merge, with the new validation matching the helper’s existing supported scaling modes. Existing callers and downstream recipe and quantizer branches consistently use only Important Files Changed
Reviews (1): Last reviewed commit: "fix: fp8 scaling_mode is not validated b..." | Re-trigger Greptile |
| # unsupported value fails fast with a clear message instead of | ||
| # leaving fp8_recipe / quantizers undefined. | ||
| if dtype == "fp8" and scaling_mode not in ("delayed", "current", "mxfp8"): | ||
| raise ValueError(f"Unsupported scaling_mode for FP8: {scaling_mode!r}") |
There was a problem hiding this comment.
This path is unreachable in our test infra so the check here is probably unnecessary:
dtype == "fp8" in only tested in test_cp_with_fused_attention, and it's guarded here.
864475d to
2d80391
Compare
|
Closing this PR. @cyanguwa is right — the fp8 path is only exercised by |
This PR addresses the following issue in
tests/pytorch/attention/run_attention_with_cp.py: fp8 scaling_mode is not validated before use.Changes
tests/pytorch/attention/run_attention_with_cp.py: fp8 scaling_mode is not validated before use.Details
Tests
tests/pytorch/attention/test_attention_with_cp_validation.py