Skip to content
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

[FBcode->GH] Set torch.set_deterministic to false for GPU tests (#3422) #3435

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

fmassa
Copy link
Member

@fmassa fmassa commented Feb 23, 2021

Summary:
Pull Request resolved: #3422

In CUDA-10.1 or below it is a no-op, but few of the tests will start to fail if update to 10.2 or newer, for example:

torchvision/transforms/transforms.py", line 1043, in forward
    transformed_tensor = torch.mm(flat_tensor, self.transformation_matrix)
RuntimeError: Deterministic behavior was enabled with either `torch.use_deterministic_algorithms(True)` or `at::Context::setDeterministicAlgorithms(true)`, but this operation is not deterministic because it uses CuBLAS and you have CUDA >= 10.2. To enable deterministic behavior in this case, you must set an environment variable before running your PyTorch application: CUBLAS_WORKSPACE_CONFIG=:4096:8 or CUBLAS_WORKSPACE_CONFIG=:16:8. For more information, go to https://docs.nvidia.com/cuda/cublas/index.html#cublasApi_reproducibility

Reviewed By: meyering

Differential Revision: D26563045

fbshipit-source-id: 65e5fabc8cdb471a72f931df55389ed7c0063e54

Summary:
Pull Request resolved: pytorch#3422

In CUDA-10.1 or below it is a no-op, but few of the tests will start to fail if update to 10.2 or newer, for example:
```
torchvision/transforms/transforms.py", line 1043, in forward
    transformed_tensor = torch.mm(flat_tensor, self.transformation_matrix)
RuntimeError: Deterministic behavior was enabled with either `torch.use_deterministic_algorithms(True)` or `at::Context::setDeterministicAlgorithms(true)`, but this operation is not deterministic because it uses CuBLAS and you have CUDA >= 10.2. To enable deterministic behavior in this case, you must set an environment variable before running your PyTorch application: CUBLAS_WORKSPACE_CONFIG=:4096:8 or CUBLAS_WORKSPACE_CONFIG=:16:8. For more information, go to https://docs.nvidia.com/cuda/cublas/index.html#cublasApi_reproducibility
```

Reviewed By: meyering

Differential Revision: D26563045

fbshipit-source-id: 65e5fabc8cdb471a72f931df55389ed7c0063e54
@fmassa fmassa merged commit b7f3c81 into pytorch:master Feb 23, 2021
@fmassa fmassa deleted the import_3422 branch February 23, 2021 11: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.

None yet

4 participants