Open galeselee opened 1 year ago
It seems better to add cmake at the end(after step5)
Here is task list.
Amazing works.
I'm also considering this task since our new HPC is using Sugon gtx106 (known as Vega 20). I am quite interested is there any possible to cooperate ?
Besides, Are you also working on ASC 2022 competition ? I notice that you forked DeePMD-kit which is one of the tasks of ASC2022.
I'm also considering this task since our new HPC is using Sugon gtx106 (known as Vega 20). I am quite interested is there any possible to cooperate ?
@ITCJ Certainly! Now, I have implemented a prototype for AMDGPU
backend based on a RDNA2-arch card(don't worry, there are lots of work need to do). If you are interested, here is the code
By the way, I don't know sth about Sugon gtx106 :-). In my knowledge, gtx
is a serial production from nvidia. Do you mean DCU
?
I'm also considering this task since our new HPC is using Sugon gtx106 (known as Vega 20). I am quite interested is there any possible to cooperate ?
@ITCJ Certainly! Now, I have implemented a prototype for
AMDGPU
backend based on a RDNA2-arch card(don't worry, there are lots of work need to do). If you are interested, here is the code By the way, I don't know sth about Sugon gtx106 :-). In my knowledge,gtx
is a serial production from nvidia. Do you meanDCU
?
@GaleSeLee yeah, it's Surgon DCU
. I recheck the rocminfo
and found it is gfx906
. I am confusing for this duplication for a time but never check rocminfo
again, ORZ.
ISA Info:
ISA 1
Name: amdgcn-amd-amdhsa--gfx906:sramecc-:xnack-
AND, Would you mind if I friend you on Wechat?I have send you my wechat id AND QR code to your edu email.
Is there any plan to support cdna or cdna2 architecture? I hope to run my taichi code on MI series gpu.
Is there any plan to support cdna or cdna2 architecture? I hope to run my taichi code on MI series gpu.
Actually, you can run your taichi code on GPU with cdna or cdna2 architecture with a little modification. (I have test some cases on MI210)
How? I thought the current taichi doesn't support amd gpu
How? I thought the current taichi doesn't support amd gpu
It looks like the amdgpu backend hasn't been released yet, you can either do the compilation yourself (I can sort out how to compile it if you need help) or try using the vulkan backend.
How? I thought the current taichi doesn't support amd gpu
LLVM for AMDGPU backend 2.1. Download llvm source code 2.2. Compile
cmake .. -DLLVM_ENABLE_RTTI:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF - DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86;AMDGPU" - DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_TERMINFO=OFF - DLLVM_INCLUDE_BENCHMARKS=OFF -DCMAKE_INSTALL_PREFIX=llvm_binary_path
make -j `nproc`
make install
2.3. Check, there will be four folders(bin, include, lib and share) in the CMAKE_INSATLL_PREFIX.
git clone --recursive https://github.com/taichi-dev/taichi.git
virtualenv -p python3 your_env_path
pip install -r requirements_dev.txt
TAICHI_CMAKE_ARGS="-DTI_WITH_VULKAN=OFF -DTI_WITH_OPENGL=OFF - DTI_BUILD_TESTS=ON -DTI_BUILD_EXAMPLES=OFF - DCMAKE_PREFIX_PATH=llvm_binary_path/lib/cmake -DCMAKE_CXX_COMPILER=clang++ - DTI_WITH_AMDGPU=ON" python setup.py develop
Please choose the backend that needs to be compiled according to your needs.(e.g. if you need VULKAN backend, thus -DTI_WITH_VULKAN=ON
)Test
pip install -r requirements_test.txt
cd tests
python run_test.py -a amdgpu -k mpm88
If your output is similar to the one below, then you have finished the compilation.
Please enjoy!
I've managed to build Taichi for AMDGPU, but one problem I ran into is that recent (5.3+) versions of ROCm require PCIe atomics, which are not available on my setup. The most recent version, 5.7 includes a workaround for setups without PCIe atomics: https://rocm.docs.amd.com/en/latest/release.html#non-hostcall-hip-printf.
I had a go at building taichi against LLVM 17, which is the version of LLVM that ROCm 5.7 works with. I haven't been able to test said changes because they require the ROCM 5.7 runtime to be installed and this isn't out in the Arch Linux repositories yet. Here are the changes I've had to make: https://github.com/expenses/taichi/commit/800c6936922360b914bf48e5b749f6f2eeae9834.
I'm not sure if this information is super useful, but it might help some people.
I'd just like to note that the AMDGPU backend (TI_ARCH=amdgpu
) is already working with ROCm 6.0 on my gfx1032
GPU. It passes all (Python) tests and in many cases is more stable / has less crashes than the Vulkan and OpenGL (albeit at the cost of a slightly slower startup).
Currently the latest LLVM version Taichi officially supports is LLVM 15. I have LLVM 16 working locally, but LLVM 17+ needs some thought because the need (or not?) to migrate to LLVM's new pass manager infrastructure (e.g. PassManagerBuilder
is entirely non-existent).
@GZGavinZhao Thanks for your sharing. And I'm very glad to know this. I have previous experience migrating from a lower version of LLVM to 14. Some of LLVM code need changed according to the LLVM docs due to the change of the LLVM API, like PassManagerBuilder
you mentioned.
Purpose I find Taichi users have a demand for AMDGPU. (related issue https://github.com/taichi-dev/taichi/issues/4586) There is also a discussion of the AMD GPU backend here https://github.com/taichi-dev/taichi/issues/412 Thus, I would like to add an AMDGPU backend to the compiler so that my 6900XT can be utilized.
Solution The purpose is to give Taichi preliminary support for AMDPU via LLVM-14 and ROCm. I started by completing the following steps step by step