onnxruntime
505e0c38 - Suppress test warnings in transformers tests and fix CUDA CI (#28391)

Commit
61 days ago
Suppress test warnings in transformers tests and fix CUDA CI (#28391) ### Description Suppress noisy warnings in Python transformers tests and fix missing test exclusions for CUDA ReduceMax/ReduceMin empty-set tests. ### Motivation and Context CI logs show ~60+ warnings across transformers tests from PyTorch TorchScript-based ONNX export deprecation, TracerWarnings, and related UserWarnings. These are expected when using `dynamo=False` (the legacy exporter) and obscure actionable test output. Additionally, `test_reduce_max_empty_set_cuda` and `test_reduce_min_empty_set_cuda` were not excluded despite being a known CUDA provider limitation (the CPU provider handles empty sets correctly but CUDA does not). ### Changes | File | Change | |---|---| | `onnxruntime/test/python/transformers/conftest.py` | Add pytest `filterwarnings` to suppress PyTorch export DeprecationWarning, TracerWarning, dynamic axes UserWarning, inplace ops UserWarning, and numpy ndarray UserWarning | | `onnxruntime/python/tools/transformers/torch_onnx_export_helper.py` | Wrap `torch.onnx.export` calls in `warnings.catch_warnings()` to suppress legacy exporter deprecation for non-pytest callers | | `onnxruntime/test/onnx/gen_test_models.py` | Suppress protobuf `label()` deprecation warnings from onnx internals | | `onnxruntime/test/python/transformers/test_parity_t5_mha.py` | Replace `torch.tensor(ort_output)` with `torch.from_numpy(np.array(ort_output))` to avoid slow list-of-ndarrays conversion warning | | `onnxruntime/test/testdata/onnx_backend_test_series_filters.jsonc` | Add `test_reduce_max_empty_set_cuda` and `test_reduce_min_empty_set_cuda` to `current_failing_tests` | |`docs/OperatorKernels.md`|Update operator document | ### Notes - The CUDA ReduceMax/Min empty-set issue is a pre-existing kernel limitation where `PrepareForReduce` unconditionally rejects dim=0 axes. The CPU provider correctly returns identity values (-inf/+inf). A proper fix requires CUDA kernel changes and is tracked separately. - All warning suppressions are scoped to known expected warnings from PyTorch internals, not user code issues.
Author
Parents
Loading