From b9b639fa294dd736ec51b0ce7a4173a2899b42a4 Mon Sep 17 00:00:00 2001 From: Sam Wu Date: Fri, 17 Nov 2023 14:55:26 -0700 Subject: [PATCH 1/5] Fix spelling in documentation --- docs/API_Reference_Guide.rst | 1 - docs/Contributors_Guide.rst | 25 +++++++++++------------ docs/Linux_Install_Guide.rst | 27 +++++++++++++------------ docs/Programmers_Guide.rst | 39 ++++++++++++++++++------------------ docs/index.rst | 4 ++-- 5 files changed, 47 insertions(+), 49 deletions(-) diff --git a/docs/API_Reference_Guide.rst b/docs/API_Reference_Guide.rst index 551e2ee0..3d8ec3c7 100644 --- a/docs/API_Reference_Guide.rst +++ b/docs/API_Reference_Guide.rst @@ -11,7 +11,6 @@ hiptensorStatus_t .. doxygenenum:: hiptensorStatus_t - hiptensorComputeType_t ---------------------- diff --git a/docs/Contributors_Guide.rst b/docs/Contributors_Guide.rst index aeb87211..d75a884b 100644 --- a/docs/Contributors_Guide.rst +++ b/docs/Contributors_Guide.rst @@ -15,8 +15,7 @@ License Agreement Pull-request guidelines ======================= - -Our code contriubtion guidelines closely follows the model of `GitHub +Our code contribution guidelines closely follows the model of `GitHub pull-requests `__. The hipTensor repository follows a workflow which dictates a /master branch where releases are cut, and a /develop branch which serves as an integration branch for new code. Pull requests should: @@ -30,7 +29,7 @@ The hipTensor repository follows a workflow which dictates a /master branch wher - code must also have benchmark tests, and performance must approach the compute bound limit or memory bound limit. -StyleGuide +Style Guide ========== This project follows the `CPP Core @@ -44,7 +43,7 @@ Interface --------- - Library code should use C++17 -- Avoid CamelCase +- Avoid Camel case - This rule applies specifically to publicly visible APIs, but is also encouraged (not mandated) for internal code @@ -52,8 +51,8 @@ Philosophy ---------- - `P.2 `__: - Write in ISO Standard C++14 (especially to support windows, linux and - macos plaforms ) + Write in ISO Standard C++14 (especially to support Windows, Linux and + macOS platforms ) - `P.5 `__: Prefer compile-time checking to run-time checking @@ -105,19 +104,19 @@ will result in different results. To format a file, use: -:: +.. code-block:: - /opt/rocm/llvm/bin/clang-format -style=file -i + /opt/rocm/llvm/bin/clang-format -style=file -i To format all files, run the following script in hipTensor directory: -:: +.. code-block:: - #!/bin/bash - git ls-files -z *.cc *.cpp *.h *.hpp *.cl *.h.in *.hpp.in *.cpp.in | xargs -0 /opt/rocm/llvm/bin/clang-format -style=file -i + #!/bin/bash + git ls-files -z *.cc *.cpp *.h *.hpp *.cl *.h.in *.hpp.in *.cpp.in | xargs -0 /opt/rocm/llvm/bin/clang-format -style=file -i Also, githooks can be installed to format the code per-commit: -:: +.. code-block:: - ./.githooks/install + ./.githooks/install diff --git a/docs/Linux_Install_Guide.rst b/docs/Linux_Install_Guide.rst index 47cdc339..30e21a38 100644 --- a/docs/Linux_Install_Guide.rst +++ b/docs/Linux_Install_Guide.rst @@ -104,9 +104,9 @@ Minimum ROCm version support is 5.7. By default, the project is configured as Release mode. -To build only library, run the following comomand : +To build only library, run the following command : - CC=hipcc CXX=hipcc cmake -B . -DHIPTENSOR_BUILD_TESTS=OFF -DHIPTENSOR_BUILD_SAMPLES=OFF + :code:`CC=hipcc CXX=hipcc cmake -B . -DHIPTENSOR_BUILD_TESTS=OFF -DHIPTENSOR_BUILD_SAMPLES=OFF` Here are some other example project configurations: @@ -116,11 +116,11 @@ Here are some other example project configurations: +-----------------------------------+--------------------------------------------------------------------------------------------------------------------+ | Configuration | Command | +===================================+====================================================================================================================+ -| Basic | CC=hipcc CXX=hipcc cmake -B . | +| Basic | :code:`CC=hipcc CXX=hipcc cmake -B .` | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------+ -| Targeting gfx908 | CC=hipcc CXX=hipcc cmake -B . -DAMDGPU_TARGETS=gfx908:xnack- | +| Targeting gfx908 | :code:`CC=hipcc CXX=hipcc cmake -B . -DAMDGPU_TARGETS=gfx908:xnack-` | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------+ -| Debug build | CC=hipcc CXX=hipcc cmake -B . -DCMAKE_BUILD_TYPE=Debug | +| Debug build | :code:`CC=hipcc CXX=hipcc cmake -B . -DCMAKE_BUILD_TYPE=Debug` | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------+ After configuration, build with @@ -131,15 +131,15 @@ After configuration, build with Build library + samples ^^^^^^^^^^^^^^^^^^^^^^^ -To build library and samples, run the following comomand : +To build library and samples, run the following command: - CC=hipcc CXX=hipcc cmake -B . -DHIPTENSOR_BUILD_TESTS=OFF -DHIPTENSOR_BUILD_SAMPLES=ON + :code:`CC=hipcc CXX=hipcc cmake -B . -DHIPTENSOR_BUILD_TESTS=OFF -DHIPTENSOR_BUILD_SAMPLES=ON` After configuration, build with - cmake --build -- -j + :code:`cmake --build -- -j` -The samples folder in contains executables in the table below. +The samples folder in :code:`` contains executables in the table below. =================================== =================================================================================== executable name description @@ -154,13 +154,13 @@ Build library + tests To build library and tests, run the following command : - CC=hipcc CXX=hipcc cmake -B . + :code:`CC=hipcc CXX=hipcc cmake -B .` After configuration, build with - cmake --build -- -j + :code:`cmake --build -- -j` -The tests in contains executables in the table below. +The tests in `` contains executables in the table below. ====================================== =================================================================================== executable name description @@ -177,6 +177,7 @@ Build library + Documentation Run the steps below to build documentation locally. +.. code-block:: cd docs sudo apt-get update @@ -191,4 +192,4 @@ Run the steps below to build documentation locally. pdflatex hiptensor.tex -Generates hiptensor.pdf here +Generates :code:`hiptensor.pdf` here diff --git a/docs/Programmers_Guide.rst b/docs/Programmers_Guide.rst index 460bb970..1eaf9adf 100644 --- a/docs/Programmers_Guide.rst +++ b/docs/Programmers_Guide.rst @@ -1,4 +1,3 @@ - =================== Programmer's Guide =================== @@ -17,13 +16,13 @@ The hipTensor code is split into four major parts: The `library` directory ^^^^^^^^^^^^^^^^^^^^^^^ -library/include/hiptensor/ +`library/include/hiptensor/` ''''''''''''''''''''''''''' Contains C++ include files for the hipTensor API. These files also contain Doxygen comments that document the API. -library/include/hiptensor/internal +`library/include/hiptensor/internal` '''''''''''''''''''''''''''''''''' Internal include files for: @@ -31,58 +30,58 @@ Internal include files for: - Utility Code - Generate Tensor Utility -library/src/ +`library/src/` '''''''''''' Contains logger, device and performance functions. -library/src/contraction/ +`library/src/contraction/` '''''''''''''''''''''''' Contains hipTensor core composable kernel header functions and contraction initialization functions. -library/src/contraction/device +`library/src/contraction/device` '''''''''''''''''''''''''''''' Contains hipTensor Bilinear and Scale instance functions The `samples` directory ^^^^^^^^^^^^^^^^^^^^^^^ -01_contraction/simple_bilinear_contraction_f32.cpp +`01_contraction/simple_bilinear_contraction_f32.cpp` '''''''''''''''''''''''''''''''''''''''''''''''''' -sample code for calling bilinear contraction for fp32 input, output and compute types +sample code for calling bilinear contraction for :code:`fp32` input, output and compute types -01_contraction/simple_scale_contraction_f32.cpp +`01_contraction/simple_scale_contraction_f32.cpp` ''''''''''''''''''''''''''''''''''''''''''''''' -sample code for calling scale contraction for fp32 input, output and compute types +sample code for calling scale contraction for :code:`fp32` input, output and compute types The `test` directory ^^^^^^^^^^^^^^^^^^^^^^^ -00_unit/logger +`00_unit/logger` '''''''''''''' Test code for testing logger API Functions of hipTensor -01_contraction/bilinear_contraction_f32 +`01_contraction/bilinear_contraction_f32` ''''''''''''''''''''''''''''''''''''''' Test code for testing the bilinear contraction functionality and log metrics for F32 types. -01_contraction/bilinear_contraction_f64 +`01_contraction/bilinear_contraction_f64` ''''''''''''''''''''''''''''''''''''''' Test code for testing the bilinear contraction functionality and log metrics for F64 types. -01_contraction/scale_contraction_f32 +`01_contraction/scale_contraction_f32` '''''''''''''''''''''''''''''''''''' Test code for testing the scale contraction functionality and log metrics for F32 types. -01_contraction/scale_contraction_f64 +`01_contraction/scale_contraction_f64` '''''''''''''''''''''''''''''''''''' Test code for testing the scale contraction functionality and log metrics for F64 types. @@ -90,11 +89,11 @@ Test code for testing the scale contraction functionality and log metrics for F6 Infrastructure ^^^^^^^^^^^^^^ -- CMake is used to build and package hipTensor. There are CMakeLists.txt files throughout the code. -- Doxygen/Breathe/Sphinx/ReadTheDocs are used to produce documentation. Content for the documentation is from: +- CMake is used to build and package hipTensor. There are :code:`CMakeLists.txt` files throughout the code. +- `Doxygen/Breathe/Sphinx/ReadtheDocs` are used to produce documentation. Content for the documentation is from: - - Doxygen comments in include files in the directory library/include - - files in the directory docs/ + - Doxygen comments in include files in the directory :code:`library/include` + - files in the directory :code:`docs/` - Jenkins is used to automate Continuous Integration testing. -- clang-format is used to format C++ code. +- :code:`clang-format` is used to format C++ code. diff --git a/docs/index.rst b/docs/index.rst index 566a00e5..ba5e1cb7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,6 +1,6 @@ ============================================================================ -hiptensor: A High-Performance HIP Library For Tensor Primitives +hipTensor: A High-Performance HIP Library For Tensor Primitives ============================================================================ -hiptensor is AMD's C++ library for accelerating tensor primitives based on the +hipTensor is AMD's C++ library for accelerating tensor primitives based on the composable kernel library, through general purpose kernel languages, like HIP C++. From 7be7e3446830f2d7dd2760f140c7dfa30a246f78 Mon Sep 17 00:00:00 2001 From: Sam Wu Date: Wed, 29 Nov 2023 15:59:14 -0700 Subject: [PATCH 2/5] Use code directive to escape code keywords --- docs/API_Reference_Guide.rst | 56 ++++++++++++++++++------------------ docs/Linux_Install_Guide.rst | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/API_Reference_Guide.rst b/docs/API_Reference_Guide.rst index 3d8ec3c7..dd83b1f3 100644 --- a/docs/API_Reference_Guide.rst +++ b/docs/API_Reference_Guide.rst @@ -6,61 +6,61 @@ Introduction hiptensor Data Types ==================== -hiptensorStatus_t +:code:`hiptensorStatus_t` ----------------- .. doxygenenum:: hiptensorStatus_t -hiptensorComputeType_t +:code:`hiptensorComputeType_t` ---------------------- .. doxygenenum:: hiptensorComputeType_t -hiptensorOperator_t +:code:`hiptensorOperator_t` ------------------- .. doxygenenum:: hiptensorOperator_t -hiptensorAlgo_t +:code:`hiptensorAlgo_t` --------------- .. doxygenenum:: hiptensorAlgo_t -hiptensorWorksizePreference_t +:code:`hiptensorWorksizePreference_t` ----------------------------- .. doxygenenum:: hiptensorWorksizePreference_t -hiptensorLogLevel_t +:code:`hiptensorLogLevel_t` ------------------------------- .. doxygenenum:: hiptensorLogLevel_t -hiptensorHandle_t +:code:`hiptensorHandle_t` ----------------- .. doxygenstruct:: hiptensorHandle_t :members: -hiptensorTensorDescriptor_t +:code:`hiptensorTensorDescriptor_t` --------------------------- .. doxygenstruct:: hiptensorTensorDescriptor_t :members: -hiptensorContractionDescriptor_t +:code:`hiptensorContractionDescriptor_t` -------------------------------- .. doxygenstruct:: hiptensorContractionDescriptor_t :members: -hiptensorContractionFind_t +:code:`hiptensorContractionFind_t` -------------------------- .. doxygenstruct:: hiptensorContractionFind_t :members: -hiptensorContractionPlan_t +:code:`hiptensorContractionPlan_t` -------------------------- .. doxygenstruct:: hiptensorContractionPlan_t @@ -69,32 +69,32 @@ hiptensorContractionPlan_t Helper Functions ================ -hiptensorGetVersion +:code:`hiptensorGetVersion` ------------------- .. doxygenfunction:: hiptensorGetVersion -hiptensorCreate +:code:`hiptensorCreate` --------------- .. doxygenfunction:: hiptensorCreate -hiptensorDestroy +:code:`hiptensorDestroy` ---------------- .. doxygenfunction:: hiptensorDestroy -hiptensorInitTensorDescriptor +:code:`hiptensorInitTensorDescriptor` ----------------------------- .. doxygenfunction:: hiptensorInitTensorDescriptor -hiptensorGetAlignmentRequirement +:code:`hiptensorGetAlignmentRequirement` -------------------------------- .. doxygenfunction:: hiptensorGetAlignmentRequirement -hiptensorGetErrorString +:code:`hiptensorGetErrorString` ----------------------- .. doxygenfunction:: hiptensorGetErrorString @@ -102,27 +102,27 @@ hiptensorGetErrorString Contraction Operations ====================== -hiptensorInitContractionDescriptor +:code:`hiptensorInitContractionDescriptor` ---------------------------------- .. doxygenfunction:: hiptensorInitContractionDescriptor -hiptensorInitContractionFind +:code:`hiptensorInitContractionFind` ---------------------------- .. doxygenfunction:: hiptensorInitContractionFind -hiptensorInitContractionPlan +:code:`hiptensorInitContractionPlan` ---------------------------- .. doxygenfunction:: hiptensorInitContractionPlan -hiptensorContraction +:code:`hiptensorContraction` -------------------- .. doxygenfunction:: hiptensorContraction -hiptensorContractionGetWorkspaceSize +:code:`hiptensorContractionGetWorkspaceSize` ------------------------------------ .. doxygenfunction:: hiptensorContractionGetWorkspaceSize @@ -130,32 +130,32 @@ hiptensorContractionGetWorkspaceSize Logging Functions ================= -hiptensorLoggerSetCallback +:code:`hiptensorLoggerSetCallback` -------------------------- .. doxygenfunction:: hiptensorLoggerSetCallback -hiptensorLoggerSetFile +:code:`hiptensorLoggerSetFile` ---------------------- .. doxygenfunction:: hiptensorLoggerSetFile -hiptensorLoggerOpenFile +:code:`hiptensorLoggerOpenFile` ----------------------- .. doxygenfunction:: hiptensorLoggerOpenFile -hiptensorLoggerSetLevel +:code:`hiptensorLoggerSetLevel` ----------------------- .. doxygenfunction:: hiptensorLoggerSetLevel -hiptensorLoggerSetMask +:code:`hiptensorLoggerSetMask` ---------------------- .. doxygenfunction:: hiptensorLoggerSetMask -hiptensorLoggerForceDisable +:code:`hiptensorLoggerForceDisable` --------------------------- .. doxygenfunction:: hiptensorLoggerForceDisable diff --git a/docs/Linux_Install_Guide.rst b/docs/Linux_Install_Guide.rst index 30e21a38..ace565c1 100644 --- a/docs/Linux_Install_Guide.rst +++ b/docs/Linux_Install_Guide.rst @@ -125,7 +125,7 @@ Here are some other example project configurations: After configuration, build with - cmake --build -- -j + :code:`cmake --build -- -j` Build library + samples From 7b8c448f979cd02350184e31ca7a6667d161329d Mon Sep 17 00:00:00 2001 From: Sam Wu Date: Thu, 30 Nov 2023 15:08:14 -0700 Subject: [PATCH 3/5] Revert "Use code directive to escape code keywords" This reverts commit 7be7e3446830f2d7dd2760f140c7dfa30a246f78. --- docs/API_Reference_Guide.rst | 56 ++++++++++++++++++------------------ docs/Linux_Install_Guide.rst | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/docs/API_Reference_Guide.rst b/docs/API_Reference_Guide.rst index dd83b1f3..3d8ec3c7 100644 --- a/docs/API_Reference_Guide.rst +++ b/docs/API_Reference_Guide.rst @@ -6,61 +6,61 @@ Introduction hiptensor Data Types ==================== -:code:`hiptensorStatus_t` +hiptensorStatus_t ----------------- .. doxygenenum:: hiptensorStatus_t -:code:`hiptensorComputeType_t` +hiptensorComputeType_t ---------------------- .. doxygenenum:: hiptensorComputeType_t -:code:`hiptensorOperator_t` +hiptensorOperator_t ------------------- .. doxygenenum:: hiptensorOperator_t -:code:`hiptensorAlgo_t` +hiptensorAlgo_t --------------- .. doxygenenum:: hiptensorAlgo_t -:code:`hiptensorWorksizePreference_t` +hiptensorWorksizePreference_t ----------------------------- .. doxygenenum:: hiptensorWorksizePreference_t -:code:`hiptensorLogLevel_t` +hiptensorLogLevel_t ------------------------------- .. doxygenenum:: hiptensorLogLevel_t -:code:`hiptensorHandle_t` +hiptensorHandle_t ----------------- .. doxygenstruct:: hiptensorHandle_t :members: -:code:`hiptensorTensorDescriptor_t` +hiptensorTensorDescriptor_t --------------------------- .. doxygenstruct:: hiptensorTensorDescriptor_t :members: -:code:`hiptensorContractionDescriptor_t` +hiptensorContractionDescriptor_t -------------------------------- .. doxygenstruct:: hiptensorContractionDescriptor_t :members: -:code:`hiptensorContractionFind_t` +hiptensorContractionFind_t -------------------------- .. doxygenstruct:: hiptensorContractionFind_t :members: -:code:`hiptensorContractionPlan_t` +hiptensorContractionPlan_t -------------------------- .. doxygenstruct:: hiptensorContractionPlan_t @@ -69,32 +69,32 @@ hiptensor Data Types Helper Functions ================ -:code:`hiptensorGetVersion` +hiptensorGetVersion ------------------- .. doxygenfunction:: hiptensorGetVersion -:code:`hiptensorCreate` +hiptensorCreate --------------- .. doxygenfunction:: hiptensorCreate -:code:`hiptensorDestroy` +hiptensorDestroy ---------------- .. doxygenfunction:: hiptensorDestroy -:code:`hiptensorInitTensorDescriptor` +hiptensorInitTensorDescriptor ----------------------------- .. doxygenfunction:: hiptensorInitTensorDescriptor -:code:`hiptensorGetAlignmentRequirement` +hiptensorGetAlignmentRequirement -------------------------------- .. doxygenfunction:: hiptensorGetAlignmentRequirement -:code:`hiptensorGetErrorString` +hiptensorGetErrorString ----------------------- .. doxygenfunction:: hiptensorGetErrorString @@ -102,27 +102,27 @@ Helper Functions Contraction Operations ====================== -:code:`hiptensorInitContractionDescriptor` +hiptensorInitContractionDescriptor ---------------------------------- .. doxygenfunction:: hiptensorInitContractionDescriptor -:code:`hiptensorInitContractionFind` +hiptensorInitContractionFind ---------------------------- .. doxygenfunction:: hiptensorInitContractionFind -:code:`hiptensorInitContractionPlan` +hiptensorInitContractionPlan ---------------------------- .. doxygenfunction:: hiptensorInitContractionPlan -:code:`hiptensorContraction` +hiptensorContraction -------------------- .. doxygenfunction:: hiptensorContraction -:code:`hiptensorContractionGetWorkspaceSize` +hiptensorContractionGetWorkspaceSize ------------------------------------ .. doxygenfunction:: hiptensorContractionGetWorkspaceSize @@ -130,32 +130,32 @@ Contraction Operations Logging Functions ================= -:code:`hiptensorLoggerSetCallback` +hiptensorLoggerSetCallback -------------------------- .. doxygenfunction:: hiptensorLoggerSetCallback -:code:`hiptensorLoggerSetFile` +hiptensorLoggerSetFile ---------------------- .. doxygenfunction:: hiptensorLoggerSetFile -:code:`hiptensorLoggerOpenFile` +hiptensorLoggerOpenFile ----------------------- .. doxygenfunction:: hiptensorLoggerOpenFile -:code:`hiptensorLoggerSetLevel` +hiptensorLoggerSetLevel ----------------------- .. doxygenfunction:: hiptensorLoggerSetLevel -:code:`hiptensorLoggerSetMask` +hiptensorLoggerSetMask ---------------------- .. doxygenfunction:: hiptensorLoggerSetMask -:code:`hiptensorLoggerForceDisable` +hiptensorLoggerForceDisable --------------------------- .. doxygenfunction:: hiptensorLoggerForceDisable diff --git a/docs/Linux_Install_Guide.rst b/docs/Linux_Install_Guide.rst index ace565c1..30e21a38 100644 --- a/docs/Linux_Install_Guide.rst +++ b/docs/Linux_Install_Guide.rst @@ -125,7 +125,7 @@ Here are some other example project configurations: After configuration, build with - :code:`cmake --build -- -j` + cmake --build -- -j Build library + samples From 0d324d9a1692c11df4d650cfbb216fc8e52e7241 Mon Sep 17 00:00:00 2001 From: Sam Wu Date: Thu, 30 Nov 2023 15:09:16 -0700 Subject: [PATCH 4/5] Disable spellcheck on API Reference Guide --- docs/API_Reference_Guide.rst | 4 ++++ docs/Linux_Install_Guide.rst | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/API_Reference_Guide.rst b/docs/API_Reference_Guide.rst index 3d8ec3c7..e2bb232d 100644 --- a/docs/API_Reference_Guide.rst +++ b/docs/API_Reference_Guide.rst @@ -6,6 +6,8 @@ Introduction hiptensor Data Types ==================== +.. + hiptensorStatus_t ----------------- @@ -159,3 +161,5 @@ hiptensorLoggerForceDisable --------------------------- .. doxygenfunction:: hiptensorLoggerForceDisable + +.. diff --git a/docs/Linux_Install_Guide.rst b/docs/Linux_Install_Guide.rst index 30e21a38..ace565c1 100644 --- a/docs/Linux_Install_Guide.rst +++ b/docs/Linux_Install_Guide.rst @@ -125,7 +125,7 @@ Here are some other example project configurations: After configuration, build with - cmake --build -- -j + :code:`cmake --build -- -j` Build library + samples From ac2e98992a8f3f49a2b7f15b365cab917011bb4e Mon Sep 17 00:00:00 2001 From: Sam Wu Date: Thu, 30 Nov 2023 15:10:39 -0700 Subject: [PATCH 5/5] Fix spelling in API Reference Guide hiptensor > hipTensor --- docs/API_Reference_Guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/API_Reference_Guide.rst b/docs/API_Reference_Guide.rst index e2bb232d..77e86343 100644 --- a/docs/API_Reference_Guide.rst +++ b/docs/API_Reference_Guide.rst @@ -3,7 +3,7 @@ Introduction ************ -hiptensor Data Types +hipTensor Data Types ==================== ..