-
Notifications
You must be signed in to change notification settings - Fork 72
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
[feature request] Support for AMD GPU #907
Comments
Cool @cregouby ! In order to get support for AMD GPU's we will need to figure out: |
nice push ! I'm on it in https://github.com/cregouby/torch/tree/platform/amd_gpu ~/R/_packages/torch/lantern/build$ cmake ..
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Downloading /home/___/R/_packages/torch/lantern/build/libtorch.zip: https://download.pytorch.org/libtorch/rocm5.1.1/libtorch-cxx11-abi-shared-with-deps-1.12.1%2Brocm5.1.1.zip I still need to add version-matching check (as I currently do not match the available rocm version on my machine) |
Nice! This is looking great! Maybe ROCM can work with minor version mismatches? That's not the case for CUDA, but you could try. |
Sure ! |
I think you can cross-compile on the default ubuntu and install the ROCm compilers. Ie, I think you can compile for ROCm in a machine that doesn't include a AMD GPU. |
I've made good progress on step 3. (maybe the easiest one) |
Some news on the task :
any suggestion would be appreciated |
Great!! Perhaps something equivalent to the below for ROCM is missing? Line 192 in fef4bf0
|
It seems that setting this would help: https://cmake.org/cmake/help/latest/prop_tgt/HIP_STANDARD.html |
Thanks for the hint, setting it to value 14 or 17 did not remove the For the error My two big uncertainties right now are
|
I don't think
Yeah, I think you don't need to provide HIP kernel for the Contrib stuff, so just building with the CPU version should be fine. |
Thanks for those hints, I'll try to rework based on that !
And despite my effort, I can't get the HIP compiler to consider C++17 code... I'll question the authors... or maybe try
|
That's great progress!! 👍 Hmm, this seems to be related to the clang version, perhaps? Or something like this? |
Ah some news here after some deeper investigation : Support and Compatibility
Liblantern buildStrickly following the compatibility table, I've been able to build
using the official
{torch}I've tweeked a bit the download torch right now and get to the following success : > # copy lantern
> source("R/install.R")
> source("R/lantern_sync.R")
> lantern_sync(TRUE)
[1] TRUE
> library(torch)
Attachement du package : ‘torch’
Les objets suivants sont masqués _par_ ‘.GlobalEnv’:
get_install_libs_url, install_torch, install_torch_from_file, torch_install_path, torch_is_installed
> torch_version
[1] "2.0.1"
> tt <- torch_tensor(c(1,2,3,4), device = "cuda")
> tt
torch_tensor
1
2
3
4
[ CUDAFloatType{4} ] which is amazing ! I still have a discrepancy as I currently crash R when running But I can feel the taste of success... |
This is very exciting! is there a way I can help test? I have an AMD rocm computer and I would love it if torch would work on gpu, just like pytorch! |
Hello @RMHogervorst , |
@cregouby
I think I'm missing something I have installed the latest version of rocm 6.0.2, I can probably install the 5.4.2 version too, but I think this error is not related to the rocm version |
I realized that there are cmakelist files in the src directory.
This builds a library, but it seems to build it for cpu |
Sorry @RMHogervorst, I didn't commit my experimental Feel free to question or improve every line inside the After lantern is compiled, you may want to setup some environment variables. Those are mine, stored in
|
following up #455, I'd love to able to run torch load on my AMD GPU.
My Hardware is available for any test / debug / experiment around it
Thanks
The text was updated successfully, but these errors were encountered: