Skip to content

Conversation

@h-sadia
Copy link
Contributor

@h-sadia h-sadia commented Jan 5, 2026

This is the GPU side of the adding s64 offset and seed support for frameworks. The CPU/Arch part was merged before holidays here: #4031

@h-sadia h-sadia requested review from a team as code owners January 5, 2026 23:33
@github-actions github-actions bot added platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel component:tests Codeowner: @oneapi-src/onednn-arch labels Jan 5, 2026
@h-sadia h-sadia force-pushed the hsadia/dropout_mm_main branch 5 times, most recently from 9b5d3dc to 1ac0545 Compare January 6, 2026 01:07
@h-sadia
Copy link
Contributor Author

h-sadia commented Jan 6, 2026

make test
set test_scope=NIGHTLY
disable test_device_cpu
disable benchdnn_all
enable benchdnn_matmul
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

@h-sadia h-sadia force-pushed the hsadia/dropout_mm_main branch from 1ac0545 to 50c012b Compare January 6, 2026 19:05
@h-sadia h-sadia requested a review from a team as a code owner January 6, 2026 19:05
@h-sadia h-sadia force-pushed the hsadia/dropout_mm_main branch from 50c012b to 4dc9fd9 Compare January 6, 2026 20:02
@h-sadia
Copy link
Contributor Author

h-sadia commented Jan 6, 2026

make test
set test_scope=NIGHTLY
disable test_device_cpu
disable benchdnn_all
enable benchdnn_matmul
enable arch_gpu_xe-hpc

Copy link
Contributor

@dzarukin dzarukin left a comment

Choose a reason for hiding this comment

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

LGTM, left some minor comments.

float po_acc = convert_float(temp);

#if WITH_DROPOUT
#if USE_OFFSET
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should check if SEED_DATA_T is int or int64_t. If it's not, then the assumption is the offset won't be passed anyway. If it is, then use a new version and if offset wasn't specified, the kernel sets it to 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! the offset will already be set to zero if use_offset = 0, but this condition is misleading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/uxlfoundation/oneDNN/blob/main/src/cpu/primitive_attr_postops.cpp#L304 - based on this condition use_offset is the precursor between the two philox functions used. Will stick with what I have by adding explicit conversion to seed for philox without offset. Changing condition will mean I will have to add another similar function to cater for s64 philox without seed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively you could have two versions of philox_4x32 with different type signatures so it would dispatch implicitly based on type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We strictly like to keep the code between cpu/gpu same. Additionally if I do add another philox function, it will be just repeating the same code with lesser lines.

@h-sadia h-sadia force-pushed the hsadia/dropout_mm_main branch 3 times, most recently from 115b8aa to 5701436 Compare January 6, 2026 23:49
@h-sadia h-sadia force-pushed the hsadia/dropout_mm_main branch from 5701436 to 417e650 Compare January 7, 2026 01:20
@h-sadia
Copy link
Contributor Author

h-sadia commented Jan 7, 2026

make test
set test_scope=NIGHTLY
disable test_device_cpu
disable benchdnn_all
enable benchdnn_matmul
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

--check-ref-impl=false

--attr-dropout=0.5:12345678,0.75:12345678:undef,0.25:843921:any:1238976:true
--attr-dropout=0.5:12345678,0.75:12345678:undef,0.25:843921:any:1238976:true,0.75:111786:any:121716:false
Copy link
Contributor

Choose a reason for hiding this comment

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

are we able to specify s32/s64 seed type from benchdnn? it might be worth verifying both if theyre still supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So benchdnn only supports s64 as a standard. We are keeping s32 for older test-pathways. I checked the s32 datatype here by making the change here: https://github.com/uxlfoundation/oneDNN/blob/main/tests/benchdnn/dnn_types.cpp#L1449-L1454
(and all the tests are passing for harness_matmul_dropout)

@h-sadia h-sadia force-pushed the hsadia/dropout_mm_main branch from 417e650 to d04c1ad Compare January 7, 2026 03:39
@h-sadia h-sadia merged commit 7513f1f into main Jan 7, 2026
32 checks passed
@h-sadia h-sadia deleted the hsadia/dropout_mm_main branch January 7, 2026 05:21
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.

3 participants