Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 69 additions & 1 deletion .github/workflows/cutile-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ jobs:
command -v tileiras
tileiras --help | grep -q "sm_120"

- uses: $/cutile-rs/.github/actions/setup
- uses: actions/checkout@v7
- uses: ./cutile-rs/.github/actions/setup

- name: Mark checkout as safe
run: git config --global --add safe.directory /__w/cuda-rust/cuda-rust

# Cheapest checks first so a formatting or lint slip fails in seconds.
- name: Format check
Expand Down Expand Up @@ -184,6 +187,71 @@ jobs:
- name: CPU only tests
run: ./scripts/run_cpu_tests.sh

# nextest archives carry test executables, Cargo metadata, and build
# outputs needed to run on another machine without rebuilding Rust.
# Keep both workspaces separate, then bundle them in one downloadable tar.
- uses: taiki-e/install-action@9114bf4d891761788c546334fd37538eae1bf8b3 # v2.87.16
name: Install cargo-nextest
with:
tool: cargo-nextest

- name: Archive Tile runtime test packages
run: |
mkdir -p "$RUNNER_TEMP/cutile-gpu-tests"
cargo nextest archive --locked --features experimental-tune \
--archive-file "$RUNNER_TEMP/cutile-gpu-tests/tile-tests.tar.zst"

- name: Archive shared-host runtime test packages
working-directory: ${{ github.workspace }}
run: |
cargo nextest archive --locked \
-p cuda-bindings -p cuda-core -p cuda-async \
--archive-file "$RUNNER_TEMP/cutile-gpu-tests/host-tests.tar.zst"

- name: Bundle runtime test archives
run: |
cp "$(command -v cargo-nextest)" "$RUNNER_TEMP/cutile-gpu-tests/cargo-nextest"
git rev-parse HEAD > "$RUNNER_TEMP/cutile-gpu-tests/revision.txt"
cargo nextest --version > "$RUNNER_TEMP/cutile-gpu-tests/nextest-version.txt"
tar -cf "$RUNNER_TEMP/cutile-gpu-tests.tar" \
-C "$RUNNER_TEMP/cutile-gpu-tests" .

- name: Upload runtime test packages
uses: actions/upload-artifact@v4
with:
name: cutile-gpu-tests
Comment thread
assignUser marked this conversation as resolved.
Resolved
path: ${{ runner.temp }}/cutile-gpu-tests.tar
if-no-files-found: error
compression-level: 0 # The nested nextest archives are already compressed.
retention-days: 1

gpu-tests:
needs: build
runs-on: linux-amd64-gpu-rtxpro6000-latest-1
timeout-minutes: 30
container:
image: nvidia/cuda:13.3.0-devel-ubuntu24.04
Comment thread
assignUser marked this conversation as resolved.
Resolved
env:
CUDA_TOOLKIT_PATH: /usr/local/cuda
CUTILE_TILEIRAS_PATH: /usr/local/cuda/bin/tileiras
steps:
- uses: actions/checkout@v7

- uses: actions/download-artifact@v4
with:
name: cutile-gpu-tests
path: ${{ runner.temp }}/gpu-tests

- name: Extract runtime test packages
run: |
tar -xf "$RUNNER_TEMP/gpu-tests/cutile-gpu-tests.tar" -C "$RUNNER_TEMP/gpu-tests"
test "$(cat "$RUNNER_TEMP/gpu-tests/revision.txt")" = "$GITHUB_SHA"
nvidia-smi
"$CUTILE_TILEIRAS_PATH" --version

- name: GPU runtime tests
run: ./scripts/run_gpu_tests.sh --archive-dir "$RUNNER_TEMP/gpu-tests"

# Breaking API changes must ship with the right version bump: compare each
# publishable crate's API against its latest crates.io release and fail the
# PR when a break arrives without one (the 0.3.0 -> 0.3.1 lesson). Same
Expand Down
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ cutile-rs/scripts/run_all.sh # both of the above, then the examples and

Run `cutile-rs/scripts/run_all.sh` before marking a Tile pull request ready
for review.

The GPU script also accepts `--archive-dir DIR` to run prebuilt tests without
Cargo or a Rust toolchain. The directory must contain `cargo-nextest`,
`tile-tests.tar.zst`, and `host-tests.tar.zst`, as bundled by CI. This mode runs
tests serially and uses the checkout for source fixtures.
See the archive, bundle, and extract steps in
[the Tile CI workflow](.github/workflows/cutile-rs.yml) for how to produce this
directory. Extract `cutile-gpu-tests.tar` first and use a checkout matching its
`revision.txt`; `cargo-nextest` must be executable. The script's opening comments
describe the directory layout and the contents of each test archive.

CI runs the same suites in `.github/workflows/cutile-rs.yml`. Because the Tile
lanes use NVIDIA self-hosted runners, that workflow triggers on the
`pull-request/<n>` branches that copy-pr-bot mirrors rather than on the pull
Expand Down
7 changes: 4 additions & 3 deletions cutile-rs/.github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ runs:
using: composite
steps:
- name: Validate inputs
working-directory: ${{ github.workspace }}
shell: bash
working-directory: cutile-rs
env:
RUST_COMPONENTS: ${{ inputs.components }}
RUST_CACHE: ${{ inputs.cache }}
Expand All @@ -35,8 +35,8 @@ runs:
fi

- name: Install build dependencies
working-directory: ${{ github.workspace }}
shell: bash
working-directory: cutile-rs
run: |
apt-get update -qq
apt-get install -y -qq --no-install-recommends build-essential curl \
Expand All @@ -47,7 +47,8 @@ runs:
# nightly lives in cuda-oxide/rust-toolchain.toml.
- name: Install Rust
shell: bash
working-directory: cutile-rs
# relative path to land at the rust-toolchain.toml regardless of use of $ or ./ syntax
working-directory: ${{ github.action_path }}/../../..
env:
RUST_COMPONENTS: ${{ inputs.components }}
run: |
Expand Down
Loading
Loading