Support FP16 as intermediate results in graph computation#16270
Draft
hipudding wants to merge 1 commit intoggml-org:masterfrom
Draft
Support FP16 as intermediate results in graph computation#16270hipudding wants to merge 1 commit intoggml-org:masterfrom
hipudding wants to merge 1 commit intoggml-org:masterfrom
Conversation
This commit is a demo aimed at using FP16 as the data type for intermediate results in graph inference, reducing computation and improving inference speed. Verification was conducted with the CANN backend on Qwen2.5, Qwen3-MoE, and DeepSeek-Lite-V2, showing performance improvements of 3%–10% depending on the concurrency and model. The main changes include modifying operators involved in graph by replacing hardcoded FP32 data types with type inference based on input, adding FP16 support for GET_ROWS, and casting t_embd and t_logits back to FP32 at the end of inference. In fact, this is only a very basic validation. For full FP16 support, the following are still needed: 1. Modify all operators that currently hardcode FP32 to perform type inference based on the data type. 2. Add FP16 support to all backend operators. 3. Extend test cases to include FP16 data types. Co-authored-by: noemotiovon <757486878@qq.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.
This commit is a demo aimed at using FP16 as the data type for intermediate results in graph inference, reducing computation and improving inference speed. Verification was conducted with the CANN backend on Qwen2.5, Qwen3-MoE, and DeepSeek-Lite-V2, showing performance improvements of 3%–10% depending on the concurrency and model. with #16251
The main changes include modifying operators involved in graph by replacing hardcoded FP32 data types with type inference based on input, adding FP16 support for GET_ROWS, and casting t_embd and t_logits back to FP32 at the end of inference.
In fact, this is only a very basic validation. For full FP16 support, the following are still needed:
Discussion is here #16271
Make sure to read the contributing guidelines before submitting a PR