onnxruntime
9ec5c193 - Address parameter validation across all EPs for Convo kernels (#28142)

Commit
11 days ago
Address parameter validation across all EPs for Convo kernels (#28142) This pull request introduces consistent validation checks across ONNX Runtime's CPU, CoreML, and DML providers to ensure that all stride and dilation values are strictly positive for convolution, pooling, and related operators. It also updates the DML error handling macros and re-enables previously skipped DML tests now that validation is enforced. Minor test refactoring was performed for clarity and consistency. **Validation and Error Handling Improvements** * Added explicit checks in CPU, CoreML, and DML operator implementations (`conv`, `pool`, `unpool`, `col2im`) to enforce that all stride and dilation values are positive, improving robustness and error reporting. [[1]](diffhunk://#diff-35deda6657918df08eae5e5dabdae1400a897baa367982016d58d11aa0475433R36-R39) [[2]](diffhunk://#diff-35deda6657918df08eae5e5dabdae1400a897baa367982016d58d11aa0475433R60-R63) [[3]](diffhunk://#diff-a818aa3a8f4a2b9979c6c5ff442013ee68aaa7c2820187a67f101e827c86325cR84-R91) [[4]](diffhunk://#diff-d8bd0c8e7504c953a3d815b3861dcbf2ab54cd21c43a9c075c1cbfa27eff8588R40-R42) [[5]](diffhunk://#diff-8a84d45bc16847e75b0c5a567ff30debe4dcfc7ec38dfde9d976a614e3a084f0R20-R25) [[6]](diffhunk://#diff-05313190254d7c959c84f5babc80baa88acc7169fba8f003e85528c9fc27b885R79-R85) [[7]](diffhunk://#diff-05313190254d7c959c84f5babc80baa88acc7169fba8f003e85528c9fc27b885R106-R112) [[8]](diffhunk://#diff-f4f7b730ab771dab9edbb71e83cf29e58998a9533eba4c29b914829cfa68a2e7R78-R80) [[9]](diffhunk://#diff-f4f7b730ab771dab9edbb71e83cf29e58998a9533eba4c29b914829cfa68a2e7R123-R125) [[10]](diffhunk://#diff-bef0ef93893a6483886ac172005af4a3ebd608000adb2224ef2e0d5449eaa066R399-R405) [[11]](diffhunk://#diff-bef0ef93893a6483886ac172005af4a3ebd608000adb2224ef2e0d5449eaa066R418-R424) * Introduced new error handling macros for DML to support formatted error messages and consistent validation checks. [[1]](diffhunk://#diff-4fdd0de44f8faecc461e38d55e7be6200058540d4219706f999af9477864af9bR62-R67) [[2]](diffhunk://#diff-b61229a4e8213587856d74fd17c9751242c434029c0290c396f5e7b55bba7bdeR16-R23) **Test Suite Updates** * Re-enabled DML execution provider in several `MaxPool` tests, which were previously skipped due to invalid stride/dilation values, and removed unnecessary test skips. [[1]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L22-R26) [[2]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L68-R63) [[3]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6R177-L192) [[4]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L370-R367) [[5]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L391-R378) * Replaced `vector` with `std::vector` in test attribute declarations for clarity and consistency. [[1]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L22-R26) [[2]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L86-R82) [[3]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L138-R134) [[4]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L203-R195) [[5]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L221-R213) [[6]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L241-R233) [[7]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L260-R252) [[8]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L289-R281) [[9]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L311-R303) [[10]](diffhunk://#diff-c97371192484fd70b225a641e22117ded0413c0d27683637c3c2b7715539e5a6L370-R367) * Removed an unused `using namespace std;` directive from the test file. These changes improve input validation, error diagnostics, and ensure more reliable cross-provider behavior for stride and dilation attributes.
Author
Parents
Loading