Loosen fp16 atol in ONNX export tests for onnxruntime 1.29 CPU numerics - #37
Open
pggPL wants to merge 1 commit into
Open
Loosen fp16 atol in ONNX export tests for onnxruntime 1.29 CPU numerics#37pggPL wants to merge 1 commit into
pggPL wants to merge 1 commit into
Conversation
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
L1_pytorch_onnx_unittestfails in nightly CI since 2026-08-18 on the fp16 (precision1) variants oftest_export_linear_recipe,test_export_layernorm_linear_recipeandtest_export_layernorm_mlp. The trigger is the onnxruntime 1.28.0 → 1.29.0 bump in the unpinned CI image: ORT executes the exported graph on the CPU EP, and 1.29 changed fp16 CPU numerics, so the ORT-vs-TE mismatch now reaches up to ~9e-3 (2–9 fp16 ULPs) against the hardcodedatol=1e-3. Verified by A/B on the same TE/torch: ORT 1.28 passes, ORT 1.29 fails; no TE commit is involved.Since the comparison is half-precision GPU (TE) vs half-precision CPU (ORT), differences of a few ULPs from accumulation order are expected and do not indicate an incorrect ONNX representation. This PR makes the tolerance precision-aware:
atol=2e-2for fp16 (the value already used for FP8 CurrentScaling and FP8 MLP in the same file), keeping1e-3for fp32.Type of change
Changes
get_atol(precision)helper intests/pytorch/test_onnx_export.pyreturning2e-2for fp16 and the default1e-3otherwise._test_export_linear,_test_export_layernorm_linear,_test_export_layernorm_mlpand in the DelayedScaling branch of_test_export_layernorm_linear.Checklist:
🤖 Generated with Claude Code