[Pending][OneDNN] add fp8 block gemm#173
Open
Yejing-Lai wants to merge 1 commit intovllm-project:mainfrom
Open
[Pending][OneDNN] add fp8 block gemm#173Yejing-Lai wants to merge 1 commit intovllm-project:mainfrom
Yejing-Lai wants to merge 1 commit intovllm-project:mainfrom
Conversation
Signed-off-by: Lai, Yejing <yejing.lai@intel.com>
xinyu-intel
requested changes
Mar 5, 2026
| x: [M, N] float tensor (fp16/fp32) | ||
| block_m: block rows | ||
| block_n: block cols | ||
| fp8_dtype: torch.float8_e4m3fn or e5m2 |
Collaborator
There was a problem hiding this comment.
remove e5m2 if not supported
| weight_fp8, scale_wei_fp8 = fp8_block_quant_2d(weight, group_size, | ||
| group_size) | ||
|
|
||
| # reference fp16 gemm |
| group_size) | ||
|
|
||
| # reference fp16 gemm | ||
| output_ref = torch.matmul(input, weight.t()) |
Collaborator
There was a problem hiding this comment.
what should be the reference here? the purpose here is to check the numerical loss instead of the quantization loss. see https://github.com/pytorch/pytorch/blob/4a1bbf44dde11d5ca0c9928a929d18cb3d180181/test/test_scaled_matmul_cuda.py#L308 for the reference.
Contributor
Author
There was a problem hiding this comment.
Here referenced the comparison methods used in per_tensor/per_channel/per_token UT from this file(https://github.com/vllm-project/vllm-xpu-kernels/blob/main/tests/test_fp8_gemm_onednn.py#L155). Do we need to update all of these comparison methods?
Collaborator
There was a problem hiding this comment.
I see. Please update others in another PR. cc @zufangzhu
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.
Add fp8 block gemm and UT. All UT passed.