Skip to content

Conversation

hipudding
Copy link
Collaborator

@hipudding hipudding commented Sep 26, 2025

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:

  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.

Discussion is here #16271

Make sure to read the contributing guidelines before submitting a PR

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 <[email protected]>
@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Sep 26, 2025
@hipudding hipudding self-assigned this Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant