benchdnn: prohibit --mode=CP#4950
Draft
kwieloch-intel wants to merge 7 commits intouxlfoundation:mainfrom
Draft
Conversation
dzarukin
reviewed
Apr 3, 2026
tests/benchdnn/dnnl_common.cpp
Outdated
| && !has_bench_mode_bit(mode_bit_t::corr)) { | ||
| bench_mode_modifier |= mode_modifier_t::no_ref_memory; | ||
| } | ||
| #endif |
Contributor
There was a problem hiding this comment.
All those parts to be handled in utils/parser.cpp, not here.
Contributor
Author
There was a problem hiding this comment.
fbfda9c I’ve moved it to utils/parser.cpp.
dzarukin
reviewed
Apr 7, 2026
| && !has_bench_mode_bit(mode_bit_t::corr)) { | ||
| bench_mode_modifier |= mode_modifier_t::no_ref_memory; | ||
| } | ||
| #endif |
Contributor
There was a problem hiding this comment.
I'm sorry I was not quite clear in my intentions. There's already logic handling this: https://github.com/uxlfoundation/oneDNN/blob/main/tests/benchdnn/utils/parser.cpp#L1568
In this function you'll find places for both updates you want to do.
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 PR prohibits
--mode=CPin benchdnn and auto-enablesno_ref_memoryfor--mode=Pon Intel GPUs to align performance data filling with--mode=F.JIRA: MFDNN-14789
Problem description
Two issues with benchdnn performance mode data filling on Intel GPUs:
--mode=CPis broken: correctness + performance combined mode is unused and currently broken on both CPU and GPU. More importantly, correctness validation requires specific low-range data filling (less randomness in mantissa to minimize round-off errors), which makes the data compressible by the GPU driver and produces unreliable performance numbers.--mode=Pvs--mode=Fdata mismatch: in--mode=P,fill_random_real_dense()overwrites GPU buffers with deterministic CPU-generated data viareorder(), replacing the incompressible Philox PRNG data written bygpu_fill_random()duringdnn_mem_t::initialize(). This leads to different (and potentially compressible) data patterns compared to--mode=F.Proposed Solution
Two changes in
engine_tconstructor (dnnl_common.cpp):Prohibit
--mode=CP: if bothcorrandperfmode bits are set, emit an error message and fail. Users should run--mode=Cand--mode=P(or--mode=F) separately.Auto-enable
no_ref_memoryfor--mode=Pon Intel GPUs: when running perf-only mode (perf && !corr) with an Intel GPU engine, automatically set theno_ref_memorymodifier. This skips CPU reference memory allocation andfill_random_real_dense()calls, so GPU buffers retain incompressible Philox PRNG data, aligning--mode=Pdata filling with--mode=F.For CPU,
--mode=Fuses0x3Fmemset (different from--mode=Pwhich usesfill_random_real_dense), so the existing behavior is intentionally preserved, no change for CPU.Example
Before:
--mode=CPsilently runs but produces NaN in correctness output (broken) and unreliable perf numbers:After:
--mode=CPis explicitly prohibited: