Skip to content

Commit

Permalink
Merge pull request #1803 from emankov/HIPIFY
Browse files Browse the repository at this point in the history
[HIPIFY][doc] Introduce `cuTensor` to `hipTensor` hipification support in the documentation
  • Loading branch information
emankov authored Dec 17, 2024
2 parents b5843e5 + 1132194 commit f6e483f
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 47 deletions.
118 changes: 71 additions & 47 deletions docs/hipify-clang.rst
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,23 @@ LLVM >= 10.0.0
-DCUDA_SDK_ROOT_DIR="C:/ProgramData/NVIDIA Corporation/CUDA Samples/v12.6"
4. Install `cuDNN <https://developer.nvidia.com/rdp/cudnn-archive>`_ belonging to the version corresponding
4. [Optional] Install `cuTensor <https://developer.nvidia.com/cutensor-downloads>`_:

* To specify the path to `cuTensor <https://developer.nvidia.com/cutensor-downloads>`_, use the ``CUDA_TENSOR_ROOT_DIR`` option:

**Linux**:

.. code-block:: bash
-DCUDA_TENSOR_ROOT_DIR=/usr/include
**Windows**:

.. code-block:: shell
-DCUDA_TENSOR_ROOT_DIR=D:/CUDA/cuTensor/2.0.2.1
5. [Optional] Install `cuDNN <https://developer.nvidia.com/rdp/cudnn-archive>`_ belonging to the version corresponding
to the CUDA version:

* To specify the path to `cuDNN <https://developer.nvidia.com/cudnn-downloads>`_, use the ``CUDA_DNN_ROOT_DIR`` option:
Expand All @@ -549,10 +565,10 @@ LLVM >= 10.0.0
**Windows**:

.. code-block:: shell
-DCUDA_DNN_ROOT_DIR=D:/CUDA/cuDNN/9.6.0
5. [Optional] Install `CUB 1.9.8 <https://github.com/NVIDIA/cub/releases/tag/1.9.8>`_ for ``CUDA < 11.0`` only;
6. [Optional] Install `CUB 1.9.8 <https://github.com/NVIDIA/cub/releases/tag/1.9.8>`_ for ``CUDA < 11.0`` only;
for ``CUDA >= 11.0``, the CUB shipped with CUDA will be used for testing.

* To specify the path to CUB, use the ``CUDA_CUB_ROOT_DIR`` option (only for ``CUDA < 11.0``):
Expand All @@ -569,9 +585,9 @@ LLVM >= 10.0.0
-DCUDA_CUB_ROOT_DIR=D:/CUDA/CUB
6. Install `Python <https://www.python.org/downloads>`_ version 3.0 or greater.
7. Install `Python <https://www.python.org/downloads>`_ version 3.0 or greater.

7. Install ``lit`` and ``FileCheck``; these are distributed with LLVM.
8. Install ``lit`` and ``FileCheck``; these are distributed with LLVM.

* Install ``lit`` into ``Python``:

Expand Down Expand Up @@ -619,7 +635,7 @@ LLVM >= 10.0.0

Alternatively, specify the path to ``FileCheck`` in the ``CMAKE_INSTALL_PREFIX`` option.

8. To run OpenGL tests successfully on:
9. To run OpenGL tests successfully on:

**Linux**:

Expand All @@ -631,9 +647,9 @@ LLVM >= 10.0.0

No installation required. All the required headers are shipped with the Windows SDK.

9. Set the ``HIPIFY_CLANG_TESTS`` option to ``ON``: ``-DHIPIFY_CLANG_TESTS=ON``
10. Set the ``HIPIFY_CLANG_TESTS`` option to ``ON``: ``-DHIPIFY_CLANG_TESTS=ON``

10. Build and run tests.
11. Build and run tests.

Linux testing
======================================================
Expand All @@ -642,8 +658,8 @@ On Linux, the following configurations are tested:

* Ubuntu 14: LLVM 4.0.0 - 7.1.0, CUDA 7.0 - 9.0, cuDNN 5.0.5 - 7.6.5
* Ubuntu 16-19: LLVM 8.0.0 - 14.0.6, CUDA 7.0 - 10.2, cuDNN 5.1.10 - 8.0.5
* Ubuntu 20-21: LLVM 9.0.0 - 19.1.5, CUDA 7.0 - 12.6.3, cuDNN 5.1.10 - 9.6.0
* Ubuntu 22-23: LLVM 13.0.0 - 19.1.5, CUDA 7.0 - 12.6.3, cuDNN 8.0.5 - 9.6.0
* Ubuntu 20-21: LLVM 9.0.0 - 19.1.5, CUDA 7.0 - 12.6.3, cuDNN 5.1.10 - 9.6.0, cuTensor 1.0.1.0 - 2.0.2.1
* Ubuntu 22-23: LLVM 13.0.0 - 19.1.5, CUDA 7.0 - 12.6.3, cuDNN 8.0.5 - 9.6.0, cuTensor 1.0.1.0 - 2.0.2.1

Minimum build system requirements for the above configurations:

Expand All @@ -664,6 +680,7 @@ Here's how to build ``hipify-clang`` with testing support on ``Ubuntu 23.10.01``
-DCMAKE_PREFIX_PATH=/usr/llvm/19.1.5/dist \
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-12.6.3 \
-DCUDA_DNN_ROOT_DIR=/usr/local/cudnn-9.6.0 \
-DCUDA_TENSOR_ROOT_DIR=/usr/local/cutensor-2.0.2.1 \
-DLLVM_EXTERNAL_LIT=/usr/llvm/19.1.5/build/bin/llvm-lit \
../hipify
Expand All @@ -684,35 +701,38 @@ The corresponding successful output is:
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- HIPIFY config:
-- - Build hipify-clang : ON
-- - Test hipify-clang : ON
-- - Is part of HIP SDK : OFF
-- - Build hipify-clang : ON
-- - Test hipify-clang : ON
-- - Is part of HIP SDK : OFF
-- - Install clang headers : ON
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.13")
-- Found LLVM 19.1.5:
-- - CMake module path : /usr/llvm/19.1.5/dist/lib/cmake/llvm
-- - Clang include path : /usr/llvm/19.1.5/dist/include
-- - LLVM Include path : /usr/llvm/19.1.5/dist/include
-- - Binary path : /usr/llvm/19.1.5/dist/bin
-- - CMake module path : /usr/llvm/19.1.5/dist/lib/cmake/llvm
-- - Clang include path : /usr/llvm/19.1.5/dist/include
-- - LLVM Include path : /usr/llvm/19.1.5/dist/include
-- - Binary path : /usr/llvm/19.1.5/dist/bin
-- Linker detection: GNU ld
-- ---- The below configuring for hipify-clang testing only ----
-- Found Python: /usr/bin/python3.13 (found suitable version "3.13.1", required range is "3.0...3.14") found components: Interpreter
-- Found lit: /usr/local/bin/lit
-- Found FileCheck: /GIT/LLVM/trunk/dist/FileCheck
-- Initial CUDA to configure:
-- - CUDA Toolkit path : /usr/local/cuda-12.6.3
-- - CUDA Samples path :
-- - cuDNN path : /usr/local/cudnn-9.6.0
-- - CUB path :
-- - CUDA Toolkit path : /usr/local/cuda-12.6.3
-- - CUDA Samples path :
-- - cuDNN path : /usr/local/cudnn-9.6.0
-- - cuTENSOR path : /usr/local/cuTensor/2.0.2.1
-- - CUB path :
-- Found CUDAToolkit: /usr/local/cuda-12.6.3/targets/x86_64-linux/include (found version "12.6.85")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found CUDA config:
-- - CUDA Toolkit path : /usr/local/cuda-12.6.3
-- - CUDA Samples path : OFF
-- - cuDNN path : /usr/local/cudnn-9.6.0
-- - CUB path : /usr/local/cuda-12.6.3/include/cub
-- Configuring done (0.5s)
-- - CUDA Toolkit path : /usr/local/cuda-12.6.3
-- - CUDA Samples path : OFF
-- - cuDNN path : /usr/local/cudnn-9.6.0
-- - CUB path : /usr/local/cuda-12.6.3/include/cub
-- - cuTENSOR path : /usr/local/cuTensor/2.0.2.1
-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: /usr/hipify/build
Expand Down Expand Up @@ -861,6 +881,7 @@ Building with testing support using ``Visual Studio 17 2022`` on ``Windows 11``:
-DCUDA_TOOLKIT_ROOT_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6" \
-DCUDA_SDK_ROOT_DIR="C:/ProgramData/NVIDIA Corporation/CUDA Samples/v12.5" \
-DCUDA_DNN_ROOT_DIR=D:/CUDA/cuDNN/9.6.0 \
-DCUDA_TENSOR_ROOT_DIR=D:/CUDA/cuTensor/2.0.2.1 \
-DLLVM_EXTERNAL_LIT=D:/LLVM/19.1.5/build/Release/bin/llvm-lit.py \
../hipify
Expand All @@ -869,43 +890,46 @@ The corresponding successful output is:
.. code-block:: shell
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.41.34120.0
-- The CXX compiler identification is MSVC 19.41.34120.0
-- The C compiler identification is MSVC 19.42.34435.0
-- The CXX compiler identification is MSVC 19.42.34435.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - 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: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- HIPIFY config:
-- - Build hipify-clang : ON
-- - Test hipify-clang : ON
-- - Is part of HIP SDK : OFF
-- - Build hipify-clang : ON
-- - Test hipify-clang : ON
-- - Is part of HIP SDK : OFF
-- - Install clang headers : ON
-- Found LLVM 19.1.5:
-- - CMake module path : D:/LLVM/19.1.5/dist/lib/cmake/llvm
-- - Clang include path : D:/LLVM/19.1.5/dist/include
-- - LLVM Include path : D:/LLVM/19.1.5/dist/include
-- - Binary path : D:/LLVM/19.1.5/dist/bin
-- - CMake module path : D:/LLVM/19.1.5/dist/lib/cmake/llvm
-- - Clang include path : D:/LLVM/19.1.5/dist/include
-- - LLVM Include path : D:/LLVM/19.1.5/dist/include
-- - Binary path : D:/LLVM/19.1.5/dist/bin
-- ---- The below configuring for hipify-clang testing only ----
-- Found Python: C:/Users/evgen/AppData/Local/Programs/Python/Python313/python.exe (found suitable version "3.13.1", required range is "3.0...3.14") found components: Interpreter
-- Found Python: C:/Users/TT/AppData/Local/Programs/Python/Python313/python.exe (found suitable version "3.13.1", required range is "3.0...3.14") found components: Interpreter
-- Found lit: C:/Users/TT/AppData/Local/Programs/Python/Python313/Scripts/lit.exe
-- Found FileCheck: D:/LLVM/19.1.5/dist/bin/FileCheck.exe
-- Initial CUDA to configure:
-- - CUDA Toolkit path : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6
-- - CUDA Samples path : C:/ProgramData/NVIDIA Corporation/CUDA Samples/v12.5
-- - cuDNN path : D:/CUDA/cuDNN/9.6.0
-- - CUB path :
-- - CUDA Toolkit path : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6
-- - CUDA Samples path : C:/ProgramData/NVIDIA Corporation/CUDA Samples/v12.5
-- - cuDNN path : D:/CUDA/cuDNN/9.6.0
-- - cuTENSOR path : D:/CUDA/cuTensor/2.0.2.1
-- - CUB path :
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include (found version "12.6.85")
-- Found CUDA config:
-- - CUDA Toolkit path : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6
-- - CUDA Samples path : C:/ProgramData/NVIDIA Corporation/CUDA Samples/v12.5
-- - cuDNN path : D:/CUDA/cuDNN/9.6.0
-- - CUB path : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include/cub
-- Configuring done (2.1s)
-- - CUDA Toolkit path : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6
-- - CUDA Samples path : C:/ProgramData/NVIDIA Corporation/CUDA Samples/v12.5
-- - cuDNN path : D:/CUDA/cuDNN/9.6.0
-- - cuTENSOR path : D:/CUDA/cuTensor/2.0.2.1
-- - CUB path : C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/include/cub
-- Configuring done (4.4s)
-- Generating done (0.1s)
-- Build files have been written to: D:/HIPIFY/build
Expand Down
1 change: 1 addition & 0 deletions docs/supported_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| CURAND API | [HIP RAND API](tables/CURAND_API_supported_by_HIP.md) | [ROC RAND API](tables/CURAND_API_supported_by_ROC.md) | [HIP + ROC RAND API](tables/CURAND_API_supported_by_HIP_and_ROC.md) |
| CUFFT API | [HIP FFT API](tables/CUFFT_API_supported_by_HIP.md) | | |
| CUDNN API | [HIP DNN API](tables/CUDNN_API_supported_by_HIP.md) | [MIOPEN API](tables/CUDNN_API_supported_by_MIOPEN.md) | [HIP + MIOPEN API](tables/CUDNN_API_supported_by_HIP_and_MIOPEN.md) |
| CUTENSOR API | [HIP TENSOR API](tables/CUTENSOR_API_supported_by_HIP.md) | | |
| CUB API | [HIP CUB API](tables/CUB_API_supported_by_HIP.md) | | |

To generate the above documentation with the information about all supported CUDA APIs in Markdown format, run `hipify-clang --md --doc-format=full` with or without specifying the output directory (`-o`), for HIP and ROC separately `--doc-roc=separate` or in the joint format (ROC & HIP) `--doc-roc=joint`.

0 comments on commit f6e483f

Please sign in to comment.