8000 fix randint distribution for large max by ngimel · Pull Request #143787 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

fix randint distribution for large max #143787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
skip dynamic shape tests, adjust cpu rng test
  • Loading branch information
ngimel committed Dec 26, 2024
commit 28c48ec431cef37b0c7f37bfb27cbdd0136e5663
4 changes: 3 additions & 1 deletion aten/src/ATen/test/rng_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ void test_random_from_to(const at::Device& device) {
range = static_cast<uint64_t>(max_to) - static_cast<uint64_t>(from) + 1;
from_case_covered = true;
}
if (range < (1ULL << 32)) {
// this is leaking details of implementation into test
// we are starting to use random64() at 2^25 to minimize skew due to %
if (range < (1ULL << 25)) {
exp = static_cast<T>(static_cast<int64_t>((static_cast<uint32_t>(val) % range + from)));
} else {
exp = static_cast<T>(static_cast<int64_t>((val % range + from)));
Expand Down
2 changes: 1 addition & 1 deletion test/inductor/test_torchinductor_codegen_dynamic_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def run(*ex, **kwargs):
"test_pointwise_laguerre_polynomial_l_dynamic_shapes": TestFailure(("cuda", "xpu")),
"test_pointwise_legendre_polynomial_p_dynamic_shapes": TestFailure(("cuda", "xpu")),
"test_polar_dynamic_shapes": TestFailure(("cpu", "cuda", "xpu"), is_skip=True),
"test_randint_distribution": TestFailure(("cuda",)),
"test_randint_distribution_dynamic_shapes": TestFailure(("cuda",)),
"test_randn_generator_dynamic_shapes": TestFailure(("cpu",)),
"test_randn_like_empty_dynamic_shapes": TestFailure(("cpu", "cuda", "xpu")),
"test_single_elem_dynamic_shapes": TestFailure(("cpu",)),
Expand Down
2 changes: 1 addition & 1 deletion test/inductor/test_torchinductor_dynamic_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
("cpu", "cuda", "xpu")
),
"test_conv_inference_heuristics_dynamic_shapes": TestFailure(("cuda", "xpu")),
"test_randint_distribution": TestFailure(("cuda",)),
"test_randint_distribution_dynamic_shapes": TestFailure(("cuda",)),
}

if TEST_WITH_ROCM:
Expand Down
Loading
0