From cef8ab9d2cac1ad11c4ab54d297142b826bab23e Mon Sep 17 00:00:00 2001 From: Wayne Franz Date: Tue, 3 Sep 2024 15:55:36 -0400 Subject: [PATCH 01/13] Remove website URL from comments (#542) Referencing or using code from some websites is prohibited in this repository. This change removes an informational reference in the comments. --- scripts/copyright-date/check-copyright.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/copyright-date/check-copyright.sh b/scripts/copyright-date/check-copyright.sh index 04d941b96..fccbdb9ac 100755 --- a/scripts/copyright-date/check-copyright.sh +++ b/scripts/copyright-date/check-copyright.sh @@ -61,7 +61,6 @@ if $forkdiff; then source_commit="remotes/$remote/HEAD" # don't use fork-point for finding fork point (lol) - # see: https://stackoverflow.com/a/53981615 diff_hash="$(git merge-base "$source_commit" "$branch")" fi From c8fb50444e33657fd625034a9a2086ced1343d61 Mon Sep 17 00:00:00 2001 From: amd-garydeng Date: Thu, 5 Sep 2024 15:19:50 -0600 Subject: [PATCH 02/13] Add gfx1151 target (#543) (#546) Co-authored-by: Stanley Tsang Co-authored-by: Eiden Yoshida --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83e88331f..b4acfd4bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,7 @@ if(GPU_TARGETS STREQUAL "all") ) else() rocm_check_target_ids(DEFAULT_AMDGPU_TARGETS - TARGETS "gfx803;gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201" + TARGETS "gfx803;gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201;gfx1151" ) endif() From e8bcc6201835feb7f2f03c5f2bdfe86d6bb24861 Mon Sep 17 00:00:00 2001 From: Jeffrey Novotny Date: Tue, 17 Sep 2024 12:14:34 -0400 Subject: [PATCH 03/13] Move data type support file along with index and ToC changes (#548) (#549) --- docs/{conceptual => api-reference}/data-type-support.rst | 2 +- docs/index.rst | 3 ++- docs/sphinx/_toc.yml.in | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) rename docs/{conceptual => api-reference}/data-type-support.rst (99%) diff --git a/docs/conceptual/data-type-support.rst b/docs/api-reference/data-type-support.rst similarity index 99% rename from docs/conceptual/data-type-support.rst rename to docs/api-reference/data-type-support.rst index 619300306..faba618d8 100644 --- a/docs/conceptual/data-type-support.rst +++ b/docs/api-reference/data-type-support.rst @@ -4,7 +4,7 @@ .. _data-type-support: -Data type support +rocRAND data type support ****************************************** Host API diff --git a/docs/index.rst b/docs/index.rst index eba1fb946..a7eeddaf0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,12 +31,13 @@ The documentation is structured as follows: .. grid-item-card:: Conceptual * :ref:`programmers-guide` - * :ref:`data-type-support` + * :ref:`curand-compatibility` * :ref:`dynamic-ordering-configuration` .. grid-item-card:: API reference + * :doc:`rocRAND data type support ` * :ref:`cpp-api` * :ref:`python-api` * :doc:`Fortran API reference ` diff --git a/docs/sphinx/_toc.yml.in b/docs/sphinx/_toc.yml.in index 11dd63904..c2fb9a9bb 100644 --- a/docs/sphinx/_toc.yml.in +++ b/docs/sphinx/_toc.yml.in @@ -8,11 +8,11 @@ subtrees: - caption: Conceptual entries: - file: conceptual/programmers-guide - - file: conceptual/data-type-support - file: conceptual/curand-compatibility - file: conceptual/dynamic_ordering_configuration - caption: API reference entries: + - file: api-reference/data-type-support - file: api-reference/cpp-api - file: api-reference/python-api - file: fortran-api-reference From 70d29fe62e3ef45ae02a2eef8ef321da28d545e6 Mon Sep 17 00:00:00 2001 From: Jeffrey Novotny Date: Fri, 11 Oct 2024 21:01:09 -0400 Subject: [PATCH 04/13] Convert change log to new format (#564) --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01475ffee..143bbb7c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,15 +5,15 @@ Documentation for rocRAND is available at ## (Unreleased) rocRAND-3.2.0 for ROCm 6.3.0 -### Additions +### Added * Added host generator for MT19937 * Support for `rocrand_generate_poisson` in hipGraphs -* Added engine, distribution, mode, throughput_gigabytes_per_second, and lambda columns for csv format in - benchmark_rocrand_host_api and benchmark_rocrand_device_api. To see these new columns set --benchmark_format=csv - or --benchmark_out_format=csv --benchmark_out="outName.csv" +* Added engine, distribution, mode, throughput_gigabytes_per_second, and lambda columns for the csv format in + `benchmark_rocrand_host_api` and `benchmark_rocrand_device_api`. To see these new columns, set `--benchmark_format=csv` + or `--benchmark_out_format=csv --benchmark_out="outName.csv"`. -### Changes +### Changed * `rocrand_discrete` for MTGP32, LFSR113 and ThreeFry generators now uses the alias method, which is faster than binary search in CDF. From c1640d91be08e347685396b6f621bb5b62a51c5c Mon Sep 17 00:00:00 2001 From: Di Nguyen Date: Thu, 17 Oct 2024 12:02:13 -0600 Subject: [PATCH 05/13] Fixed memory leaks in rocrand_tests (#557) * added hipFree to test_rocrand_cpp_basic * fixed memory leak for test_rocrand_config_dispatch * fixed a memory leak in test_utils * changed createGraph to createAndLaunchGraph, as well as fixed stream capture order * changed default boolean (kaunchGraph, sync) to be true in createAndLaunchGraph * added back missing end stream capture * reformated curlys for consistency * removed createAndLaunchGraph inside resetGraphHelper --- .../internal/test_rocrand_config_dispatch.cpp | 2 + test/test_rocrand_cpp_basic.cpp | 6 +- test/test_rocrand_hipgraphs.cpp | 50 ++++---- test/test_utils_hipgraphs.hpp | 112 +++++++++--------- 4 files changed, 86 insertions(+), 84 deletions(-) diff --git a/test/internal/test_rocrand_config_dispatch.cpp b/test/internal/test_rocrand_config_dispatch.cpp index 1d1cda080..06bef1c4d 100644 --- a/test/internal/test_rocrand_config_dispatch.cpp +++ b/test/internal/test_rocrand_config_dispatch.cpp @@ -89,6 +89,8 @@ TEST(rocrand_config_dispatch_tests, host_matches_device) ASSERT_NE(host_arch, rocrand_impl::host::target_arch::invalid); ASSERT_EQ(host_arch, device_arch); + + HIP_CHECK(hipFree(device_arch_ptr)); } TEST(rocrand_config_dispatch_tests, parse_common_architectures) diff --git a/test/test_rocrand_cpp_basic.cpp b/test/test_rocrand_cpp_basic.cpp index 7ae31b386..d17a766de 100644 --- a/test/test_rocrand_cpp_basic.cpp +++ b/test/test_rocrand_cpp_basic.cpp @@ -84,8 +84,9 @@ TYPED_TEST(rocrand_cpp_basic_tests, move_construction) float actual; HIP_CHECK(hipMemcpy(&actual, d_data, sizeof(actual), hipMemcpyDeviceToHost)); - ASSERT_EQ(expected, actual); + + HIP_CHECK(hipFree(d_data)); } TYPED_TEST(rocrand_cpp_basic_tests, move_assignment) @@ -119,6 +120,7 @@ TYPED_TEST(rocrand_cpp_basic_tests, move_assignment) float actual; HIP_CHECK(hipMemcpy(&actual, d_data, sizeof(actual), hipMemcpyDeviceToHost)); - ASSERT_EQ(expected, actual); + + HIP_CHECK(hipFree(d_data)); } diff --git a/test/test_rocrand_hipgraphs.cpp b/test/test_rocrand_hipgraphs.cpp index 3b94186f6..912c99c55 100644 --- a/test/test_rocrand_hipgraphs.cpp +++ b/test/test_rocrand_hipgraphs.cpp @@ -34,34 +34,34 @@ void test_float(std::functiongraph)); + HIP_CHECK_NON_VOID(hipGraphExecDestroy(this->graph_instance)); + } + + inline void resetGraphHelper(hipStream_t& stream, const bool beginCapture=true) + { + // Destroy the old graph and instance + cleanupGraphHelper(); + + if(beginCapture) + startStreamCapture(stream); + } + + inline void launchGraphHelper(hipStream_t& stream,const bool sync=false) + { + HIP_CHECK_NON_VOID(hipGraphLaunch(this->graph_instance, stream)); + + // Optionally sync after the launch + if (sync) + HIP_CHECK_NON_VOID(hipStreamSynchronize(stream)); + } + }; } // end namespace test_utils #endif //ROCRAND_TEST_UTILS_HIPGRAPHS_HPP From a507982afa16489e55a60ef04947c4f46f199eeb Mon Sep 17 00:00:00 2001 From: Jeffrey Novotny Date: Tue, 29 Oct 2024 13:05:46 -0400 Subject: [PATCH 06/13] Update changelog release headers (#568) (#575) * Update changelog release headers * Small correction (cherry picked from commit c7da2022d82ae552f61cb4405af5389a0b50033c) --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 143bbb7c6..b9219df50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Documentation for rocRAND is available at [https://rocm.docs.amd.com/projects/rocRAND/en/latest/](https://rocm.docs.amd.com/projects/rocRAND/en/latest/) -## (Unreleased) rocRAND-3.2.0 for ROCm 6.3.0 +## rocRAND 3.2.0 for ROCm 6.3.0 ### Added @@ -17,7 +17,7 @@ Documentation for rocRAND is available at * `rocrand_discrete` for MTGP32, LFSR113 and ThreeFry generators now uses the alias method, which is faster than binary search in CDF. -## (Unreleased) rocRAND-3.1.1 for ROCm 6.2.0 +## rocRAND 3.1.1 for ROCm 6.2.4 ## Fixes @@ -25,7 +25,7 @@ Documentation for rocRAND is available at when using python version thats older than 3.11 * Fixed low random sequence quality of `ROCRAND_RNG_PSEUDO_THREEFRY2_64_20` and `ROCRAND_RNG_PSEUDO_THREEFRY4_64_20`. -## (Unreleased) rocRAND-3.1.0 for ROCm 6.2.0 +## rocRAND 3.1.0 for ROCm 6.2.0 ### Additions From 82a1c49070dc06db180802cfb75985d646742d6b Mon Sep 17 00:00:00 2001 From: Jeffrey Novotny Date: Tue, 29 Oct 2024 15:31:05 -0400 Subject: [PATCH 07/13] Add readme and metadata info and clarify CUDA references (#567) (#576) (cherry picked from commit 81d9e5877add1479648282e2f3bb478e86b80f7a) --- README.md | 4 ++-- docs/conceptual/curand-compatibility.rst | 2 +- docs/index.rst | 4 ++-- docs/license.rst | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4a17574d1..6bfdaaf19 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ split into a separate library. As of version 6.0, hipRAND can no longer be built ## Documentation -Documentation for rocRAND is available at -[https://rocm.docs.amd.com/projects/rocRAND/en/latest/](https://rocm.docs.amd.com/projects/rocRAND/en/latest/) +> [!NOTE] +> The published rocRAND documentation is available at [rocRAND](https://rocm.docs.amd.com/projects/rocRAND/en/latest/) in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the rocRAND/docs folder of this repository. As with all ROCm projects, the documentation is open source. For more information, see [Contribute to ROCm documentation](https://rocm.docs.amd.com/en/latest/contribute/contributing.html). To build documentation locally, use the following code: diff --git a/docs/conceptual/curand-compatibility.rst b/docs/conceptual/curand-compatibility.rst index 75e32b0b5..d95e7a7f4 100644 --- a/docs/conceptual/curand-compatibility.rst +++ b/docs/conceptual/curand-compatibility.rst @@ -8,7 +8,7 @@ cuRAND compatibility ==================== -The following table shows which rocRAND generators produce the exact same sequence as the equivalent cuRAND generator when using legacy ordering, given the same seed, number of dimensions, and offset. +The following table shows which rocRAND generators produce the exact same sequence as the equivalent NVIDIA CUDA cuRAND generator when using legacy ordering, given the same seed, number of dimensions, and offset. .. table:: cuRAND Compatibility :widths: auto diff --git a/docs/index.rst b/docs/index.rst index a7eeddaf0..d2caa7675 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,10 +10,10 @@ rocRAND documentation rocRAND provides functions that generate pseudo-random and quasi-random numbers. The rocRAND library is implemented in the `HIP `_ programming language and optimized for AMD's latest discrete GPUs. It is designed to run on top -of AMD's `ROCm `_, but it also works on CUDA-enabled GPUs. +of AMD's `ROCm `_, but it also works on NVIDIA CUDA-enabled GPUs. rocRAND includes a wrapper library called hipRAND, which you can use to easily port -CUDA applications using the cuRAND library to the +NVIDIA CUDA applications using the CUDA cuRAND library to the `HIP `_ layer. In the `ROCm `_ environment, hipRAND uses rocRAND. diff --git a/docs/license.rst b/docs/license.rst index 60fbe8594..5edbd67a0 100644 --- a/docs/license.rst +++ b/docs/license.rst @@ -1,3 +1,7 @@ +.. meta:: + :description: rocRAND licensing information + :keywords: rocRAND, ROCm, API, documentation, license + License ======= From 49db75e1c0c414550f3404f94c4a5fcfe95af259 Mon Sep 17 00:00:00 2001 From: NguyenNhuDi Date: Tue, 5 Nov 2024 18:43:47 +0000 Subject: [PATCH 08/13] added gfx12 and gfx1151 to default gpu list --- rmake.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rmake.py b/rmake.py index 6b7dccae9..99d74ec34 100644 --- a/rmake.py +++ b/rmake.py @@ -20,6 +20,9 @@ def parse_args(): parser = argparse.ArgumentParser(description=""" Checks build arguments """) + + default_gpus = 'gfx906:xnack-,gfx1030,gfx1100,gfx1101,gfx1102,gfx1151,gfx1200,gfx1201' + parser.add_argument('-g', '--debug', required=False, default=False, action='store_true', help='Generate Debug build (default: False)') parser.add_argument( '--build_dir', type=str, required=False, default="build", @@ -37,7 +40,7 @@ def parse_args(): help='Install after build (default: False)') parser.add_argument( '--cmake-darg', required=False, dest='cmake_dargs', action='append', default=[], help='List of additional cmake defines for builds (e.g. CMAKE_CXX_COMPILER_LAUNCHER=ccache)') - parser.add_argument('-a', '--architecture', dest='gpu_architecture', required=False, default="gfx906;gfx1030;gfx1100;gfx1101;gfx1102", #:sramecc+:xnack-" ) #gfx1030" ) #gfx906" ) # gfx1030" ) + parser.add_argument('-a', '--architecture', dest='gpu_architecture', required=False, default=default_gpus, #:sramecc+:xnack-" ) #gfx1030" ) #gfx906" ) # gfx1030" ) help='Set GPU architectures, e.g. all, gfx000, gfx803, gfx906:xnack-;gfx1030;gfx1100 (optional, default: all)') parser.add_argument('-v', '--verbose', required=False, default=False, action='store_true', help='Verbose build (default: False)') @@ -111,7 +114,7 @@ def config_cmd(): else: cmake_executable = "cmake" toolchain = "toolchain-linux.cmake" - cmake_platform_opts = f"-DROCM_DIR:PATH={rocm_path} -DCPACK_PACKAGING_INSTALL_PREFIX={rocm_path}" + cmake_platform_opts = [f"-DROCM_DIR:PATH={rocm_path}", f"-DCPACK_PACKAGING_INSTALL_PREFIX={rocm_path}"] tools = f"-DCMAKE_TOOLCHAIN_FILE={toolchain}" cmake_options.append( tools ) From 7910da62305efeaa52cd71971bb5fda70c18845a Mon Sep 17 00:00:00 2001 From: NguyenNhuDi Date: Tue, 5 Nov 2024 18:44:15 +0000 Subject: [PATCH 09/13] updated changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9219df50..00d2abee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,12 +15,13 @@ Documentation for rocRAND is available at ### Changed +* Updated the default value for `-a` argument from `rmake.py` to `gfx906:xnack-,gfx1030,gfx1100,gfx1101,gfx1102,gfx1151,gfx1200,gfx1201` * `rocrand_discrete` for MTGP32, LFSR113 and ThreeFry generators now uses the alias method, which is faster than binary search in CDF. ## rocRAND 3.1.1 for ROCm 6.2.4 ## Fixes - +* Fixed an issue in `rmake.py` where the list storing cmake options would contain individual characters instead of full string of option * Fixed " unknown extension ?>" issue in scripts/config-tuning/select_best_config.py when using python version thats older than 3.11 * Fixed low random sequence quality of `ROCRAND_RNG_PSEUDO_THREEFRY2_64_20` and `ROCRAND_RNG_PSEUDO_THREEFRY4_64_20`. From 36c4954e40419f6981afe957c32d7e2168c72663 Mon Sep 17 00:00:00 2001 From: Di Nguyen Date: Tue, 5 Nov 2024 13:16:06 -0700 Subject: [PATCH 10/13] Update CHANGELOG.md Co-authored-by: Jeffrey Novotny --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00d2abee2..dd662d358 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ Documentation for rocRAND is available at ### Changed -* Updated the default value for `-a` argument from `rmake.py` to `gfx906:xnack-,gfx1030,gfx1100,gfx1101,gfx1102,gfx1151,gfx1200,gfx1201` +* Updated the default value for the `-a` argument from `rmake.py` to `gfx906:xnack-,gfx1030,gfx1100,gfx1101,gfx1102,gfx1151,gfx1200,gfx1201`. * `rocrand_discrete` for MTGP32, LFSR113 and ThreeFry generators now uses the alias method, which is faster than binary search in CDF. ## rocRAND 3.1.1 for ROCm 6.2.4 From 7823c448cea72093f44605243f43226c32c2f43c Mon Sep 17 00:00:00 2001 From: Di Nguyen Date: Tue, 5 Nov 2024 13:16:11 -0700 Subject: [PATCH 11/13] Update CHANGELOG.md Co-authored-by: Jeffrey Novotny --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd662d358..9d139e094 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ Documentation for rocRAND is available at ## rocRAND 3.1.1 for ROCm 6.2.4 ## Fixes -* Fixed an issue in `rmake.py` where the list storing cmake options would contain individual characters instead of full string of option +* Fixed an issue in `rmake.py` where the list storing cmake options would contain individual characters instead of a full string of options. * Fixed " unknown extension ?>" issue in scripts/config-tuning/select_best_config.py when using python version thats older than 3.11 * Fixed low random sequence quality of `ROCRAND_RNG_PSEUDO_THREEFRY2_64_20` and `ROCRAND_RNG_PSEUDO_THREEFRY4_64_20`. From 07b4fba423b087a124f95034f0863a6482a17abb Mon Sep 17 00:00:00 2001 From: Stanley Tsang Date: Fri, 15 Nov 2024 13:15:04 -0700 Subject: [PATCH 12/13] Remove gfx940,gfx941 targets (#580) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4acfd4bb..aa0e93d09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,11 +97,11 @@ if(GPU_TARGETS STREQUAL "all") if(BUILD_ADDRESS_SANITIZER) # ASAN builds require xnack rocm_check_target_ids(DEFAULT_AMDGPU_TARGETS - TARGETS "gfx908:xnack+;gfx90a:xnack+;gfx940:xnack+;gfx941:xnack+;gfx942:xnack+" + TARGETS "gfx908:xnack+;gfx90a:xnack+;gfx942:xnack+" ) else() rocm_check_target_ids(DEFAULT_AMDGPU_TARGETS - TARGETS "gfx803;gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201;gfx1151" + TARGETS "gfx803;gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201;gfx1151" ) endif() From 20357bdd257003df871133efcd19a07c5fc7bb4a Mon Sep 17 00:00:00 2001 From: Stanley Tsang Date: Wed, 20 Nov 2024 22:49:56 +0000 Subject: [PATCH 13/13] Remove unreleased --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c855ed57..3b08796f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Documentation for rocRAND is available at [https://rocm.docs.amd.com/projects/rocRAND/en/latest/](https://rocm.docs.amd.com/projects/rocRAND/en/latest/) -## (Unreleased) rocRAND 3.3.0 for ROCm 6.4 +## rocRAND 3.3.0 for ROCm 6.4 ### Added