Skip to content

Bug fix: allow std 0 in the meta definition of normal_#69631

Closed
nkaretnikov wants to merge 1 commit intogh/nkaretnikov/4/basefrom
gh/nkaretnikov/4/head
Closed

Bug fix: allow std 0 in the meta definition of normal_#69631
nkaretnikov wants to merge 1 commit intogh/nkaretnikov/4/basefrom
gh/nkaretnikov/4/head

Conversation

@nkaretnikov
Copy link
Collaborator

@nkaretnikov nkaretnikov commented Dec 8, 2021

Stack from ghstack:

All other normal variants allow 0. Looks like a mistake made while
copying the check. Even the normal_ implementation disagrees:

t = torch.rand(2, 3, device='meta')
t.normal_(mean=4, std=0)
Traceback (most recent call last):
File "", line 1, in
RuntimeError: normal_ expects std > 0.0, but found std=0

t = torch.rand(2, 3)
t.normal_(mean=4, std=0)
tensor([[4., 4., 4.],
[4., 4., 4.]])

Fixes #69523.

All other normal variants allow 0.  Looks like a mistake made while
copying the check.  Even the normal_ implementation disagrees:

>>> t = torch.rand(2, 3, device='meta')
>>> t.normal_(mean=4, std=0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: normal_ expects std > 0.0, but found std=0
>>>
>>>
>>> t = torch.rand(2, 3)
>>> t.normal_(mean=4, std=0)
tensor([[4., 4., 4.],
        [4., 4., 4.]])

Fixes #69523.

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Dec 8, 2021

🔗 Helpful links

💊 CI failures summary and remediations

As of commit e76cb4a (more details on the Dr. CI page):


  • 13/13 failures introduced in this PR

🕵️ 13 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See GitHub Actions build win-vs2019-cuda11.3-py3 / test (force_on_cpu, 1, 1, windows.4xlarge) (1/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T23:19:16.8555338Z FAIL [0.016s]: tes...d_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T23:19:16.8549848Z     raise rte
2021-12-08T23:19:16.8550585Z   File "C:\actions-runner\_work\pytorch\pytorch\build\win_tmp\build\torch\testing\_internal\common_device_type.py", line 376, in instantiated_test
2021-12-08T23:19:16.8551269Z     result = test(self, **param_kwargs)
2021-12-08T23:19:16.8551873Z   File "test_tensor_creation_ops.py", line 3327, in test_normal
2021-12-08T23:19:16.8552489Z     helper(self, device, dtype, lambda x: x, lambda t: t, lambda mean: mean)
2021-12-08T23:19:16.8553066Z   File "test_tensor_creation_ops.py", line 3267, in helper
2021-12-08T23:19:16.8553578Z     out = torch.normal(mean=torch.empty((0, 2)), std=torch.empty((0, 1)))
2021-12-08T23:19:16.8554180Z RuntimeError: inconsistent tensor, output size ([0, 2]) is not the same as input size ([0, 1])
2021-12-08T23:19:16.8554549Z 
2021-12-08T23:19:16.8554799Z ======================================================================
2021-12-08T23:19:16.8555338Z FAIL [0.016s]: test_normal_std_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T23:19:16.8555954Z ----------------------------------------------------------------------
2021-12-08T23:19:16.8556448Z RuntimeError: normal expects std >= 0.0, but found std -1
2021-12-08T23:19:16.8556735Z 
2021-12-08T23:19:16.8557138Z During handling of the above exception, another exception occurred:
2021-12-08T23:19:16.8557480Z 
2021-12-08T23:19:16.8557778Z Traceback (most recent call last):
2021-12-08T23:19:16.8558550Z   File "C:\actions-runner\_work\pytorch\pytorch\build\win_tmp\build\torch\testing\_internal\common_device_type.py", line 376, in instantiated_test
2021-12-08T23:19:16.8559221Z     result = test(self, **param_kwargs)
2021-12-08T23:19:16.8559744Z   File "test_tensor_creation_ops.py", line 3336, in test_normal_std_error
2021-12-08T23:19:16.8560182Z     torch.normal(input, -1, (10,))

See GitHub Actions build linux-bionic-py3.6-clang9 / test (default, 2, 2, linux.2xlarge) (2/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T21:34:41.3090099Z FAIL [0.007s]: tes...d_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T21:34:41.3084057Z     raise rte
2021-12-08T21:34:41.3084887Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T21:34:41.3085627Z     result = test(self, **param_kwargs)
2021-12-08T21:34:41.3086149Z   File "test_tensor_creation_ops.py", line 3327, in test_normal
2021-12-08T21:34:41.3086780Z     helper(self, device, dtype, lambda x: x, lambda t: t, lambda mean: mean)
2021-12-08T21:34:41.3087383Z   File "test_tensor_creation_ops.py", line 3267, in helper
2021-12-08T21:34:41.3088004Z     out = torch.normal(mean=torch.empty((0, 2)), std=torch.empty((0, 1)))
2021-12-08T21:34:41.3088726Z RuntimeError: inconsistent tensor, output size ([0, 2]) is not the same as input size ([0, 1])
2021-12-08T21:34:41.3089172Z 
2021-12-08T21:34:41.3089467Z ======================================================================
2021-12-08T21:34:41.3090099Z FAIL [0.007s]: test_normal_std_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T21:34:41.3090976Z ----------------------------------------------------------------------
2021-12-08T21:34:41.3091879Z RuntimeError: normal expects std >= 0.0, but found std -1
2021-12-08T21:34:41.3092221Z 
2021-12-08T21:34:41.3092717Z During handling of the above exception, another exception occurred:
2021-12-08T21:34:41.3093146Z 
2021-12-08T21:34:41.3093486Z Traceback (most recent call last):
2021-12-08T21:34:41.3094412Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T21:34:41.3095166Z     result = test(self, **param_kwargs)
2021-12-08T21:34:41.3095703Z   File "test_tensor_creation_ops.py", line 3336, in test_normal_std_error
2021-12-08T21:34:41.3096322Z     torch.normal(input, -1, (10,))

See GitHub Actions build linux-xenial-py3.6-gcc5.4 / test (default, 2, 2, linux.2xlarge) (3/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T21:29:20.4351199Z FAIL [0.006s]: tes...d_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T21:29:20.4345383Z     raise rte
2021-12-08T21:29:20.4346181Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T21:29:20.4346902Z     result = test(self, **param_kwargs)
2021-12-08T21:29:20.4347404Z   File "test_tensor_creation_ops.py", line 3327, in test_normal
2021-12-08T21:29:20.4347988Z     helper(self, device, dtype, lambda x: x, lambda t: t, lambda mean: mean)
2021-12-08T21:29:20.4348580Z   File "test_tensor_creation_ops.py", line 3267, in helper
2021-12-08T21:29:20.4349157Z     out = torch.normal(mean=torch.empty((0, 2)), std=torch.empty((0, 1)))
2021-12-08T21:29:20.4349856Z RuntimeError: inconsistent tensor, output size ([0, 2]) is not the same as input size ([0, 1])
2021-12-08T21:29:20.4350277Z 
2021-12-08T21:29:20.4350557Z ======================================================================
2021-12-08T21:29:20.4351199Z FAIL [0.006s]: test_normal_std_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T21:29:20.4352044Z ----------------------------------------------------------------------
2021-12-08T21:29:20.4352698Z RuntimeError: normal expects std >= 0.0, but found std -1
2021-12-08T21:29:20.4353102Z 
2021-12-08T21:29:20.4353575Z During handling of the above exception, another exception occurred:
2021-12-08T21:29:20.4353971Z 
2021-12-08T21:29:20.4354296Z Traceback (most recent call last):
2021-12-08T21:29:20.4355191Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T21:29:20.4355897Z     result = test(self, **param_kwargs)
2021-12-08T21:29:20.4356429Z   File "test_tensor_creation_ops.py", line 3336, in test_normal_std_error
2021-12-08T21:29:20.4357025Z     torch.normal(input, -1, (10,))

See GitHub Actions build Lint / quick-checks (4/13)

Step: "Ensure correct trailing newlines" (full log | diagnosis details | 🔁 rerun)

2021-12-08T20:21:12.2994192Z python: can't open..._launches.py': [Errno 2] No such file or directory
2021-12-08T20:21:12.2714154Z ##[group]Run set -eux
2021-12-08T20:21:12.2714601Z �[36;1mset -eux�[0m
2021-12-08T20:21:12.2715304Z �[36;1mpython torch/testing/_check_kernel_launches.py |& tee "${GITHUB_WORKSPACE}"/cuda_kernel_launch_checks.txt�[0m
2021-12-08T20:21:12.2750351Z shell: /bin/bash -e {0}
2021-12-08T20:21:12.2750724Z env:
2021-12-08T20:21:12.2751511Z   pythonLocation: /opt/hostedtoolcache/Python/3.10.0/x64
2021-12-08T20:21:12.2752207Z   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.0/x64/lib
2021-12-08T20:21:12.2752733Z ##[endgroup]
2021-12-08T20:21:12.2820398Z + python torch/testing/_check_kernel_launches.py
2021-12-08T20:21:12.2822188Z + tee /home/runner/work/pytorch/pytorch/cuda_kernel_launch_checks.txt
2021-12-08T20:21:12.2994192Z python: can't open file '/home/runner/work/pytorch/pytorch/torch/testing/_check_kernel_launches.py': [Errno 2] No such file or directory
2021-12-08T20:21:12.3067194Z ##[group]Run (! git --no-pager grep -I -no $'#include <cub/' --  ./aten  ':(exclude)aten/src/ATen/cuda/cub*.cuh' || (echo "The above files have direct cub include; please include ATen/cuda/cub.cuh instead and wrap your cub calls in at::native namespace if necessary"; false))
2021-12-08T20:21:12.3069298Z �[36;1m(! git --no-pager grep -I -no $'#include <cub/' --  ./aten  ':(exclude)aten/src/ATen/cuda/cub*.cuh' || (echo "The above files have direct cub include; please include ATen/cuda/cub.cuh instead and wrap your cub calls in at::native namespace if necessary"; false))�[0m
2021-12-08T20:21:12.3107552Z shell: /bin/bash -e {0}
2021-12-08T20:21:12.3107974Z env:
2021-12-08T20:21:12.3108560Z   pythonLocation: /opt/hostedtoolcache/Python/3.10.0/x64
2021-12-08T20:21:12.3109373Z   LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.0/x64/lib
2021-12-08T20:21:12.3109976Z ##[endgroup]
2021-12-08T20:21:12.3444774Z ##[group]Run (! git --no-pager grep -I -no $'cudaStreamSynchronize' --  ./aten ./c10 ':(exclude)aten/src/ATen/test' ':(exclude)c10/cuda/CUDAFunctions.h' || (echo "The above files call raw cuda APIs directly; please use at::cuda wrappers instead"; false))
2021-12-08T20:21:12.3446704Z �[36;1m(! git --no-pager grep -I -no $'cudaStreamSynchronize' --  ./aten ./c10 ':(exclude)aten/src/ATen/test' ':(exclude)c10/cuda/CUDAFunctions.h' || (echo "The above files call raw cuda APIs directly; please use at::cuda wrappers instead"; false))�[0m
2021-12-08T20:21:12.3483974Z shell: /bin/bash -e {0}

See GitHub Actions build linux-bionic-py3.6-clang9 / test (xla, 1, 1, linux.2xlarge) (5/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T22:04:51.5509582Z �[0;31m[ FAILED ] �[mAtenXlaTensorTest.TestKlDivBackward
2021-12-08T22:04:51.5497653Z �[0;32m[ RUN      ] �[mXlaUtilCacheTest.BasicTest
2021-12-08T22:04:51.5498835Z �[0;32m[       OK ] �[mXlaUtilCacheTest.BasicTest (0 ms)
2021-12-08T22:04:51.5499965Z �[0;32m[----------] �[m1 test from XlaUtilCacheTest (0 ms total)
2021-12-08T22:04:51.5502190Z 
2021-12-08T22:04:51.5503179Z �[0;32m[----------] �[mGlobal test environment tear-down
2021-12-08T22:04:51.5504197Z �[0;32m[==========] �[m618 tests from 8 test suites ran. (307181 ms total)
2021-12-08T22:04:51.5504979Z �[0;32m[  PASSED  ] �[m616 tests.
2021-12-08T22:04:51.5505719Z �[0;32m[  SKIPPED ] �[m1 test, listed below:
2021-12-08T22:04:51.5507021Z �[0;32m[  SKIPPED ] �[mAtenXlaTensorTest.TestGroupNormBackward
2021-12-08T22:04:51.5508301Z �[0;31m[  FAILED  ] �[m1 test, listed below:
2021-12-08T22:04:51.5509582Z �[0;31m[  FAILED  ] �[mAtenXlaTensorTest.TestKlDivBackward
2021-12-08T22:04:51.5510377Z 
2021-12-08T22:04:51.5510777Z  1 FAILED TEST
2021-12-08T22:04:51.6951601Z + cleanup
2021-12-08T22:04:51.6952184Z + retcode=1
2021-12-08T22:04:51.6952633Z + set +x
2021-12-08T22:04:51.6990704Z ##[error]Process completed with exit code 1.
2021-12-08T22:04:51.7073960Z ##[group]Run # Ensure the working directory gets chowned back to the current user
2021-12-08T22:04:51.7074736Z �[36;1m# Ensure the working directory gets chowned back to the current user�[0m
2021-12-08T22:04:51.7075380Z �[36;1mdocker run --rm -v "$(pwd)":/v -w /v "${ALPINE_IMAGE}" chown -R "$(id -u):$(id -g)" .�[0m
2021-12-08T22:04:51.7508236Z shell: /usr/bin/bash -e {0}

See GitHub Actions build linux-bionic-py3.6-clang9 / test (default, 1, 2, linux.2xlarge) (6/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T21:25:21.6875550Z AssertionError: can only test a child process
2021-12-08T21:25:21.6737835Z     assert self._parent_pid == os.getpid(), 'can only test a child process'
2021-12-08T21:25:21.6738496Z AssertionError: can only test a child process
2021-12-08T21:25:21.6865604Z Exception ignored in: <bound method _MultiProcessingDataLoaderIter.__del__ of <torch.utils.data.dataloader._MultiProcessingDataLoaderIter object at 0x7fc7176a85f8>>
2021-12-08T21:25:21.6867526Z Traceback (most recent call last):
2021-12-08T21:25:21.6869105Z   File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1328, in __del__
2021-12-08T21:25:21.6870117Z     self._shutdown_workers()
2021-12-08T21:25:21.6871443Z   File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1320, in _shutdown_workers
2021-12-08T21:25:21.6872454Z     if w.is_alive():
2021-12-08T21:25:21.6873330Z   File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 134, in is_alive
2021-12-08T21:25:21.6874599Z     assert self._parent_pid == os.getpid(), 'can only test a child process'
2021-12-08T21:25:21.6875550Z AssertionError: can only test a child process
2021-12-08T21:25:22.3727985Z ok (0.715s)
2021-12-08T21:25:22.3752433Z   test_iterabledataset_len (__main__.TestDataLoaderPersistentWorkers) ... ok (0.002s)
2021-12-08T21:25:23.9854766Z   test_large_sampler_indices (__main__.TestDataLoaderPersistentWorkers) ... ok (1.610s)
2021-12-08T21:25:23.9922505Z   test_len (__main__.TestDataLoaderPersistentWorkers) ... ok (0.007s)
2021-12-08T21:25:25.5567052Z   test_multiple_dataloaders (__main__.TestDataLoaderPersistentWorkers) ... ok (1.564s)
2021-12-08T21:25:28.8761915Z   test_multiprocessing_contexts (__main__.TestDataLoaderPersistentWorkers) ... ok (3.319s)
2021-12-08T21:25:29.7180579Z   test_no_segfault (__main__.TestDataLoaderPersistentWorkers) ... ok (0.842s)
2021-12-08T21:25:29.7214454Z   test_numpy (__main__.TestDataLoaderPersistentWorkers) ... ok (0.003s)
2021-12-08T21:25:29.7243635Z   test_numpy_gen_state (__main__.TestDataLoaderPersistentWorkers) ... ok (0.003s)
2021-12-08T21:25:29.7268559Z   test_numpy_scalars (__main__.TestDataLoaderPersistentWorkers) ... ok (0.002s)

See GitHub Actions build linux-bionic-cuda11.5-py3.6-gcc7 / test (default, 2, 2, linux.4xlarge.nvidia.gpu) (7/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T22:04:27.7412545Z AssertionError: can only test a child process
2021-12-08T22:04:27.7212905Z     assert self._parent_pid == os.getpid(), 'can only test a child process'
2021-12-08T22:04:27.7221029Z AssertionError: can only test a child process
2021-12-08T22:04:27.7402737Z Exception ignored in: <bound method _MultiProcessingDataLoaderIter.__del__ of <torch.utils.data.dataloader._MultiProcessingDataLoaderIter object at 0x7f4d316852b0>>
2021-12-08T22:04:27.7404782Z Traceback (most recent call last):
2021-12-08T22:04:27.7406445Z   File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1328, in __del__
2021-12-08T22:04:27.7407385Z     self._shutdown_workers()
2021-12-08T22:04:27.7408967Z   File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1320, in _shutdown_workers
2021-12-08T22:04:27.7409969Z     if w.is_alive():
2021-12-08T22:04:27.7410685Z   File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 134, in is_alive
2021-12-08T22:04:27.7411787Z     assert self._parent_pid == os.getpid(), 'can only test a child process'
2021-12-08T22:04:27.7412545Z AssertionError: can only test a child process
2021-12-08T22:04:29.1623291Z ok (1.504s)
2021-12-08T22:04:29.1654480Z   test_iterabledataset_len (__main__.TestDataLoaderPersistentWorkers) ... ok (0.003s)
2021-12-08T22:04:31.6429163Z   test_large_sampler_indices (__main__.TestDataLoaderPersistentWorkers) ... ok (2.477s)
2021-12-08T22:04:31.6536864Z   test_len (__main__.TestDataLoaderPersistentWorkers) ... ok (0.011s)
2021-12-08T22:04:34.1555522Z   test_multiple_dataloaders (__main__.TestDataLoaderPersistentWorkers) ... ok (2.501s)
2021-12-08T22:04:37.7658470Z   test_multiprocessing_contexts (__main__.TestDataLoaderPersistentWorkers) ... [W CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]
2021-12-08T22:04:37.7660917Z [W CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]
2021-12-08T22:04:37.7685760Z [W CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]
2021-12-08T22:04:41.4227439Z [W CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]
2021-12-08T22:04:41.4229036Z [W CudaIPCTypes.cpp:15] Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]

See GitHub Actions build win-vs2019-cpu-py3 / test (default, 2, 2, windows.4xlarge) (8/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T22:50:18.3608361Z RuntimeError: test_torch failed!
2021-12-08T22:50:18.0561230Z Generated XML report: test-reports\dist-gloo\test_torch\TEST-TestTorchDeviceTypeCPU-20211208225005.xml
2021-12-08T22:50:18.0562601Z Generated XML report: test-reports\dist-gloo\test_torch\TEST-TestVitalSignsCudaCPU-20211208225005.xml
2021-12-08T22:50:18.3364612Z [TORCH_VITAL] CUDA.used		 False
2021-12-08T22:50:18.3365191Z [TORCH_VITAL] Dataloader.basic_unit_test		 TEST_VALUE_STRING
2021-12-08T22:50:18.3365745Z [TORCH_VITAL] Dataloader.enabled		 True
2021-12-08T22:50:18.3605774Z Traceback (most recent call last):
2021-12-08T22:50:18.3606689Z   File "run_test.py", line 1058, in <module>
2021-12-08T22:50:18.3607045Z     main()
2021-12-08T22:50:18.3607484Z   File "run_test.py", line 1036, in main
2021-12-08T22:50:18.3607929Z     raise RuntimeError(err_message)
2021-12-08T22:50:18.3608361Z RuntimeError: test_torch failed!
2021-12-08T22:50:18.6649853Z 
2021-12-08T22:50:18.6650598Z (base) C:\actions-runner\_work\pytorch\pytorch\test>popd
2021-12-08T22:50:18.6655018Z 
2021-12-08T22:50:18.6655716Z (base) C:\actions-runner\_work\pytorch\pytorch>if ERRORLEVEL 1 exit /b 1 
2021-12-08T22:50:18.6692647Z + cleanup
2021-12-08T22:50:18.6693056Z + retcode=1
2021-12-08T22:50:18.6693329Z + set +x
2021-12-08T22:50:18.6752604Z ##[error]Process completed with exit code 1.
2021-12-08T22:50:18.7113631Z ##[group]Run # -ir => recursive include all files in pattern
2021-12-08T22:50:18.7114327Z �[36;1m# -ir => recursive include all files in pattern�[0m

See GitHub Actions build linux-xenial-py3.6-gcc7 / test (default, 2, 2, linux.2xlarge) (9/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T21:33:04.9744949Z FAIL [0.006s]: tes...d_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T21:33:04.9739545Z     raise rte
2021-12-08T21:33:04.9740294Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T21:33:04.9740963Z     result = test(self, **param_kwargs)
2021-12-08T21:33:04.9741419Z   File "test_tensor_creation_ops.py", line 3327, in test_normal
2021-12-08T21:33:04.9741978Z     helper(self, device, dtype, lambda x: x, lambda t: t, lambda mean: mean)
2021-12-08T21:33:04.9742515Z   File "test_tensor_creation_ops.py", line 3267, in helper
2021-12-08T21:33:04.9743073Z     out = torch.normal(mean=torch.empty((0, 2)), std=torch.empty((0, 1)))
2021-12-08T21:33:04.9743707Z RuntimeError: inconsistent tensor, output size ([0, 2]) is not the same as input size ([0, 1])
2021-12-08T21:33:04.9744103Z 
2021-12-08T21:33:04.9744381Z ======================================================================
2021-12-08T21:33:04.9744949Z FAIL [0.006s]: test_normal_std_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T21:33:04.9745720Z ----------------------------------------------------------------------
2021-12-08T21:33:04.9746338Z RuntimeError: normal expects std >= 0.0, but found std -1
2021-12-08T21:33:04.9746649Z 
2021-12-08T21:33:04.9747081Z During handling of the above exception, another exception occurred:
2021-12-08T21:33:04.9747453Z 
2021-12-08T21:33:04.9747759Z Traceback (most recent call last):
2021-12-08T21:33:04.9748578Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T21:33:04.9749250Z     result = test(self, **param_kwargs)
2021-12-08T21:33:04.9749727Z   File "test_tensor_creation_ops.py", line 3336, in test_normal_std_error
2021-12-08T21:33:04.9750287Z     torch.normal(input, -1, (10,))

See GitHub Actions build linux-xenial-py3.6-clang7-asan / test (default, 2, 2, linux.2xlarge) (10/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T23:08:22.9525796Z FAIL [0.011s]: tes...d_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T23:08:22.9519941Z     raise rte
2021-12-08T23:08:22.9520973Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T23:08:22.9521696Z     result = test(self, **param_kwargs)
2021-12-08T23:08:22.9522161Z   File "test_tensor_creation_ops.py", line 3327, in test_normal
2021-12-08T23:08:22.9522741Z     helper(self, device, dtype, lambda x: x, lambda t: t, lambda mean: mean)
2021-12-08T23:08:22.9523315Z   File "test_tensor_creation_ops.py", line 3267, in helper
2021-12-08T23:08:22.9523865Z     out = torch.normal(mean=torch.empty((0, 2)), std=torch.empty((0, 1)))
2021-12-08T23:08:22.9524530Z RuntimeError: inconsistent tensor, output size ([0, 2]) is not the same as input size ([0, 1])
2021-12-08T23:08:22.9524940Z 
2021-12-08T23:08:22.9525209Z ======================================================================
2021-12-08T23:08:22.9525796Z FAIL [0.011s]: test_normal_std_error_cpu (__main__.TestRandomTensorCreationCPU)
2021-12-08T23:08:22.9526581Z ----------------------------------------------------------------------
2021-12-08T23:08:22.9527215Z RuntimeError: normal expects std >= 0.0, but found std -1
2021-12-08T23:08:22.9527535Z 
2021-12-08T23:08:22.9527980Z During handling of the above exception, another exception occurred:
2021-12-08T23:08:22.9528363Z 
2021-12-08T23:08:22.9528692Z Traceback (most recent call last):
2021-12-08T23:08:22.9529676Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T23:08:22.9530368Z     result = test(self, **param_kwargs)
2021-12-08T23:08:22.9530875Z   File "test_tensor_creation_ops.py", line 3336, in test_normal_std_error
2021-12-08T23:08:22.9531436Z     torch.normal(input, -1, (10,))

See GitHub Actions build linux-xenial-cuda11.3-py3.6-gcc7 / test (default, 1, 2, linux.4xlarge.nvidia.gpu) (11/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T22:27:01.2208530Z RuntimeError: test_torch failed!
2021-12-08T22:27:00.6115043Z Generated XML report: test-reports/python-unittest/test_torch/TEST-TestTorchDeviceTypeCUDA-20211208222522.xml
2021-12-08T22:27:00.6118454Z Generated XML report: test-reports/python-unittest/test_torch/TEST-TestVitalSignsCudaCUDA-20211208222522.xml
2021-12-08T22:27:01.0698088Z [TORCH_VITAL] Dataloader.enabled		 True
2021-12-08T22:27:01.0699395Z [TORCH_VITAL] Dataloader.basic_unit_test		 TEST_VALUE_STRING
2021-12-08T22:27:01.0700065Z [TORCH_VITAL] CUDA.used		 true
2021-12-08T22:27:01.2201393Z Traceback (most recent call last):
2021-12-08T22:27:01.2202533Z   File "test/run_test.py", line 1058, in <module>
2021-12-08T22:27:01.2204373Z     main()
2021-12-08T22:27:01.2205458Z   File "test/run_test.py", line 1036, in main
2021-12-08T22:27:01.2207381Z     raise RuntimeError(err_message)
2021-12-08T22:27:01.2208530Z RuntimeError: test_torch failed!
2021-12-08T22:27:01.7087764Z + cleanup
2021-12-08T22:27:01.7088734Z + retcode=1
2021-12-08T22:27:01.7089456Z + set +x
2021-12-08T22:27:01.7137446Z ##[error]Process completed with exit code 1.
2021-12-08T22:27:01.7204802Z ##[group]Run # Ensure the working directory gets chowned back to the current user
2021-12-08T22:27:01.7205843Z �[36;1m# Ensure the working directory gets chowned back to the current user�[0m
2021-12-08T22:27:01.7206660Z �[36;1mdocker run --rm -v "$(pwd)":/v -w /v "${ALPINE_IMAGE}" chown -R "$(id -u):$(id -g)" .�[0m
2021-12-08T22:27:01.7219080Z shell: /usr/bin/bash -e {0}
2021-12-08T22:27:01.7219508Z env:
2021-12-08T22:27:01.7220198Z   BUILD_ENVIRONMENT: linux-xenial-cuda11.3-py3.6-gcc7

See GitHub Actions build linux-xenial-py3.6-gcc5.4 / test (default, 1, 2, linux.2xlarge) (12/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T21:25:02.9726308Z AssertionError: can only test a child process
2021-12-08T21:25:02.9703629Z     assert self._parent_pid == os.getpid(), 'can only test a child process'
2021-12-08T21:25:02.9704180Z AssertionError: can only test a child process
2021-12-08T21:25:02.9715598Z Exception ignored in: <bound method _MultiProcessingDataLoaderIter.__del__ of <torch.utils.data.dataloader._MultiProcessingDataLoaderIter object at 0x7fb19589afd0>>
2021-12-08T21:25:02.9717200Z Traceback (most recent call last):
2021-12-08T21:25:02.9719517Z   File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1328, in __del__
2021-12-08T21:25:02.9722026Z     self._shutdown_workers()
2021-12-08T21:25:02.9723095Z   File "/opt/conda/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1320, in _shutdown_workers
2021-12-08T21:25:02.9723871Z     if w.is_alive():
2021-12-08T21:25:02.9724541Z   File "/opt/conda/lib/python3.6/multiprocessing/process.py", line 134, in is_alive
2021-12-08T21:25:02.9725567Z     assert self._parent_pid == os.getpid(), 'can only test a child process'
2021-12-08T21:25:02.9726308Z AssertionError: can only test a child process
2021-12-08T21:25:03.5853399Z ok (0.629s)
2021-12-08T21:25:03.5875121Z   test_iterabledataset_len (__main__.TestDataLoaderPersistentWorkers) ... ok (0.002s)
2021-12-08T21:25:05.1643311Z   test_large_sampler_indices (__main__.TestDataLoaderPersistentWorkers) ... ok (1.577s)
2021-12-08T21:25:05.1714524Z   test_len (__main__.TestDataLoaderPersistentWorkers) ... ok (0.007s)
2021-12-08T21:25:06.6625108Z   test_multiple_dataloaders (__main__.TestDataLoaderPersistentWorkers) ... ok (1.491s)
2021-12-08T21:25:09.8232514Z   test_multiprocessing_contexts (__main__.TestDataLoaderPersistentWorkers) ... ok (3.161s)
2021-12-08T21:25:10.6122280Z   test_no_segfault (__main__.TestDataLoaderPersistentWorkers) ... ok (0.789s)
2021-12-08T21:25:10.6154791Z   test_numpy (__main__.TestDataLoaderPersistentWorkers) ... ok (0.003s)
2021-12-08T21:25:10.6183798Z   test_numpy_gen_state (__main__.TestDataLoaderPersistentWorkers) ... ok (0.003s)
2021-12-08T21:25:10.6208489Z   test_numpy_scalars (__main__.TestDataLoaderPersistentWorkers) ... ok (0.002s)

See GitHub Actions build linux-bionic-py3.6-clang9 / test (noarch, 1, 1, linux.2xlarge) (13/13)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

2021-12-08T22:05:31.4221076Z FAIL [0.007s]: tes...error_meta (__main__.TestRandomTensorCreationMETA)
2021-12-08T22:05:31.4211459Z During handling of the above exception, another exception occurred:
2021-12-08T22:05:31.4212171Z 
2021-12-08T22:05:31.4212734Z Traceback (most recent call last):
2021-12-08T22:05:31.4214296Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T22:05:31.4215742Z     result = test(self, **param_kwargs)
2021-12-08T22:05:31.4216551Z   File "test_tensor_creation_ops.py", line 3336, in test_normal_std_error
2021-12-08T22:05:31.4217575Z     torch.normal(input, -1, (10,))
2021-12-08T22:05:31.4218707Z AssertionError: "normal_ expects std >= 0.0" does not match "normal expects std >= 0.0, but found std -1"
2021-12-08T22:05:31.4219678Z 
2021-12-08T22:05:31.4220145Z ======================================================================
2021-12-08T22:05:31.4221076Z FAIL [0.007s]: test_normal_std_error_meta (__main__.TestRandomTensorCreationMETA)
2021-12-08T22:05:31.4222384Z ----------------------------------------------------------------------
2021-12-08T22:05:31.4223444Z RuntimeError: normal expects std >= 0.0, but found std -1
2021-12-08T22:05:31.4223961Z 
2021-12-08T22:05:31.4224801Z During handling of the above exception, another exception occurred:
2021-12-08T22:05:31.4225522Z 
2021-12-08T22:05:31.4226042Z Traceback (most recent call last):
2021-12-08T22:05:31.4227343Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_utils.py", line 1470, in wrapper
2021-12-08T22:05:31.4228373Z     method(*args, **kwargs)
2021-12-08T22:05:31.4229926Z   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_device_type.py", line 376, in instantiated_test
2021-12-08T22:05:31.4231247Z     result = test(self, **param_kwargs)

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@pytorch-probot
Copy link

pytorch-probot bot commented Dec 8, 2021

CI Flow Status

⚛️ CI Flow

Ruleset - Version: v1
Ruleset - File: https://github.com/pytorch/pytorch/blob/e76cb4a3e3625b475e44c6db1bf4ed9284e5fbeb/.github/generated-ciflow-ruleset.json
PR ciflow labels: ciflow/default

Workflows Labels (bold enabled) Status
Triggered Workflows
linux-bionic-cuda11.5-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/default, ciflow/linux ✅ triggered
linux-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/noarch, ciflow/xla ✅ triggered
linux-docs ciflow/all, ciflow/cpu, ciflow/default, ciflow/docs, ciflow/linux ✅ triggered
linux-vulkan-bionic-py3.6-clang9 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/vulkan ✅ triggered
linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3-clang5-mobile-build ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3-clang5-mobile-custom-build-static ciflow/all, ciflow/default, ciflow/linux, ciflow/mobile ✅ triggered
linux-xenial-py3.6-clang7-asan ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/sanitizers ✅ triggered
linux-xenial-py3.6-clang7-onnx ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux, ciflow/onnx ✅ triggered
linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7 ciflow/all, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
linux-xenial-py3.6-gcc7-bazel-test ciflow/all, ciflow/bazel, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
pytorch-linux-xenial-py3-clang5-android-ndk-r19c-gradle-custom-build-single-full-jit ciflow/all, ciflow/android, ciflow/cpu, ciflow/default, ciflow/linux ✅ triggered
win-vs2019-cpu-py3 ciflow/all, ciflow/cpu, ciflow/default, ciflow/win ✅ triggered
win-vs2019-cuda11.3-py3 ciflow/all, ciflow/cuda, ciflow/default, ciflow/win ✅ triggered
Skipped Workflows
caffe2-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
docker-builds ciflow/all 🚫 skipped
ios-12-5-1-arm64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-custom-ops ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-arm64-metal ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64 ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-coreml ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
ios-12-5-1-x86-64-full-jit ciflow/all, ciflow/ios, ciflow/macos 🚫 skipped
libtorch-linux-bionic-cuda11.5-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
libtorch-linux-xenial-cuda10.2-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
libtorch-linux-xenial-cuda11.3-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux 🚫 skipped
linux-bionic-cuda10.2-py3.9-gcc7 ciflow/all, ciflow/cuda, ciflow/linux, ciflow/slow 🚫 skipped
linux-docs-push ciflow/all, ciflow/cpu, ciflow/linux, ciflow/scheduled 🚫 skipped
macos-10-15-py3-arm64 ciflow/all, ciflow/macos 🚫 skipped
macos-10-15-py3-lite-interpreter-x86-64 ciflow/all, ciflow/macos 🚫 skipped
macos-11-py3-x86-64 ciflow/all, ciflow/macos 🚫 skipped
parallelnative-linux-xenial-py3.6-gcc5.4 ciflow/all, ciflow/cpu, ciflow/linux 🚫 skipped
periodic-libtorch-linux-xenial-cuda11.1-py3.6-gcc7 ciflow/all, ciflow/cuda, ciflow/libtorch, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-linux-xenial-cuda10.2-py3-gcc7-slow-gradcheck ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled, ciflow/slow, ciflow/slow-gradcheck 🚫 skipped
periodic-linux-xenial-cuda11.1-py3.6-gcc7-debug ciflow/all, ciflow/cuda, ciflow/linux, ciflow/scheduled 🚫 skipped
periodic-win-vs2019-cuda11.1-py3 ciflow/all, ciflow/cuda, ciflow/scheduled, ciflow/win 🚫 skipped

You can add a comment to the PR and tag @pytorchbot with the following commands:
# ciflow rerun, "ciflow/default" will always be added automatically
@pytorchbot ciflow rerun

# ciflow rerun with additional labels "-l <ciflow/label_name>", which is equivalent to adding these labels manually and trigger the rerun
@pytorchbot ciflow rerun -l ciflow/scheduled -l ciflow/slow

For more information, please take a look at the CI Flow Wiki.

Copy link
Collaborator

@lezcano lezcano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!
Could you please add a test that tests this behaviour for all the normal variants? Whenever std is zero (or all zeros), torch.normal should return a vector of the correct size with the inputs of mean.

@nkaretnikov
Copy link
Collaborator Author

Makes sense! Could you please add a test that tests this behaviour for all the normal variants? Whenever std is zero (or all zeros), torch.normal should return a vector of the correct size with the inputs of mean.

@lezcano i can, but shouldn't it be done when the normal opfino lands? or is it okay to have tests without opinfos? (i haven't looked much into it.)

@nkaretnikov
Copy link
Collaborator Author

to avoid confusion, will open a new stack to address issues related to BC and broadcasting

@facebook-github-bot facebook-github-bot deleted the gh/nkaretnikov/4/head branch January 15, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants