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-20 #515

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
130 changes: 113 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ########################################################################
# Copyright 2019-2024 Advanced Micro Devices, Inc.
# Copyright 2019-2025 Advanced Micro Devices, Inc.
# ########################################################################

include:
Expand All @@ -23,6 +23,10 @@ stages:
- test # Tests if unit tests are passing (CTest)
- benchmark # Runs the non-internal benchmarks (Google Benchmark)

workflow:
rules:
- if: $CI_MERGE_REQUEST_LABELS !~ /CI Skip/

variables:
# Helper variables
PACKAGE_DIR: $BUILD_DIR/package
Expand Down Expand Up @@ -74,7 +78,6 @@ copyright-date:
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-D BUILD_TEST=OFF
-D BUILD_HIPSTDPAR_TEST=OFF
-D BUILD_EXAMPLE=OFF
-D ROCM_DEP_ROCMCORE=OFF
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
Expand Down Expand Up @@ -116,7 +119,6 @@ copyright-date:
-D CMAKE_BUILD_TYPE=$BUILD_TYPE
-D BUILD_$BUILD_TARGET=ON
-D GPU_TARGETS=$GPU_TARGETS
-D AMDGPU_TEST_TARGETS=$GPU_TARGETS
-D RNG_SEED_COUNT=$rng_seed_count
-D PRNG_SEEDS=$prng_seeds
-D CMAKE_C_COMPILER_LAUNCHER=phc_sccache_c
Expand All @@ -137,7 +139,7 @@ copyright-date:
- $CI_PROJECT_DIR/build/.ninja_log
exclude:
- $CI_PROJECT_DIR/build/**/*.o
expire_in: 2 weeks
expire_in: 1 day

build:cmake-latest:
stage: build
Expand Down Expand Up @@ -183,7 +185,7 @@ build:package:
paths:
- $PACKAGE_DIR/rocthrust*.deb
- $PACKAGE_DIR/rocthrust*.zip
expire_in: 2 weeks
expire_in: 1 day

build:windows:
stage: build
Expand Down Expand Up @@ -231,7 +233,7 @@ build:windows:
paths:
- $CI_PROJECT_DIR/build/
- $ROCPRIM_DIR/build/install
expire_in: 2 weeks
expire_in: 1 day

test:package:
stage: test
Expand Down Expand Up @@ -268,13 +270,18 @@ test:doc:
extends:
- .build:docs
- .rules:test
artifacts:
paths:
- $DOCS_DIR/_build/html/
expire_in: 2 weeks

test:
.test:rocm:
stage: test
tags:
- rocm
- $GPU
extends:
- .cmake-minimum
- .rules:test
- .gpus:rocm
needs:
- job: build:cmake-minimum
parallel:
Expand All @@ -294,10 +301,76 @@ test:
- HSA_ENABLE_SDMA=0 ctest
--output-on-failure
--repeat-until-fail 2
--tests-regex $GPU_TARGET
--resource-spec-file ./resources.json
--parallel $PARALLEL_JOBS

test:rocm-any-gpu:
variables:
GPU: ""
PARALLEL_JOBS: 1
extends:
- .test:rocm
rules:
- if: $CI_MERGE_REQUEST_TITLE =~ /Draft:/ && $CI_MERGE_REQUEST_LABELS !~ /Arch::/

test:rocm-label-arch:
extends:
- .gpus:rocm
- .test:rocm
- .rules:arch-labels

test:rocm-all-gpus:
variables:
SHOULD_BE_UNDRAFTED: "true"
extends:
- .gpus:rocm
- .test:rocm
- .rules:test

test-bitwise-repro-generate:
stage: test
extends:
- .cmake-minimum
- .rules:manual
- .gpus:rocm
needs:
- job: build:cmake-minimum
parallel:
matrix:
- BUILD_TYPE: Release
BUILD_TARGET: TEST
BUILD_VERSION: 14
cache:
key: database
paths:
- $CI_PROJECT_DIR/bitwise.db
policy: push
script:
- cd $CI_PROJECT_DIR/build/test/
- ROCTHRUST_BWR_PATH=$CI_PROJECT_DIR/bitwise.db ROCTHRUST_BWR_GENERATE=1 ./reproducibility.hip

test-bitwise-repro:
stage: test
extends:
- .cmake-minimum
- .rules:test
- .gpus:rocm
needs:
- job: build:cmake-minimum
parallel:
matrix:
- BUILD_TYPE: Release
BUILD_TARGET: TEST
BUILD_VERSION: 14
cache:
key: database
paths:
- $CI_PROJECT_DIR/bitwise.db
policy: pull
script:
- cd $CI_PROJECT_DIR/build/test/
- ROCTHRUST_BWR_PATH=$CI_PROJECT_DIR/bitwise.db ./reproducibility.hip

.rocm-windows:test:
extends:
- .gpus:rocm-windows
Expand Down Expand Up @@ -358,7 +431,7 @@ build:cuda-and-omp:
tags:
- build
variables:
CCCL_GIT_BRANCH: v2.5.0
CCCL_GIT_BRANCH: v2.6.0
CCCL_DIR: ${CI_PROJECT_DIR}/cccl
needs: []
script:
Expand Down Expand Up @@ -402,16 +475,17 @@ build:cuda-and-omp:
- $CCCL_DIR/thrust/cmake/ThrustRunTest.cmake
- $CCCL_DIR/thrust/cmake/ThrustRunExample.cmake
- $CI_PROJECT_DIR/build/.ninja_log
expire_in: 1 week
expire_in: 1 day

test:cuda-and-omp:
.test:cuda-and-omp:
stage: test
tags:
- nvcc
- $GPU
needs:
- build:cuda-and-omp
extends:
- .nvcc
- .gpus:nvcc
- .rules:test
before_script:
# This is only needed because of the legacy before_script in .gpus:nvcc would otherwise overwrite before_script
- !reference [.nvcc, before_script]
Expand All @@ -420,6 +494,23 @@ test:cuda-and-omp:
# These tests are executed on the build stage because they require sources
- ctest --output-on-failure --exclude-regex "thrust.example.cmake.add_subdir|thrust.test.cmake.check_source_files"

test:cuda-and-omp-any-gpu:
variables:
GPU: ""
PARALLEL_JOBS: 1
extends:
- .test:cuda-and-omp
rules:
- if: $CI_MERGE_REQUEST_TITLE =~ /Draft:/

test:cuda-and-omp-all-gpus:
variables:
SHOULD_BE_UNDRAFTED: "true"
extends:
- .gpus:nvcc
- .test:cuda-and-omp
- .rules:test

.benchmark-base:
stage: benchmark
extends:
Expand All @@ -430,7 +521,12 @@ test:cuda-and-omp:

benchmark:
needs:
- build:cmake-minimum
- job: build:cmake-minimum
parallel:
matrix:
- BUILD_TYPE: Release
BUILD_TARGET: BENCHMARKS
BUILD_VERSION: 14
extends:
- .cmake-minimum
- .gpus:rocm
Expand All @@ -453,4 +549,4 @@ benchmark:
artifacts:
paths:
- ${BENCHMARK_RESULT_DIR}
expire_in: 1 week
expire_in: 1 day
15 changes: 7 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ########################################################################
# Copyright 2019-2024 Advanced Micro Devices, Inc.
# Copyright 2019-2025 Advanced Micro Devices, Inc.
# ########################################################################

cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
Expand Down Expand Up @@ -84,6 +84,7 @@ option(BUILD_HIPSTDPAR_TEST "Build hipstdpar tests" OFF)
option(BUILD_EXAMPLES "Build examples" OFF)
option(BUILD_BENCHMARKS "Build benchmarks" OFF)
option(DOWNLOAD_ROCPRIM "Download rocPRIM and do not search for rocPRIM package" OFF)
cmake_dependent_option(DOWNLOAD_ROCRAND "Download rocRAND and do not search for rocRAND package" OFF BUILD_BENCHMARKS OFF)
option(BUILD_ADDRESS_SANITIZER "Build with address sanitizer enabled" OFF)
cmake_dependent_option(ENABLE_UPSTREAM_TESTS "Enable upstream (thrust) tests" ON BUILD_TEST OFF)
#Set the header wrapper OFF by default.
Expand Down Expand Up @@ -113,10 +114,9 @@ endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(DISABLE_WERROR)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra ")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
set(COMPILE_OPTIONS -Wall -Wextra)
if(NOT DISABLE_WERROR)
list(APPEND COMPILE_OPTIONS -Werror)
endif()

if (CMAKE_CXX_STANDARD EQUAL 14)
Expand All @@ -132,13 +132,13 @@ endif()

# Address Sanitizer
if(BUILD_ADDRESS_SANITIZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -shared-libasan")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -shared-libasan")
list(APPEND COMPILE_OPTIONS -fsanitize=address -shared-libasan)
add_link_options(-fuse-ld=lld)
endif()

# Setup VERSION
rocm_setup_version(VERSION "3.3.0")
math(EXPR rocthrust_VERSION_NUMBER "${rocthrust_VERSION_MAJOR} * 100000 + ${rocthrust_VERSION_MINOR} * 100 + ${rocthrust_VERSION_PATCH}")

# Print configuration summary
include(cmake/Summary.cmake)
Expand Down Expand Up @@ -174,7 +174,6 @@ endif()
# Benchmarks
if(BUILD_BENCHMARKS)
add_subdirectory(benchmarks)
add_subdirectory(internal/benchmark)
endif()

#Create header wrapper for backward compatibility
Expand Down
76 changes: 53 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# rocThrust

> [!NOTE]
> The published documentation is available at [rocThrust](https://rocm.docs.amd.com/projects/rocThrust/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 published rocThrust documentation is available [here](https://rocm.docs.amd.com/projects/rocThrust/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).

Thrust is a parallel algorithm library. It has been ported to
[HIP](https://github.com/ROCm/HIP) and [ROCm](https://www.github.com/ROCm/ROCm), which use
Expand Down Expand Up @@ -35,28 +35,6 @@ For ROCm hardware requirements, refer to:
* [Linux support](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html)
* [Windows support](https://rocm.docs.amd.com/projects/install-on-windows/en/latest/reference/system-requirements.html)

## Documentation

Documentation for rocThrust available at
[https://rocm.docs.amd.com/projects/rocThrust/en/latest/](https://rocm.docs.amd.com/projects/rocThrust/en/latest/).

You can build our documentation locally using the following commands:

```shell
# Go to rocThrust docs directory
cd rocThrust; 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

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

## Build and install

```sh
Expand Down Expand Up @@ -309,6 +287,58 @@ ctest --output-on-failure
* Notice that oneTBB (oneAPI TBB) may fail to compile when libstdc++-9 or -10 is used, due to them using legacy TBB interfaces that are incompatible with the oneTBB ones (see the [release notes](https://www.intel.com/content/www/us/en/developer/articles/release-notes/intel-oneapi-threading-building-blocks-release-notes.html)).
* CMake (3.10.2 or later)

## 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_rocthrust

# Activate the virtual environment
pyenv activate venv_rocthrust
```

### 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

You can report bugs and feature requests through the GitHub
Expand Down
Loading