[GPU] use stable seed hash algorithm for different platforms#36018
Open
yuanxion wants to merge 3 commits into
Open
[GPU] use stable seed hash algorithm for different platforms#36018yuanxion wants to merge 3 commits into
yuanxion wants to merge 3 commits into
Conversation
4cf726d to
54226d1
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/plugins/intel_gpu/tests/common/random_generator.hpp:47
- [MEDIUM] PR title/description suggests stable random generation across platforms, but
random_generatorstill relies onstd::default_random_engine, whose algorithm is implementation-defined and can differ between libstdc++/libc++/MSVC. Even with a stable seed, random sequences may still vary across platforms. If full reproducibility is required, consider switching to an explicitly specified engine (e.g.,std::mt19937orstd::minstd_rand0) or clarify in the PR description/title that only the seed derivation is stabilized.
std::default_random_engine& get_generator() {
return generator;
}
void set_seed(const std::string& seed) {
set_seed(stable_string_seed(seed));
}
void set_seed(const uint32_t seed) {
generator = std::default_random_engine{seed};
Contributor
Author
|
This PR can make the following testcases passed on Windows11 + UHD770 (iGPU driver: 32.0.101.7085): |
Signed-off-by: yuan.xiong <yuan.xiong@intel.com>
Add standard header files Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: yuan.xiong <yuan.xiong@intel.com>
225bfec to
62a2c61
Compare
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.
Details:
Reduce platform-dependent randomness in GPU test data generation by making testcase-name-based seed generation stable for GPU tests.
Description of the issue
Symptom
4 fully_connected compressed_int4_scale testcases passed on Ubuntu 22.04 with UHD 770, but failed on Windows 11 with UHD 770.
Root cause
The testcase seed was derived from
std::hash<std::string>, which is platform-dependent and may produce different values across different standard library implementations.As a result, the same testcase name could map to different seed values on Ubuntu and Windows. That caused the affected testcases to generate different random inputs on different platforms, which led to inconsistent results.
How to fix it
Reduce the platform-dependent part in testcase-name-based seed generation:
std::hash<std::string>std::string-based seed derivation in GPU test random data generationThis change reduces cross-platform differences caused by testcase-name-based seed generation and improves reproducibility of the affected tests.
The code and line that caused this issue
openvino/src/plugins/intel_gpu/tests/common/random_generator.hpp
Lines 28 to 35 in 1bbe690
Reproduction step and snapshot
./ov_gpu_unit_tests --gtest_filter='fully_connected_gpu_tests.compressed_int4_scale*'
Problematic graph
N/A
Checklist
Tickets:
AI Assistance: