Skip to content

WIP: xe: use double with post-ops with f64 to preserve accuracy#4746

Open
echeresh wants to merge 2 commits intomainfrom
echeresh/f64
Open

WIP: xe: use double with post-ops with f64 to preserve accuracy#4746
echeresh wants to merge 2 commits intomainfrom
echeresh/f64

Conversation

@echeresh
Copy link
Contributor

@echeresh echeresh commented Mar 2, 2026

@echeresh echeresh added the platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel label Mar 2, 2026
@echeresh echeresh requested review from a team as code owners March 2, 2026 22:49
@github-actions github-actions bot added the component:tests Codeowner: @oneapi-src/onednn-arch label Mar 2, 2026
@echeresh
Copy link
Contributor Author

echeresh commented Mar 2, 2026

make test
set test_scope=NIGHTLY
disable test_device_cpu
disable benchdnn_all
enable benchdnn_conv
enable benchdnn_pool
enable benchdnn_reorder
enable benchdnn_deconv
enable arch_gpu_xe-hpc
enable arch_gpu_xe-hpg-atsm
enable arch_gpu_xe-hpg-dg2
enable arch_gpu_xe-lp
enable arch_gpu_xe-lpg
enable arch_gpu_xe-lpg+
enable arch_gpu_xe2-hpg-bmg
enable arch_gpu_xe2-lpg
enable arch_gpu_xe3-lpg

Copy link
Contributor

@Simonsays095 Simonsays095 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still many other OpenCL kernels that use float instead of POST_OP_DATA_T. I guess those will be handled separately?

POST_OP_DATA_T dst_data;
#if WITH_SUM
dst_data = convert_float(DATA_TO_REF(C[dst_off]));
dst_data = (POST_OP_DATA_T)DATA_TO_REF(C[dst_off]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DATA_TO_REF here will convert to float. We either need to change DATA_TO_REF for f64 to be convert_double, or carve out an exception via macros here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely DATA_TO_REF should be replaced with FLT_ACC_DATA_T which is already used in this file. Alternatively, we can just refactor this to use the load/store API so that we don't need to go over this with a fine-grained comb looking for invalid casts.

As an aside, currently we have 3 different floating point accumulator types DATA_TO_REF, POST_OP_DATA_T, and FLT_ACC_DATA_T. I am not convinced we really need all of these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch, let me move the PR to WIP for now. I want to try to migrate REF family of macros to load/store. Eliminating extra macros would be nice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case this is helpful, here as a sample commit porting gemm to use the load store interface.

@echeresh echeresh changed the title xe: use double with post-ops with f64 to preserve accuracy WIP: xe: use double with post-ops with f64 to preserve accuracy Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:tests Codeowner: @oneapi-src/onednn-arch platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants