Skip to content

Commit ca78420

Browse files
authored
Add unit tests and one line reproducers to detect bad pytorch cuda wheels (#1663)
* Add one line reproducers and unit tests that would fail when bad wheels were generated by the compiler(s). nextafter reproducer thanks to @malfet! * cosmetic fixes * fix comments
1 parent f2efe21 commit ca78420

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/scripts/validate_test_ops.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ pushd pytorch
2020

2121
pip install expecttest numpy pyyaml jinja2 packaging hypothesis unittest-xml-reporting scipy
2222

23-
# Run test_ops validation
24-
export CUDA_LAUNCH_BLOCKING=1
25-
python3 test/test_ops.py TestCommonCUDA
23+
# Run pytorch cuda wheels validation
24+
# Detect ReduceLogicKernel (ReduceOp and kernel) IMA
25+
python test/test_ops.py -k test_dtypes_all_cuda
26+
# Detect BinaryMulKernel (elementwise binary functor internal mul) IMA
27+
python test/test_torch.py -k test_index_reduce_reduce_prod_cuda_int32
28+
# Detect BinaryBitwiseOpsKernels (at::native::BitwiseAndFunctor) IMA
29+
python test/test_binary_ufuncs.py -k test_contig_vs_every_other___rand___cuda_int32
30+
# Detect MaxMinElementwiseKernel (maximum) IMA
31+
python test/test_schema_check.py -k test_schema_correctness_clamp_cuda_int8
32+
# Detect StepKernel (nextafter) IMA
33+
python -c "import torch; print(torch.nextafter(torch.tensor([-4.5149, -5.9053, -0.9516, -2.3615, 1.5591], device='cuda:0'), torch.tensor(3.8075, device='cuda:0')))"
34+
# Detect BinaryGeometricKernels (atan2) IMA
35+
python -c "import torch; x = (torch.randn((2,1,1), dtype=torch.float, device="cuda")*5).to(torch.float32); y=(torch.randn((), dtype=torch.float, device="cuda")*5).to(torch.float32); print(torch.atan2(x,y))"

0 commit comments

Comments
 (0)