synchronization methods, modified on a new stream. The two kernels
will run concurrently on the same tensor, which might cause the second
kernel to read uninitialized data before the first one was able to
write it, or the first kernel might overwrite part of the result of
the second. When this script is run on the commandline with:
TORCH_CUDA_SANITIZER=1 python example_error.py
the following output is printed by CSAN:
============================
   CSAN detected a possible data race on tensor with data pointer 139719969079296
   Access by stream 94646435460352 during kernel:
   aten::mul.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
   writing to argument(s) self, out, and to the output
   With stack trace:
     File "example_error.py", line 6, in 
       torch.mul(a, 5, out=a)
     ...
     File "pytorch/torch/cuda/_sanitizer.py", line 364, in _handle_kernel_launch
       stack_trace = traceback.StackSummary.extract(
Previous access by stream 0 during kernel: