Skip to content

Conversation

@jonathanpwang
Copy link
Contributor

CUDA workflows use rust cache but stark-backend's rust cache contains cuda architecture specific machine code.
We make a composite github action that wraps Swatinem/rust-cache and adds the cuda arch as a cache key.

Copilot AI review requested due to automatic review settings November 30, 2025 17:34
Copilot finished reviewing on behalf of jonathanpwang November 30, 2025 17:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical caching issue in CUDA workflows where Rust caches containing architecture-specific CUDA machine code were being incorrectly shared across systems with different GPU compute capabilities. The solution introduces a composite GitHub Action that wraps Swatinem/rust-cache@v2 and automatically appends the GPU architecture to the cache key, ensuring proper cache isolation.

Key changes:

  • Created a new composite action .github/actions/rust-cache-cuda that detects GPU compute capability and includes it in the cache key
  • Updated all CUDA-enabled workflows to use the new composite action instead of directly using Swatinem/rust-cache@v2
  • Ensured the action handles both GPU and non-GPU environments by setting appropriate cache key suffixes

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/actions/rust-cache-cuda/action.yml New composite action that wraps rust-cache with GPU architecture detection to create CUDA-specific cache keys
.github/workflows/lints.yml Updated CUDA lint job to use the new rust-cache-cuda composite action
.github/workflows/guest-lib-tests.cuda.yml Updated guest library CUDA tests to use architecture-specific caching
.github/workflows/extension-tests.cuda.yml Updated extension CUDA tests to use architecture-specific caching
.github/workflows/benchmark-call.yml Updated benchmark workflow to use rust-cache-cuda (handles both GPU and non-GPU runs)
.github/workflows/base-tests.cuda.yml Updated base CUDA tests to use architecture-specific caching

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair 232 322,610 2,058,654 - - -
fibonacci (+27 [+2.8%]) 994 1,500,209 2,100,402 - - -
regex (+26 [+1.1%]) 2,375 4,137,502 17,695,216 - - -
ecrecover (+41 [+5.7%]) 766 122,859 2,263,998 - - -
pairing (+32 [+2.3%]) 1,450 1,745,742 25,468,210 - - -

Commit: 70b99ef

Benchmark Workflow

jonathanpwang added a commit to openvm-org/stark-backend that referenced this pull request Nov 30, 2025
CUDA workflows use rust cache but stark-backend's rust cache contains
cuda architecture specific machine code.
We make a composite github action that wraps Swatinem/rust-cache and
adds the cuda arch as a cache key.

compare openvm-org/openvm#2287
@jonathanpwang jonathanpwang merged commit c380567 into main Nov 30, 2025
40 of 45 checks passed
@jonathanpwang jonathanpwang deleted the ci/rust-cache-cuda branch November 30, 2025 18:11
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.

2 participants