Skip to content

Commit

Permalink
Add cuda_parallel to CI. (#2338)
Browse files Browse the repository at this point in the history
* Add python cuda_parallel to CI.
* Fix cuda.parallel installation order
* WAR occupancy/V100 failure
* Update cuda_cooperative readme

---------

Co-authored-by: Georgy Evtushenko <[email protected]>
  • Loading branch information
alliepiper and gevtushenko committed Sep 4, 2024
1 parent a154e7b commit 1e9125e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
6 changes: 5 additions & 1 deletion c/src/reduce.cu
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,12 @@ cudaError_t InvokePasses(
// Init regular kernel configuration
const auto tile_size = policy.block_size * policy.items_per_thread;

// TODO Should be checking the return code here, but for some reason I'm getting invalid handle error on V100
int sm_occupancy = 1;
check(cuOccupancyMaxActiveBlocksPerMultiprocessor(&sm_occupancy, reduce_kernel, policy.block_size, 0));
if (CUDA_SUCCESS != cuOccupancyMaxActiveBlocksPerMultiprocessor(&sm_occupancy, reduce_kernel, policy.block_size, 0))
{
sm_occupancy = 6;
}

int reduce_device_occupancy = sm_occupancy * sm_count;

Expand Down
15 changes: 13 additions & 2 deletions ci/test_pycuda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,19 @@ export PYTHONPATH="${prefix}:${PYTHONPATH:-}"

pushd ../python/cuda_cooperative >/dev/null

run_command "⚙️ Pip install cuda" pip install --force-reinstall --target "${prefix}" .[test]
run_command "🚀 Pytest cuda" python -m pytest -v ./tests
run_command "⚙️ Pip install cuda_cooperative" pip install --force-reinstall --upgrade --target "${prefix}" .[test]
run_command "🚀 Pytest cuda_cooperative" python -m pytest -v ./tests

popd >/dev/null

pushd ../python/cuda_parallel >/dev/null

# Temporarily install the package twice to populate include directory as part of the first installation
# and to let manifest discover these includes during the second installation. Do not forget to remove the
# second installation after https://github.com/NVIDIA/cccl/issues/2281 is addressed.
run_command "⚙️ Pip install cuda_parallel once" pip install --force-reinstall --upgrade --target "${prefix}" .[test]
run_command "⚙️ Pip install cuda_parallel twice" pip install --force-reinstall --upgrade --target "${prefix}" .[test]
run_command "🚀 Pytest cuda_parallel" python -m pytest -v ./tests

popd >/dev/null

Expand Down
2 changes: 1 addition & 1 deletion python/cuda_cooperative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Please visit the documentation here: https://nvidia.github.io/cccl/python.html.

```bash
pip3 install -e .[test]
pytest -v ./tests/device/
pytest -v ./tests/
```

0 comments on commit 1e9125e

Please sign in to comment.