Skip to content
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

Develop stream 2025-01-28 #607

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4bd0c2a
Set c++ version to 17 and create warning
NB4444 Nov 4, 2024
92d94e0
Fix no_discard warning c++17
NB4444 Nov 4, 2024
0159842
Build for both c++ 14 and 17
NB4444 Nov 4, 2024
3d00035
Add to changelog
NB4444 Nov 4, 2024
ef2e101
Fix warnings when generating sphinx docs
MyNameIsTrez Nov 22, 2024
42f9830
Merge branch 'c++17-new-standard' into 'develop_stream'
NB4444 Nov 11, 2024
52dd64f
Replace GitHub URL with its issue number
MyNameIsTrez Dec 2, 2024
582f66a
Merge branch '382-fix-docs-warnings' into 'develop_stream'
MyNameIsTrez Nov 22, 2024
4e2171c
Update documentation generation instructions
MyNameIsTrez Dec 9, 2024
ff028b0
Merge branch '384-replace-url-with-issue-number' into 'develop_stream'
MyNameIsTrez Dec 2, 2024
e09fde6
Merge branch 'update-docgen-instruction' into 'develop_stream'
MyNameIsTrez Dec 9, 2024
72de763
Fix CI on rocm/dev-ubuntu
ex-rzr Jan 13, 2025
e545032
Make rocRAND usable from FetchContent
Snektron Jan 13, 2025
89fe8e0
Merge branch '386-fix-ci-on-rocm-dev-ubuntu' into 'develop_stream'
ex-rzr Jan 13, 2025
bf5f190
Merge branch 'rocrand-fetchcontent' into 'develop_stream'
Snektron Jan 13, 2025
865f4a6
Remove extra dashes in the documentation its \param and \tparam
MyNameIsTrez Jan 15, 2025
b11ecb6
Documentation to CI upload
Jan 16, 2025
b71e709
Merge branch 'remove-extra-dash-in-doc-params' into 'develop_stream'
MyNameIsTrez Jan 15, 2025
f3e1320
Match cuRAND benchmarks with rocRAND ones
Beanavil Jan 17, 2025
6958ef2
Merge branch 'documentation-to-ci-upload' into 'develop_stream'
Jan 16, 2025
871a716
Merge branch '385-index-rocrand-curand-performance' into 'develop_str…
Beanavil Jan 17, 2025
a0a1f33
Replace download_project with FetchContent
ex-rzr Jan 23, 2025
f0205f8
Merge branch '388-replace-download_project-with-fetchcontent' into 'd…
ex-rzr Jan 23, 2025
ecfd748
fix: missing err stream
Naraenda Jan 28, 2025
358f3ec
Resolve "Some tests create discrete_distribution but do not use it"
ex-rzr Jan 28, 2025
6c6e699
docs(changelog): move c++14 deprecation notice to upcoming changes
Naraenda Jan 29, 2025
ce3e3cb
Deprecate sobol constants and vectors
Naraenda Jan 30, 2025
3254198
Merge branch 'deprecate-sobol-constants-and-vectors' into 'develop_st…
Naraenda Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 31 additions & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License
#
# Copyright (c) 2017-2024 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -163,6 +163,7 @@ copyright-date:
-D DISABLE_WERROR=OFF
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
-D CMAKE_CXX_COMPILER_LAUNCHER=phc_sccache_cxx
-D CMAKE_CXX_STANDARD="$BUILD_VERSION"
- cmake --build $CI_PROJECT_DIR/build
- if [[ "${BUILD_SHARED_LIBS}" = "ON" ]]; then cmake --build $CI_PROJECT_DIR/build --target package; fi

Expand All @@ -189,6 +190,7 @@ copyright-date:
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
-D CMAKE_CXX_COMPILER_LAUNCHER=phc_sccache_cxx
-D CMAKE_CUDA_COMPILER_LAUNCHER=phc_sccache_cuda
-D CMAKE_CXX_STANDARD=14
- cmake --build $CI_PROJECT_DIR/build
- if [[ "${BUILD_SHARED_LIBS}" = "ON" ]]; then cmake --build $CI_PROJECT_DIR/build --target package; fi

Expand All @@ -200,11 +202,9 @@ copyright-date:
- $CI_PROJECT_DIR/build/test/test_*
- $CI_PROJECT_DIR/build/**/CTestTestfile.cmake
- $CI_PROJECT_DIR/build/benchmark/benchmark_*
- $CI_PROJECT_DIR/build/deps/googlebenchmark/
- $CI_PROJECT_DIR/build/CMakeCache.txt
- $CI_PROJECT_DIR/build/*.deb
- $CI_PROJECT_DIR/build/*.zip
expire_in: 2 weeks

build:rocm-cmake-minimum:
tags:
Expand All @@ -217,6 +217,7 @@ build:rocm-cmake-minimum:
variables:
BUILD_SHARED_LIBS: "ON"
BUILD_BENCHMARK_TUNING: "ON"
BUILD_VERSION: 14

build:rocm-hipcc-cmake-minimum:
tags:
Expand All @@ -228,6 +229,7 @@ build:rocm-hipcc-cmake-minimum:
- .save-artifacts
variables:
BUILD_SHARED_LIBS: "ON"
BUILD_VERSION: 14

build:rocm-static-cmake-minimum:
tags:
Expand All @@ -238,6 +240,7 @@ build:rocm-static-cmake-minimum:
- .rocm:build
variables:
BUILD_SHARED_LIBS: "OFF"
BUILD_VERSION: 14

build:rocm-cmake-latest:
tags:
Expand All @@ -248,6 +251,10 @@ build:rocm-cmake-latest:
- .rocm:build
variables:
BUILD_SHARED_LIBS: "ON"
parallel:
matrix:
- BUILD_VERSION: [14, 17]


build:nvcc-cmake-minimum:
tags:
Expand Down Expand Up @@ -324,13 +331,13 @@ benchmark:benchmark-tuning:
-D BENCHMARK_TUNING_BLOCK_OPTIONS="${BENCHMARK_TUNING_BLOCK_OPTIONS}"
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
-D CMAKE_CXX_COMPILER_LAUNCHER=phc_sccache_cxx
-D CMAKE_CXX_STANDARD=14
- cmake --build $CI_PROJECT_DIR/build --target benchmark_rocrand_tuning
- $CI_PROJECT_DIR/build/benchmark/tuning/benchmark_rocrand_tuning --benchmark_out_format=json --benchmark_out=$CI_PROJECT_DIR/build/rocrand_config_tuning_${GPU_TARGET}_${CI_JOB_ID}.json
artifacts:
paths:
- $CI_PROJECT_DIR/build/library/
- $CI_PROJECT_DIR/build/benchmark/
- $CI_PROJECT_DIR/build/deps/googlebenchmark/
- $CI_PROJECT_DIR/build/CMakeCache.txt
- $CI_PROJECT_DIR/build/*.json
expire_in: 2 weeks
Expand Down Expand Up @@ -420,17 +427,17 @@ benchmark:nvcc:
- .rules:test
script:
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq python3 python3-pip python3-numpy
- $SUDO_CMD apt-get install -y -qq wget
- pip3 install setuptools
- $SUDO_CMD apt-get install -y -qq python3 python3-pip python3-venv
- export ROCRAND_PATH=$CI_PROJECT_DIR/build/library/
# rocRAND Wrapper with Python 3
- pip3 --version
- cd $CI_PROJECT_DIR/python/rocrand
- python3 setup.py test
- pip3 install . --user
- python3 -m venv rocrand-venv
- source rocrand-venv/bin/activate
- python3 -m pip install setuptools numpy
- python3 -m pip install .
- python3 tests/rocrand_test.py
- pip3 uninstall --yes rocrand
- python3 -m pip uninstall --yes rocrand
- deactivate

test:rocm-python:
tags:
Expand Down Expand Up @@ -514,7 +521,11 @@ test:cpp-wrapper:
-D BUILD_FORTRAN_WRAPPER=OFF
-D BUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF
-D CMAKE_CXX_COMPILER=${COMPILER}
- $SUDO_CMD cmake --build $CI_PROJECT_DIR/build_only_install --target install
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
-D CMAKE_CXX_COMPILER_LAUNCHER=phc_sccache_cxx
-D CMAKE_CUDA_COMPILER_LAUNCHER=phc_sccache_cuda
# Preserve $PATH when sudoing
- $SUDO_CMD env PATH="$PATH" cmake --build $CI_PROJECT_DIR/build_only_install --target install
- cmake
-S $CI_PROJECT_DIR/test/package/
-B $CI_PROJECT_DIR/install_test
Expand Down Expand Up @@ -546,6 +557,10 @@ test:doc:
extends:
- .rules:test
- .build:docs
artifacts:
paths:
- $DOCS_DIR/_build/html/
expire_in: 2 weeks

.test:parity:
stage: test
Expand Down Expand Up @@ -604,6 +619,7 @@ test:nvcc-parity:
-D CMAKE_INSTALL_PREFIX:PATH="$CI_PROJECT_DIR/build/install"
-D CMAKE_PREFIX_PATH:PATH="${env:HIP_PATH}/lib/cmake"
-D DISABLE_WERROR=OFF *>&1
-D CMAKE_CXX_STANDARD=14
# Building
- cmake --build "$CI_PROJECT_DIR/build" *>&1

Expand Down Expand Up @@ -632,6 +648,7 @@ test:windows:
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_CXX_COMPILER:FILEPATH="${env:HIP_PATH}/bin/clang++.exe"
-D CMAKE_PREFIX_PATH:FILEPATH="${env:HIP_PATH}/lib/cmake;$CI_PROJECT_DIR/build/install" *>&1
-D CMAKE_CXX_STANDARD=14
# Build package test
- cmake --build "$CI_PROJECT_DIR/build_install_test"
# Copy rocRAND.dll to the package test build directory
Expand Down Expand Up @@ -663,14 +680,15 @@ test:windows:
-D CMAKE_CXX_COMPILER=${COMPILER}
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
-D CMAKE_CXX_COMPILER_LAUNCHER=phc_sccache_cxx
-D CMAKE_CXX_STANDARD=14
- cmake --build ${ROCRAND_STAT_TESTS_DIR}/build
- mkdir ${LOGS_DIR}
- cd ${ROCRAND_STAT_TESTS_DIR}/build
- nproc
artifacts:
paths:
- ${LOGS_DIR}/*
expire_in: never
expire_in: 3 months

# TestU01 SmallCrush, 10 tests, 15 statistics, takes about 5 seconds
statistical-test:crush-small:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ Documentation for rocRAND is available at

### Changed
* Updated several `gfx942` auto tuning parameters.
* Deprecated C++14 and set the default target to C++17.
* Directly accessing the (scrambled) sobol32 and sobol64 constants and direction vectors is deprecated:
* `h_scrambled_sobol32_constants`, use `rocrand_get_scramble_constants32` instead.
* `h_scrambled_sobol64_constants`, use `rocrand_get_scramble_constants64` instead.
* `rocrand_h_sobol32_direction_vectors`, use `rocrand_get_direction_vectors32` instead.
* `rocrand_h_sobol64_direction_vectors`, use `rocrand_get_direction_vectors64` instead.
* `rocrand_h_scrambled_sobol32_direction_vectors`, use `rocrand_get_direction_vectors32` instead.
* `rocrand_h_scrambled_sobol64_direction_vectors`, use `rocrand_get_direction_vectors64` instead.

### Upcoming changes
* C++14 will be removed in the next major release.
* Directly accessing the (scrambled) sobol32 and sobol64 constants and direction vectors will be removed in the next major release.


### Fixed
* Fixed an issue where `mt19937.hpp` would cause kernel errors during auto tuning.
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ include(cmake/VerifyCompiler.cmake)
option(DISABLE_WERROR "Disable building with Werror" ON)

# Build CXX flags
set(CMAKE_CXX_STANDARD 11)
if (NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(DISABLE_WERROR)
Expand All @@ -154,6 +156,12 @@ if(CODE_COVERAGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
endif()

if (CMAKE_CXX_STANDARD EQUAL 14)
message(WARNING "C++14 will be deprecated in the next major release")
elseif(NOT CMAKE_CXX_STANDARD EQUAL 17)
message(FATAL_ERROR "Only C++14 and C++17 are supported")
endif()

# HIP on Windows: xhip is required with clang++ to get __half defined
if (WIN32)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-xhip>")
Expand Down
77 changes: 55 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# rocRAND

> [!NOTE]
> The published rocRAND documentation is available [here](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 `docs` folder of this repository. As with all ROCm projects, the documentation is open source. For more information on contributing to the documentation, see [Contribute to ROCm documentation](https://rocm.docs.amd.com/en/latest/contribute/contributing.html).

The rocRAND project provides functions that generate pseudorandom and quasirandom numbers.
The rocRAND library is implemented in the [HIP](https://github.com/ROCm/HIP)
programming language and optimized for AMD's latest discrete GPUs. It is designed to run on top
Expand All @@ -24,28 +27,6 @@ split into a separate library. As of version 6.0, hipRAND can no longer be built
* Scrambled Sobol64
* ThreeFry

## Documentation

> [!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:

```sh
# Go to the docs directory
cd docs

# Install Python dependencies
python3 -m pip install -r sphinx/requirements.txt

# Build the documentation
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html

# E.g. serve the HTML docs locally
cd _build/html
python3 -m http.server
```

## Requirements

* CMake (3.16 or later)
Expand Down Expand Up @@ -225,6 +206,58 @@ been migrated to the new framework.
* [Fortran wrappers](./library/src/fortran/).
* [Python wrappers](./python/): [rocRAND](./python/rocrand).

## Building the documentation locally

### Requirements

#### Doxygen

The build system uses Doxygen [version 1.9.4](https://github.com/doxygen/doxygen/releases/tag/Release_1_9_4). You can try using a newer version, but that might cause issues.

After you have downloaded Doxygen version 1.9.4:

```shell
# Add doxygen to your PATH
echo 'export PATH=<doxygen 1.9.4 path>/bin:$PATH' >> ~/.bashrc

# Apply the updated .bashrc
source ~/.bashrc

# Confirm that you are using version 1.9.4
doxygen --version
```

#### Python

The build system uses Python version 3.10. You can try using a newer version, but that might cause issues.

You can install Python 3.10 alongside your other Python versions using [pyenv](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation):

```shell
# Install Python 3.10
pyenv install 3.10

# Create a Python 3.10 virtual environment
pyenv virtualenv 3.10 venv_rocrand

# Activate the virtual environment
pyenv activate venv_rocrand
```

### Building

After cloning this repository, and `cd`ing into it:

```shell
# Install Python dependencies
python3 -m pip install -r docs/sphinx/requirements.txt

# Build the documentation
python3 -m sphinx -T -E -b html -d docs/_build/doctrees -D language=en docs docs/_build/html
```

You can then open `docs/_build/html/index.html` in your browser to view the documentation.

## Support

Bugs and feature requests can be reported through the
Expand Down
Loading
Loading