split torch.testing._internal.* and add type checking for torch.testing._internal.common_cuda (#44575)

Summary:
First step to fix https://github.com/pytorch/pytorch/issues/42969.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/44575

Reviewed By: malfet

Differential Revision: D23668740

Pulled By: walterddr

fbshipit-source-id: eeb3650b1780aaa5727b525b4e6182e1bc47a83f
This commit is contained in:
Rong Rong 2020-09-14 13:49:59 -07:00 committed by Facebook GitHub Bot
parent cfba33bde3
commit b5dd6e3e61
2 changed files with 50 additions and 2 deletions

View File

@ -53,7 +53,55 @@ ignore_errors = True
[mypy-torch.distributed.*] [mypy-torch.distributed.*]
ignore_errors = True ignore_errors = True
[mypy-torch.testing._internal.*] [mypy-torch.testing._internal.te_utils.*]
ignore_errors = True
[mypy-torch.testing._internal.dist_utils.*]
ignore_errors = True
[mypy-torch.testing._internal.codegen.*]
ignore_errors = True
# [mypy-torch.testing._internal.common_cuda.*]
# ignore_errors = True
[mypy-torch.testing._internal.common_quantized.*]
ignore_errors = True
[mypy-torch.testing._internal.common_distributed.*]
ignore_errors = True
[mypy-torch.testing._internal.jit_utils.*]
ignore_errors = True
[mypy-torch.testing._internal.common_device_type.*]
ignore_errors = True
[mypy-torch.testing._internal.autocast_test_lists.*]
ignore_errors = True
[mypy-torch.testing._internal.hypothesis_utils.*]
ignore_errors = True
[mypy-torch.testing._internal.common_methods_invocations.*]
ignore_errors = True
[mypy-torch.testing._internal.jit_metaprogramming_utils.*]
ignore_errors = True
[mypy-torch.testing._internal.common_nn.*]
ignore_errors = True
[mypy-torch.testing._internal.common_quantization.*]
ignore_errors = True
[mypy-torch.testing._internal.common_utils.*]
ignore_errors = True
[mypy-torch.testing._internal.generated.*]
ignore_errors = True
[mypy-torch.testing._internal.distributed.*]
ignore_errors = True ignore_errors = True
[mypy-torch.quantization.observer] [mypy-torch.quantization.observer]

View File

@ -10,7 +10,7 @@ import contextlib
TEST_CUDA = torch.cuda.is_available() TEST_CUDA = torch.cuda.is_available()
TEST_MULTIGPU = TEST_CUDA and torch.cuda.device_count() >= 2 TEST_MULTIGPU = TEST_CUDA and torch.cuda.device_count() >= 2
CUDA_DEVICE = TEST_CUDA and torch.device("cuda:0") CUDA_DEVICE = torch.device("cuda:0") if TEST_CUDA else None
# note: if ROCm is targeted, TEST_CUDNN is code for TEST_MIOPEN # note: if ROCm is targeted, TEST_CUDNN is code for TEST_MIOPEN
TEST_CUDNN = TEST_CUDA and torch.backends.cudnn.is_acceptable(torch.tensor(1., device=CUDA_DEVICE)) TEST_CUDNN = TEST_CUDA and torch.backends.cudnn.is_acceptable(torch.tensor(1., device=CUDA_DEVICE))
TEST_CUDNN_VERSION = torch.backends.cudnn.version() if TEST_CUDNN else 0 TEST_CUDNN_VERSION = torch.backends.cudnn.version() if TEST_CUDNN else 0