[ROCm] Include ROCM support for CUDA extensions#4180
Open
amd-sriram wants to merge 23 commits intopytorch:mainfrom
Open
[ROCm] Include ROCM support for CUDA extensions#4180amd-sriram wants to merge 23 commits intopytorch:mainfrom
amd-sriram wants to merge 23 commits intopytorch:mainfrom
Conversation
* fix build error on ROCM * Update CMakeLists.txt Co-authored-by: Nikita Shulga <nikita.shulga@gmail.com> * address comments and fix cuda detction on rocm Co-authored-by: Nikita Shulga <nikita.shulga@gmail.com>
* disable mvdr test * skip more tests * update script * fix kaldi import * add more skips
Co-authored-by: Cursor <cursoragent@cursor.com>
…ip rocm so it is the same as upstream
Rocm rnnt loss feature
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/audio/4180
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
remove hipblas flags
Remove hip namespace shim
Author
|
@NicolasHug Could you please review this PR. Thanks. |
This comment was marked as spam.
This comment was marked as spam.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Port cuda extensions to ROCm:
Technical Details
Changes to tools/setup_helpers/extension.py
cuda source files are added for _USE_ROCM flag.
e.g.
if _USE_CUDA or _USE_ROCM:
sources.append("iir_cuda.cu")
Fixing compilation issues
The following fixes have been made to fix the following errors:
1. TORCH_HIP_VERSION is not defined
TORCH_HIP_VERSION is defined in tools/setup_helpers/extension.py , similiar to ttps://github.com/ROCm/pytorch/blob/develop/cmake/public/LoadHIP.cmake#L166
math(EXPR TORCH_HIP_VERSION "(${HIP_VERSION_MAJOR} * 100) + ${HIP_VERSION_MINOR}")2. kernel launch parameters are not proper
Correct the parameters in THO_DISPATCH_V2 based on https://github.com/ROCm/pytorch/blob/develop/test/cpp_extensions/libtorch_agn_2_9_extension/csrc/kernel.cpp#L361
Test Plan
Run this branch in both Nvidia machine and AMD machine, check if it installs and run the unit tests for the cuda extensions:
Test Result
Number of passed unit tests:
Attached log for torch 2.11
torch211_log.txt
Doesn't support torch 2.10