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

Add graph support #311

Closed
wants to merge 76 commits into from
Closed

Add graph support #311

wants to merge 76 commits into from

Conversation

matmanc
Copy link
Contributor

@matmanc matmanc commented Jan 24, 2025

CUDA Graph API seems a promising addition to the already existing cuda streams. Especially to mix host and device function in a complex order. Moreover, also HIP supports cuda graphs so it feels natural to extend cudawrappers to supports graph.

In this pull request the basic functionality of cuda graph api are introduced.

Clone and verify on a machine with an NVIDIA GPU

cd $(mktemp -d --tmpdir cudawrappers-XXXXXX)
git clone https://github.com/nlesc-recruit/cudawrappers .
git checkout <this-branch>
cmake -S . -B build -CD -DCUDAWRAPPERS_BUILD_TESTING=True
make -C build
make -C build format # Nothing should change
make -C build lint # linting is broken until we fix the issues (see #92)
build/tests/test_graph

Clone and verify on a machine with HIP and AMD GPU

git clone https://github.com/nlesc-recruit/cudawrappers .
git checkout <this-branch>
cmake -S . -B build -CD -DCUDAWRAPPERS_BUILD_TESTING=True -DCUDA_WRAPPERS_BACKEND_HIP=True
make -C build
make -C build format # Nothing should change
build/tests/test_graph

csbnw and others added 30 commits January 20, 2025 15:34
* Update changelog
* Bump version number to 0.6.0
Co-authored-by: Bram Veenboer <[email protected]>
* Make Function::getAttribute const
* Add Function::name
* Add HostMemory::size
* Add DeviceMemory::size
* Add Module constructor with CUjit_option map
* Update CHANGELOG
* Remove <T> for Wrapper constructors
* Update changelog
updates:
- [github.com/pre-commit/mirrors-clang-format: v16.0.6 → v17.0.6](pre-commit/mirrors-clang-format@v16.0.6...v17.0.6)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Support size = 0 for DeviceMemory constructor
* Fix cu::HostMemory constructor
* Add missing checkCudaCall arround free/unregister calls
* Pass the correct pointer to cuMemHostRegister
* Use int for return type of CU_POINTER_ATTRIBUTE_IS_MANAGED query
* Initialize size in Stream::memAllocAsync
This is indeed more accurate.

Co-authored-by: Bram Veenboer <[email protected]>
* Update CHANGELOG.md
* Add mdformat to pre-commit configuration
* Change Unreleased to 0.7.0
* Cleanup of changelog
csbnw and others added 28 commits January 20, 2025 15:35
* Add nvml::Device::getClock
* Update CHANGELOG
* Add test
updates:
- [github.com/pre-commit/mirrors-clang-format: v18.1.5 → v18.1.8](pre-commit/mirrors-clang-format@v18.1.5...v18.1.8)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update CHANGELOG
* Update version number to 0.8.0
* Changes to incline local includes:
- #include must be the start of a line
- the inlined included is placed in the same line as the original
  #include

* Update cmake/cudawrappers-helper.cmake

Co-authored-by: Bram Veenboer <[email protected]>

* Update cmake/cudawrappers-helper.cmake

Co-authored-by: Bram Veenboer <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update cmake/cudawrappers-helper.cmake

Co-authored-by: Bram Veenboer <[email protected]>

* Add updates to inline_local_includes to CHANGELOG

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Bram Veenboer <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hanno Spreeuw <[email protected]>
Co-authored-by: Leon Oostrum <[email protected]>
Co-authored-by: John Romein <[email protected]>
* Add option to create slice of device memory

* Add new DeviceMemory constructor to changelog

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update C++ standard to C++14
* Upgrade to Catch 3.6.0
* include cuda_runtime in cu.hpp
---------

Co-authored-by: Bram Veenboer <[email protected]>
* Cleanup test of cu::DeviceMemory
* Add DeviceMemory::memset methods + tests
* Add Stream::memsetAsync methods + tests
updates:
- [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.1](pre-commit/mirrors-clang-format@v18.1.8...v19.1.1)
- [github.com/executablebooks/mdformat: 0.7.17 → 0.7.18](hukkin/mdformat@0.7.17...0.7.18)
updates:
- [github.com/pre-commit/mirrors-clang-format: v19.1.1 → v19.1.3](pre-commit/mirrors-clang-format@v19.1.1...v19.1.3)
* Added `cu::Stream::memcpyHtoD2DAsync()`, `cu::Stream::memcpyDtoHD2Async()`,
  and `cu::Stream::memcpyDtoD2DAsync()`
* Added `cu::DeviceMemory::memset2D()` and `cu::Stream::memset2DAsync()`
* Added `cufft::FFT1DR2C` and `cufft::FFT1DC2R`
* Added `cu::Device::getOrdinal()`
* Allow non-managed memory dereferencing in `cu::DeviceMemory`  

---------

Co-authored-by: Bram Veenboer <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Update cuda-Jimver/toolkit to v0.2.19
* Change CUDA version to 12.6.1
* Remove unused context agument from nvml::Device
* Add missing checkNvmlCall
* Make nvml::Device functions const
* Add pass_filenames option to workaround cppcheck error
@matmanc matmanc requested a review from csbnw January 24, 2025 12:00
@matmanc matmanc closed this Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants