Skip to content

Commit

Permalink
Develop stream 2024-10-28 (#574)
Browse files Browse the repository at this point in the history
* ci: set up sccache

* ci: Add crush statistical tests

* ci: Add statistical tests for distributions

* ci: Use sccache with statistical tests

* build(docs): update and cleanup depedencies

* ci: Do not create packages with static libraries

Binaries of tests and benchmarks are large with static linking, packing
takes about 12 minutes (though these packages are not used).

* remove TBB dependency

The host-side generators are only really provided for cuRAND compatibility.
Their performance is not really of interest, and removing the TBB dependency
eases packaging and maintenance.

* Resolve "Add small examples to API documentation"

* fix(benchmark/tuning): fix one definition rule violation

* Apply suggestions from code review

docs(api-reference/cpp-api): improve grammar and punctuation

Co-authored-by: Jeffrey Novotny <[email protected]>

* docs(api-reference/cpp-api): reword sections in c host api

* chore: bump version and fix changelog

---------

Co-authored-by: Robin Voetter <[email protected]>
Co-authored-by: Anton Gorenko <[email protected]>
Co-authored-by: Borys Petrov <[email protected]>
Co-authored-by: Mátyás Aradi <[email protected]>
Co-authored-by: Jeffrey Novotny <[email protected]>
  • Loading branch information
6 people authored Nov 20, 2024
1 parent 85d2c98 commit 7f0ee87
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 28 deletions.
113 changes: 111 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ include:
- /deps-rocm.yaml
- /deps-nvcc.yaml
- /deps-windows.yaml
- /deps-compiler-acceleration.yaml
- /gpus-rocm.yaml
- /gpus-nvcc.yaml
- /rules.yaml
Expand Down Expand Up @@ -68,59 +69,71 @@ copyright-date:
extends:
- .deps:rocm
- .deps:cmake-minimum
- .deps:compiler-acceleration
before_script:
- !reference [".deps:rocm", before_script]
- !reference [".deps:cmake-minimum", before_script]
- !reference [".deps:compiler-acceleration", before_script]

.rocm:cmake-latest:
variables:
COMPILER: /opt/rocm/bin/amdclang++
extends:
- .deps:rocm
- .deps:cmake-latest
- .deps:compiler-acceleration
before_script:
- !reference [".deps:rocm", before_script]
- !reference [".deps:cmake-latest", before_script]
- !reference [".deps:compiler-acceleration", before_script]

.rocm-hipcc:cmake-minimum:
variables:
COMPILER: /opt/rocm/bin/hipcc
extends:
- .deps:rocm
- .deps:cmake-minimum
- .deps:compiler-acceleration
before_script:
- !reference [".deps:rocm", before_script]
- !reference [".deps:cmake-minimum", before_script]
- !reference [".deps:compiler-acceleration", before_script]

.nvcc:cmake-minimum:
variables:
COMPILER: /usr/bin/g++
extends:
- .deps:nvcc
- .deps:cmake-minimum
- .deps:compiler-acceleration
before_script:
- !reference [".deps:nvcc", before_script]
- !reference [".deps:cmake-minimum", before_script]
- !reference [".deps:compiler-acceleration", before_script]

.nvcc:cmake-latest:
variables:
COMPILER: /usr/bin/g++
extends:
- .deps:nvcc
- .deps:cmake-latest
- .deps:compiler-acceleration
before_script:
- !reference [".deps:nvcc", before_script]
- !reference [".deps:cmake-latest", before_script]
- !reference [".deps:compiler-acceleration", before_script]

.nvcc-clang:cmake-minimum:
variables:
COMPILER: /usr/local/bin/clang++
extends:
- .deps:nvcc
- .deps:cmake-latest
- .deps:compiler-acceleration
before_script:
- !reference [".deps:nvcc", before_script]
- !reference [".deps:cmake-latest", before_script]
- !reference [".deps:compiler-acceleration", before_script]

.rocm:build:
variables:
Expand Down Expand Up @@ -148,8 +161,10 @@ copyright-date:
-D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-D AMDGPU_TARGETS=${GPU_TARGETS}
-D DISABLE_WERROR=OFF
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
-D CMAKE_CXX_COMPILER_LAUNCHER=phc_sccache_cxx
- cmake --build $CI_PROJECT_DIR/build
- cmake --build $CI_PROJECT_DIR/build --target package
- if [[ "${BUILD_SHARED_LIBS}" = "ON" ]]; then cmake --build $CI_PROJECT_DIR/build --target package; fi

.nvcc:build:
stage: build
Expand All @@ -171,8 +186,11 @@ copyright-date:
-D BUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF
-D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-D NVGPU_TARGETS=${GPU_TARGETS}
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
-D CMAKE_CXX_COMPILER_LAUNCHER=phc_sccache_cxx
-D CMAKE_CUDA_COMPILER_LAUNCHER=phc_sccache_cuda
- cmake --build $CI_PROJECT_DIR/build
- cmake --build $CI_PROJECT_DIR/build --target package
- if [[ "${BUILD_SHARED_LIBS}" = "ON" ]]; then cmake --build $CI_PROJECT_DIR/build --target package; fi

# Build output is too big to upload in the case of the static library builds
.save-artifacts:
Expand Down Expand Up @@ -304,6 +322,8 @@ benchmark:benchmark-tuning:
-D BENCHMARK_TUNING_MIN_GRID_SIZE=${BENCHMARK_TUNING_MIN_GRID_SIZE}
-D BENCHMARK_TUNING_THREAD_OPTIONS="${BENCHMARK_TUNING_THREAD_OPTIONS}"
-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
- 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:
Expand Down Expand Up @@ -618,3 +638,92 @@ test:windows:
- cmake -E copy "$CI_PROJECT_DIR/build/install/bin/rocRAND.dll" "$CI_PROJECT_DIR/build_install_test" *>&1
# Run package test
- ctest --test-dir "$CI_PROJECT_DIR/build_install_test" -C $CMAKE_BUILD_TYPE --output-on-failure *>&1

.statistical-test:
stage: test
needs:
- build:rocm-cmake-minimum
extends:
- .rocm:cmake-minimum
variables:
ROCRAND_STAT_TESTS_GIT_BRANCH: "develop_stream"
ROCRAND_STAT_TESTS_DIR: ${CI_PROJECT_DIR}/rocrand-statistical-tests
LOGS_DIR: ${CI_PROJECT_DIR}/logs
script:
- $SUDO_CMD apt-get update -qq
- $SUDO_CMD apt-get install -y -qq python3
- cd $CI_PROJECT_DIR/build
- $SUDO_CMD dpkg -i rocrand_*.deb rocrand-dev*.deb
- cd $CI_PROJECT_DIR
- git clone -b ${ROCRAND_STAT_TESTS_GIT_BRANCH} https://gitlab-ci-token:${CI_JOB_TOKEN}@${ROCRAND_STAT_TESTS_GIT_URL}
- cmake
-S ${ROCRAND_STAT_TESTS_DIR}
-B ${ROCRAND_STAT_TESTS_DIR}/build
-G Ninja
-D CMAKE_CXX_COMPILER=${COMPILER}
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
-D CMAKE_CXX_COMPILER_LAUNCHER=phc_sccache_cxx
- cmake --build ${ROCRAND_STAT_TESTS_DIR}/build
- mkdir ${LOGS_DIR}
- cd ${ROCRAND_STAT_TESTS_DIR}/build
- nproc
artifacts:
paths:
- ${LOGS_DIR}/*
expire_in: never

# TestU01 SmallCrush, 10 tests, 15 statistics, takes about 5 seconds
statistical-test:crush-small:
tags:
- rocm
extends:
- .statistical-test
- .rules:manual
script:
- !reference [".statistical-test", script]
- python3 -u run_crush.py --logs_dir ${LOGS_DIR} --battery small |& tee ${LOGS_DIR}/summary-crush-small.log

# TestU01 Crush, 96 tests, 144 statistics, takes about 30 minutes
statistical-test:crush-medium:
tags:
- rocm
- big-parallel
extends:
- .statistical-test
- .rules:manual
script:
- !reference [".statistical-test", script]
- python3 -u run_crush.py --logs_dir ${LOGS_DIR} --battery medium |& tee ${LOGS_DIR}/summary-crush-medium.log

# TestU01 BigCrush, 116 tests, 160 statistics, takes about 3 hours
statistical-test:crush-big:
tags:
- rocm
- big-parallel
extends:
- .statistical-test
- .rules:manual
timeout: 8h
script:
- !reference [".statistical-test", script]
- python3 -u run_crush.py --logs_dir ${LOGS_DIR} --battery big |& tee ${LOGS_DIR}/summary-crush-big.log

# Dieharder, 114 tests, takes about 25 minutes
statistical-test:dieharder:
extends:
- .statistical-test
- .rules:manual
script:
- !reference [".statistical-test", script]
- $SUDO_CMD apt-get install -y -qq dieharder
- python3 -u run_dieharder.py --logs_dir ${LOGS_DIR} |& tee ${LOGS_DIR}/summary-dieharder.log

# Distribution tests: Pearson, Anderson-Darling, Kolmogorov-Smirnov
statistical-test:distributions:
extends:
- .statistical-test
- .rules:test
- .gpus:rocm
script:
- !reference [".statistical-test", script]
- ./test_distributions_generate --engine all --dis all --runs 100 |& tee ${LOGS_DIR}/summary-distributions.log
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
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.4
## (Unreleased) rocRAND 3.3.0 for ROCm 6.4

### Added

* Added extended tests to `rtest.py`. These tests are extra tests that did not fit the criteria of smoke and regression tests. These tests will take much longer to run relative to smoke and regression tests. Use `python rtest.py [--emulation|-e|--test|-t]=extended` to run these tests.
* Added regression tests to `rtest.py`. These tests recreate scenarios that have caused hardware problems in past emulation environments. Use `python rtest.py [--emulation|-e|--test|-t]=regression` to run these tests.
* Added smoke test options, which runs a subset of the unit tests and ensures that less than 2gb of VRAM will be used. Use `python rtest.py [--emulation|-e|--test|-t]=smoke` to run these tests.
Expand All @@ -15,6 +15,7 @@ Documentation for rocRAND is available at
### Changed

* `--test|-t` is no longer a required flag for `rtest.py`. Instead, the user can use either `--emulation|-e` or `--test|-t`, but not both.
* Removed TBB dependency for multi-core processing of host-side generation.

## rocRAND 3.2.0 for ROCm 6.3.0

Expand All @@ -34,7 +35,7 @@ Documentation for rocRAND is available at

## Fixes

* Fixed " unknown extension ?>" issue in scripts/config-tuning/select_best_config.py
* 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`.

Expand All @@ -60,7 +61,7 @@ Documentation for rocRAND is available at
* If TBB is not found when configuring rocRAND, the configuration is still successful, and the host generators are executed on a single CPU thread.
* Added the option to create a host generator to the Python wrapper
* Added the option to create a host generator to the Fortran wrapper
* Added dynamic ordering. This ordering is free to rearrange the produced numbers,
* Added dynamic ordering. This ordering is free to rearrange the produced numbers,
which can be specific to devices and distributions. It is implemented for:
* XORWOW, MRG32K3A, MTGP32, Philox 4x32-10, MRG31K3P, LFSR113, and ThreeFry
* For the NVIDIA platform compilation using clang as the host compiler is now supported.
Expand All @@ -79,7 +80,7 @@ Documentation for rocRAND is available at

### Changes

* For device-side generators, you can now wrap calls to rocrand_generate_* inside of a hipGraph. There are a few
* For device-side generators, you can now wrap calls to rocrand_generate_* inside of a hipGraph. There are a few
things to be aware of:
- Generator creation (rocrand_create_generator), initialization (rocrand_initialize_generator), and destruction (rocrand_destroy_generator) must still happen outside the hipGraph.
- After the generator is created, you may call API functions to set its seed, offset, and order.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ if(BUILD_FILE_REORG_BACKWARD_COMPATIBILITY AND NOT WIN32)
endif()

# Set version variables
rocm_setup_version( VERSION "3.2.0" )
rocm_setup_version( VERSION "3.3.0" )
set ( rocrand_VERSION ${rocRAND_VERSION} )
# Old-style version number used within the library's API. rocrand_get_version should be modified.
math(EXPR rocrand_VERSION_NUMBER "${rocRAND_VERSION_MAJOR} * 100000 + ${rocRAND_VERSION_MINOR} * 100 + ${rocRAND_VERSION_PATCH}")
Expand Down
6 changes: 3 additions & 3 deletions benchmark/custom_csv_formater.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ class customCSVReporter : public BenchmarkReporter
"error_message"};
};

bool customCSVReporter::ReportContext(const Context& context)
inline bool customCSVReporter::ReportContext(const Context& context)
{
PrintBasicContext(&GetErrorStream(), context);
return true;
}

void customCSVReporter::ReportRuns(const std::vector<Run>& reports)
inline void customCSVReporter::ReportRuns(const std::vector<Run>& reports)
{
std::ostream& Out = GetOutputStream();

Expand Down Expand Up @@ -149,7 +149,7 @@ void customCSVReporter::ReportRuns(const std::vector<Run>& reports)
}
}

void customCSVReporter::PrintRunData(const Run& run)
inline void customCSVReporter::PrintRunData(const Run& run)
{
std::ostream& Out = GetOutputStream();
std::ostream& Err = GetErrorStream();
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/doxygen/xml/
/doxygen/*.tag
/sphinx/_toc.yml
fortran-api-reference.md
Loading

0 comments on commit 7f0ee87

Please sign in to comment.