From ffaf2f1c69fa35dd75588e846823ea24adeb0317 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 3 Jan 2024 14:58:46 -0800 Subject: [PATCH 1/4] Add one line reproducers and unit tests that would fail when bad wheels were generated by the compiler(s). nextafter reproducer thanks to @malfet! --- .github/scripts/validate_test_ops.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/scripts/validate_test_ops.sh b/.github/scripts/validate_test_ops.sh index e93f28918..9ce31dc24 100644 --- a/.github/scripts/validate_test_ops.sh +++ b/.github/scripts/validate_test_ops.sh @@ -21,5 +21,17 @@ pushd pytorch pip install expecttest numpy pyyaml jinja2 packaging hypothesis unittest-xml-reporting scipy # Run test_ops validation -export CUDA_LAUNCH_BLOCKING=1 -python3 test/test_ops.py TestCommonCUDA + +# Detect ReduceLogicKernel (ReduceOp and kernel) IMA +python test/test_ops.py -k test_dtypes_all_cuda +# Detect BinaryMulKernel (at::native::BitwiseAndFunctor) IMA +python test/test_torch.py -k test_index_reduce_reduce_prod_cuda_int32 +# Detect BinaryBitwiseOpsKernels (elementwise binary functor bitwise) IMA +python test/test_binary_ufuncs.py -k test_contig_vs_every_other___rand___cuda_int32 +# Detect MaxMinElementwiseKernel (maximum) IMA +python test/test_schema_check.py -k test_schema_correctness_clamp_cuda_int8 +# Detect StepKernel (nextafter) IMA +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')))" +# Detect BinaryGeometricKernels (atan2) IMA +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))" + From 0bdc4fe2581b2d78c7f91a9d4bd40ffefcbd2c7b Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 3 Jan 2024 15:03:00 -0800 Subject: [PATCH 2/4] cosmetic fixes --- .github/scripts/validate_test_ops.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/scripts/validate_test_ops.sh b/.github/scripts/validate_test_ops.sh index 9ce31dc24..3df5aea69 100644 --- a/.github/scripts/validate_test_ops.sh +++ b/.github/scripts/validate_test_ops.sh @@ -20,8 +20,7 @@ pushd pytorch pip install expecttest numpy pyyaml jinja2 packaging hypothesis unittest-xml-reporting scipy -# Run test_ops validation - +# Run pytorch cuda wheels validation # Detect ReduceLogicKernel (ReduceOp and kernel) IMA python test/test_ops.py -k test_dtypes_all_cuda # Detect BinaryMulKernel (at::native::BitwiseAndFunctor) IMA @@ -34,4 +33,3 @@ python test/test_schema_check.py -k test_schema_correctness_clamp_cuda_int8 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')))" # Detect BinaryGeometricKernels (atan2) IMA 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))" - From 3ecddcf22409613c033855e49a6a743919fa6011 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 3 Jan 2024 15:07:35 -0800 Subject: [PATCH 3/4] fix comments --- .github/scripts/validate_test_ops.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/validate_test_ops.sh b/.github/scripts/validate_test_ops.sh index 3df5aea69..e874c75a8 100644 --- a/.github/scripts/validate_test_ops.sh +++ b/.github/scripts/validate_test_ops.sh @@ -23,9 +23,9 @@ pip install expecttest numpy pyyaml jinja2 packaging hypothesis unittest-xml-rep # Run pytorch cuda wheels validation # Detect ReduceLogicKernel (ReduceOp and kernel) IMA python test/test_ops.py -k test_dtypes_all_cuda -# Detect BinaryMulKernel (at::native::BitwiseAndFunctor) IMA +# Detect BinaryMulKernel (elementwise binary functor internal mul) IMA python test/test_torch.py -k test_index_reduce_reduce_prod_cuda_int32 -# Detect BinaryBitwiseOpsKernels (elementwise binary functor bitwise) IMA +# Detect BinaryBitwiseOpsKernels (at::native::BitwiseAndFunctor) IMA python test/test_binary_ufuncs.py -k test_contig_vs_every_other___rand___cuda_int32 # Detect MaxMinElementwiseKernel (maximum) IMA python test/test_schema_check.py -k test_schema_correctness_clamp_cuda_int8 From fe15ad51dfe289138ccb4e4b95e6ab6a363da132 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Fri, 5 Jan 2024 12:21:35 -0800 Subject: [PATCH 4/4] Sorry, a bug fix --- .github/scripts/validate_test_ops.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/validate_test_ops.sh b/.github/scripts/validate_test_ops.sh index e874c75a8..0578d5ed9 100644 --- a/.github/scripts/validate_test_ops.sh +++ b/.github/scripts/validate_test_ops.sh @@ -32,4 +32,4 @@ python test/test_schema_check.py -k test_schema_correctness_clamp_cuda_int8 # Detect StepKernel (nextafter) IMA 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')))" # Detect BinaryGeometricKernels (atan2) IMA -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))" +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))"