[ARM CPU] Enable FP16 kernels for GQA op #23746
Merged
fajin-corp merged 11 commits intomainfrom Feb 20, 2025
Merged
Conversation
…icates, 3> cover lda/ldb/ldc in UT
amarin16
approved these changes
Feb 20, 2025
guschmue
pushed a commit
that referenced
this pull request
Mar 6, 2025
### Description - Enable hgemm and softmax fp16 kernels for GQA - add intra-loop parallelism to RoPE fp16 kernel __Benchmarking models__ - float32: [phi-3 cpu accuracy level 0](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-onnx/tree/main/cpu_and_mobile/cpu-int4-rtn-block-32) - float16: [phi-3 gpu accuracy level 0](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-onnx/tree/main/cuda/cuda-int4-rtn-block-32) Note: - Both fp32 and fp16 models share the same model structure and operator settings. - GQA takes ~15% of the runtime. - prompt length 256, token generation length 512 Linux (ubuntu 24.04) Standard D16pls v5 (16 vcpus, 32 GiB memory) | | fp32 (tps) | old fp16 (tps) | new fp16 (tps) | new fp16 vs old fp16 | new fp16 vs fp32 | |--|--|--|--|--|--| | prompt processing | 31.22 | 44.24 | 46.29 | +4.6% | +48.25% | | token generation | 4.75 | 7.2 | 7.95 | +10.39% | +67.43% | ### Motivation and Context Speed up GQA on FP16
ashrit-ms
pushed a commit
that referenced
this pull request
Mar 17, 2025
### Description - Enable hgemm and softmax fp16 kernels for GQA - add intra-loop parallelism to RoPE fp16 kernel __Benchmarking models__ - float32: [phi-3 cpu accuracy level 0](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-onnx/tree/main/cpu_and_mobile/cpu-int4-rtn-block-32) - float16: [phi-3 gpu accuracy level 0](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-onnx/tree/main/cuda/cuda-int4-rtn-block-32) Note: - Both fp32 and fp16 models share the same model structure and operator settings. - GQA takes ~15% of the runtime. - prompt length 256, token generation length 512 Linux (ubuntu 24.04) Standard D16pls v5 (16 vcpus, 32 GiB memory) | | fp32 (tps) | old fp16 (tps) | new fp16 (tps) | new fp16 vs old fp16 | new fp16 vs fp32 | |--|--|--|--|--|--| | prompt processing | 31.22 | 44.24 | 46.29 | +4.6% | +48.25% | | token generation | 4.75 | 7.2 | 7.95 | +10.39% | +67.43% | ### Motivation and Context Speed up GQA on FP16
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
Benchmarking models
Note:
Linux (ubuntu 24.04) Standard D16pls v5 (16 vcpus, 32 GiB memory)
Motivation and Context
Speed up GQA on FP16