onnxruntime
5ddf568f - Add LpNormalization support for CUDA Execution Provider (#28724)

Commit
37 days ago
Add LpNormalization support for CUDA Execution Provider (#28724) This pull request adds CUDA (GPU) support for the `LpNormalization` ONNX operator in ONNX Runtime, including implementation, kernel registration, and new unit tests (notably for FP16). The main changes involve adding the CUDA kernel, wiring it up for opsets 1–22, and extending the test suite to cover new scenarios and datatypes. **CUDA LpNormalization Operator Support:** * Implemented CUDA kernel for `LpNormalization` supporting float, double, and MLFloat16 datatypes, with efficient handling for both L1 and L2 normalization. [[1]](diffhunk://#diff-da1ae1a947b0a165abe68a4a68fb9644c2b75b9753189e6892353c115566bb6eR1-R68) [[2]](diffhunk://#diff-2f04a7999c4c99d91c515a2b73807f6f139dd305d34c69eb30f2616fc7b69771R1-R100) [[3]](diffhunk://#diff-e1579a7f475aa5f030e30b5d885353efc0b83129b36eef0037734ae1e0d7a96dR1-R28) [[4]](diffhunk://#diff-3a114fbaed1bc7eb60ab6d5c460c353d8701ffea5f8f7d4908afb3847f02d3f4R1-R23) * Registered the CUDA kernel for `LpNormalization` for opsets 1–21 (versioned) and opset 22 (current), for all supported datatypes (`float`, `double`, `MLFloat16`). [[1]](diffhunk://#diff-57ba769b54dce57acd89df47140ede5f29ea670d61176096076701912d573285R803-R805) [[2]](diffhunk://#diff-57ba769b54dce57acd89df47140ede5f29ea670d61176096076701912d573285R1675-R1677) [[3]](diffhunk://#diff-57ba769b54dce57acd89df47140ede5f29ea670d61176096076701912d573285R2085-R2087) [[4]](diffhunk://#diff-57ba769b54dce57acd89df47140ede5f29ea670d61176096076701912d573285R2957-R2959) **Testing and Validation:** * Added new unit tests for `LpNormalization` covering FP16, various axes, and both L1/L2 normalization, ensuring CUDA kernel correctness and excluding unsupported providers. [[1]](diffhunk://#diff-1d2410a746b785056379c80e8defb12f1c7bb113c46755998cc1e285dd478863R4) [[2]](diffhunk://#diff-1d2410a746b785056379c80e8defb12f1c7bb113c46755998cc1e285dd478863R175-R273) * Updated backend test filters to reflect the current status of LpNormalization-related tests. These changes collectively enable and validate GPU-accelerated LpNormalization in ONNX Runtime for a wide range of models and datatypes.
Author
Parents
Loading