fix(ks/auto-bench): make v0/v1 comparisons deterministic - #173
Open
Jiwangreal wants to merge 3 commits into
Open
fix(ks/auto-bench): make v0/v1 comparisons deterministic#173Jiwangreal wants to merge 3 commits into
Jiwangreal wants to merge 3 commits into
Conversation
added 3 commits
August 8, 2026 17:25
…-sdpa flag - Reseed RNG before constructing both v0 and v1 models in build_case so parameterized models start from equivalent weights. - Add --math-sdpa flag to force PyTorch SDPA to math backend, bypassing incompatible FlashAttention plugins on ROCm/DCU. - Add unit test verifying reseeded models produce identical weights.
v0/reference get_inputs is now the canonical input source. v1 receives a deep copy of the same tensors via clone_value() instead of generating its own inputs under the same seed, eliminating false correctness failures from CPU vs CUDA RNG differences. compare_case later moves both copies to the same accelerator before executing, so device placement is unaffected. Adds test_build_case_clones_reference_inputs_for_v1 to verify both value equality and independent storage (distinct data_ptr).
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.
Summary
--math-sdpacomparison modeget_inputs()as canonical data and deep-clone it for v1, avoiding CPU/device RNG mismatchesContext
This branch is rebased onto the current
DeepLink-org/DLBlas:mainand preserves the GCU support added by #170.Validation
python3.10 tests/benchmarks/test_ks_auto_bench.pygit diff --check origin/main..HEADpassed