[ROCm] improve docker packages, fix bugs, enable tests, enable FFT#10893
[ROCm] improve docker packages, fix bugs, enable tests, enable FFT#10893iotamudelta wants to merge 542 commits intopytorch:masterfrom
Conversation
iotamudelta
commented
Aug 27, 2018
- improve docker packages (install OpenBLAS to have at-compile-time LAPACK functionality w/ optimizations for both Intel and AMD CPUs)
- integrate rocFFT (i.e., enable Fourier functionality)
- fix bugs in ROCm caused by wrong warp size
- enable more test sets, skip the tests that don't work on ROCm yet
- don't disable asserts any longer in hipification
- small improvements
…RAND_PR While there, add the remaining changes requested in upstream PR pytorch#10266
Reported by: bddqqp
Merge from upstream
Refactor unit test skip statements to use @skipIfRocm annotation
Merge from upstream
Replace hcRNG with rocRAND.
… tests for ROCm CI builds
Merge from upstream
aten/src/THC/THCScanUtils.cuh
Outdated
| #include "THCDeviceUtils.cuh" | ||
|
|
||
| #if defined(__HIP_PLATFORM_HCC__) | ||
| #define WARP_SIZE 64 |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| sliceSize, \ | ||
| k, \ | ||
| inputSlices, \ | ||
| static_cast<INDEX_T>(sliceSize), \ |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| install_ubuntu() { | ||
| apt-get update | ||
| apt-get install -y wget | ||
| apt-get install -y libopenblas-dev |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| TEST_MULTIGPU = TEST_CUDA and torch.cuda.device_count() >= 2 | ||
| CUDA_DEVICE = TEST_CUDA and torch.device("cuda:0") | ||
| TEST_CUDNN = TEST_CUDA and torch.backends.cudnn.is_acceptable(torch.tensor(1., device=CUDA_DEVICE)) | ||
| TEST_CUDNN = TEST_CUDA and (TEST_WITH_ROCM or torch.backends.cudnn.is_acceptable(torch.tensor(1., device=CUDA_DEVICE))) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| input_size=(4, 10), | ||
| reference_fn=lambda i, p: torch.mm(i, p[0].t()) + p[1].view(1, -1).expand(4, 8) | ||
| reference_fn=lambda i, p: torch.mm(i, p[0].t()) + p[1].view(1, -1).expand(4, 8), | ||
| test_cuda=(not TEST_WITH_ROCM) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| tests = [ | ||
| ('add', small_3d, lambda t: [number(3.14, 3, t)]), | ||
| ('add', small_3d, lambda t: [number(3.14, 3, t)], '', types, False, | ||
| "skipIfRocm:ByteTensor,CharTensor,HalfTensor,ShortTensor"), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
test/test_cuda.py
Outdated
| ('lerp', small_3d, lambda t: [small_3d(t), 0.3], '', types, False, "skipIfRocm:HalfTensor"), | ||
| ('max', small_3d_unique, lambda t: [], '', types, False, "skipIfRocm:HalfTensor"), | ||
| ('max', small_3d_unique, lambda t: [1], 'dim', types, False, | ||
| "skipIfRocm:ByteTensor,CharTensor,DoubleTensor,FloatTensor,HalfTensor,IntTensor,LongTensor,ShortTensor"), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| if not filepath.endswith("THCGeneral.h.in"): | ||
| output_source = disable_asserts(output_source) | ||
| # if not filepath.endswith("THCGeneral.h.in"): | ||
| # output_source = disable_asserts(output_source) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
ezyang
left a comment
There was a problem hiding this comment.
I'm primarily concerned with two things:
- The
&sizesin the FFT bindings https://github.com/pytorch/pytorch/pull/10893/files#r214418319 . This just looks totally wrong and I don't want to merge code that's wrong. - The manual specification of each of the types Float/Long/Int/etc... in the tests. This seems really delicate, and it would be much better if we weren't banging these out manually; instead, there should be predefined strings for the most common combinations of types that don't work.
|
@pytorchbot retest this please |
facebook-github-bot
left a comment
There was a problem hiding this comment.
ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Unfortunately the CUDA naming is ubiquitous and not removable.
|
@jithunnair-amd can you comment on point no 2? Thanks! |
test_cuda - skipping all the types with skipIfRocm
facebook-github-bot
left a comment
There was a problem hiding this comment.
ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: * improve docker packages (install OpenBLAS to have at-compile-time LAPACK functionality w/ optimizations for both Intel and AMD CPUs) * integrate rocFFT (i.e., enable Fourier functionality) * fix bugs in ROCm caused by wrong warp size * enable more test sets, skip the tests that don't work on ROCm yet * don't disable asserts any longer in hipification * small improvements Pull Request resolved: pytorch/pytorch#10893 Differential Revision: D9615053 Pulled By: ezyang fbshipit-source-id: 864b4d27bf089421f7dfd8065e5017f9ea2f7b3b
…10893) Summary: * improve docker packages (install OpenBLAS to have at-compile-time LAPACK functionality w/ optimizations for both Intel and AMD CPUs) * integrate rocFFT (i.e., enable Fourier functionality) * fix bugs in ROCm caused by wrong warp size * enable more test sets, skip the tests that don't work on ROCm yet * don't disable asserts any longer in hipification * small improvements Pull Request resolved: pytorch#10893 Differential Revision: D9615053 Pulled By: ezyang fbshipit-source-id: 864b4d27bf089421f7dfd8065e5017f9ea2f7b3b