Skip to content

Commit ab3a275

Browse files
authored
Upgrade to async-capable (for kernel launches and memory transfers) rust-cuda (#276)
* Initial progress towards using rust-cuda with async Some progress Further async integration progress, rustcoalescence fails to compile Some progress with dispatch coersion Small cleanup Cleanup cuda algorithm coersion Some more cleanup Add back missing Backup for SeaHash and WyHash rngs Fix CUDA kernel extraneous pub exports Minor improvement of the event buffer hack Remove unused control_flow_enum feature Revert Copy for [Indexed]Location Revert new clone Update to rust-cuda with async kernel launch async return Update to latest rust-cuda Fix rustfmt Temporary fix to allow CUDA algorithm linking Small cleanup, mostly of unused clippy allows Small improvement to CUDA EventBuffer Try trait-based kernel signature check Update rust-toolchain Fix clippy lints Try with const match instead Try with memcmp intrinsic Try out experimental const-type-layout with compression Try interning all const layout strings Try check Try check again * Small fixes after rebase * Use cuda with (hopefully) much faster type checks * Try with llvm-bitcode-linker * Upgrade to latest ptx-builder * Fix codecov action * Fix RUSTFLAGS merging for ptx kernels in codecov CI https://blog.rust-lang.org/inside-rust/2023/08/24/cargo-config-merging.html https://doc.rust-lang.org/cargo/reference/config.html#command-line-overrides * Update const-type-layout
1 parent 0602676 commit ab3a275

File tree

106 files changed

+1380
-1438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+1380
-1438
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ jobs:
3232
run: |
3333
sudo apt-get update -q
3434
sudo apt-get install libopenmpi-dev -y --no-install-recommends
35-
36-
- name: Install the rust-ptx-linker
37-
run: |
38-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
39-
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
40-
rm llvm.sh
41-
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
4235
4336
- name: Check the default features
4437
run: cargo check
@@ -64,13 +57,6 @@ jobs:
6457
run: |
6558
sudo apt-get update -q
6659
sudo apt-get install libopenmpi-dev -y --no-install-recommends
67-
68-
- name: Install the rust-ptx-linker
69-
run: |
70-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
71-
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
72-
rm llvm.sh
73-
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
7460
7561
- name: Run the test-suite
7662
run: cargo test --workspace --no-fail-fast
@@ -104,13 +90,6 @@ jobs:
10490
sudo apt-get update -q
10591
sudo apt-get install libopenmpi-dev -y --no-install-recommends
10692
107-
- name: Install the rust-ptx-linker
108-
run: |
109-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
110-
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
111-
rm llvm.sh
112-
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
113-
11493
- name: Check the code style for the default features
11594
run: cargo clippy -- -D warnings
11695

.github/workflows/coverage.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,26 @@ jobs:
3131
sudo apt-get update -q
3232
sudo apt-get install libopenmpi-dev -y --no-install-recommends
3333
34-
- name: Install the Rust toolchain
34+
- name: Generate the coverage data
3535
run: |
36-
cargo install grcov --force --locked
37-
rustup component add llvm-tools-preview
38-
39-
- name: Install the rust-ptx-linker
36+
cargo clean
37+
cargo \
38+
--config "target.'cfg(all())'.rustflags=['-Cinstrument-coverage']" \
39+
test --workspace --all-targets
40+
env:
41+
CARGO_INCREMENTAL: 0
42+
RUSTDOCFLAGS: -Cinstrument-coverage
43+
LLVM_PROFILE_FILE: coverage/coverage-%p-%m.profraw
44+
45+
- name: Download grcov
4046
run: |
41-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
42-
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
43-
rm llvm.sh
44-
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
45-
46-
- name: Generate the code coverage
47+
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
48+
chmod +x ./grcov
49+
50+
- name: Generate the coverage reports
4751
run: |
48-
RUSTFLAGS="-Cinstrument-coverage" \
49-
LLVM_PROFILE_FILE="codecov-%p-%m.profraw" \
50-
cargo test --workspace
51-
52-
grcov . -s . --binary-path ./target/debug/ \
53-
-t cobertura -o cobertura.xml --branch \
52+
./grcov . -s . --binary-path ./target/debug/deps \
53+
-t lcov -o coverage.lcov --branch \
5454
--keep-only "necsim/*" \
5555
--keep-only "rustcoalescence/*" \
5656
--ignore-not-existing \
@@ -62,4 +62,5 @@ jobs:
6262
uses: codecov/codecov-action@v1
6363
with:
6464
token: ${{ secrets.CODECOV_TOKEN }}
65+
files: coverage.lcov
6566
fail_ci_if_error: true

.github/workflows/rustdoc.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ jobs:
2121
sudo apt-get update -q
2222
sudo apt-get install libopenmpi-dev -y --no-install-recommends
2323
24-
- name: Install the rust-ptx-linker
25-
run: |
26-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh
27-
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+")
28-
rm llvm.sh
29-
cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force
30-
3124
- name: Build the Documentation
3225
run: |
3326
RUSTDOCFLAGS="\

.gitpod.Dockerfile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ RUN echo "debconf debconf/frontend select Noninteractive" | sudo debconf-set-sel
88
echo "keyboard-configuration keyboard-configuration/layout select 'English (US)'" | sudo debconf-set-selections && \
99
echo "keyboard-configuration keyboard-configuration/layoutcode select 'us'" | sudo debconf-set-selections && \
1010
echo "resolvconf resolvconf/linkify-resolvconf boolean false" | sudo debconf-set-selections && \
11-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin && \
12-
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \
13-
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && \
14-
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /" && \
11+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb -O cuda_keyring.deb && \
12+
sudo dpkg -i cuda_keyring.deb && \
13+
rm cuda_keyring.deb && \
14+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin && \
15+
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \
16+
sudo add-apt-repository deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ / && \
1517
sudo apt-get update -q && \
16-
sudo apt-get install cuda -y --no-install-recommends && \
17-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && \
18-
sudo ./llvm.sh $(rustc --version -v | grep -oP "LLVM version: \K\d+") && \
19-
rm llvm.sh && \
18+
sudo apt-get install cuda-12-3 -y --no-install-recommends && \
2019
sudo apt-get clean autoclean && \
2120
sudo apt-get autoremove -y && \
2221
sudo rm -rf /var/lib/{apt,dpkg,cache,log}/
@@ -31,6 +30,5 @@ RUN sudo apt-get update -q && \
3130
sudo apt-get autoremove -y && \
3231
sudo rm -rf /var/lib/{apt,dpkg,cache,log}/
3332

34-
RUN cargo install rust-ptx-linker --git https://github.com/juntyr/rust-ptx-linker --force && \
35-
cargo install cargo-mpirun --force && \
33+
RUN cargo install cargo-mpirun --force && \
3634
cargo install cargo-reaper --git https://github.com/juntyr/grim-reaper --force

0 commit comments

Comments
 (0)