Track cross-process JIT compilation stampede on cold cache misses
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- performance
Research direction
Start by reading the JIT cache implementation and cutile-book/guide/jit-compilation.md; the issue gives no implementation file or test to begin from. The goal is to coordinate compilation across processes for a missing entry where supported, document network-filesystem behavior, and fall back to redundant compilation without blocking indefinitely when coordination is unavailable. Revisit this only if cold-start stampedes become a significant real-world cost.
Written by the indexing model from the issue text.
Description
Migrated from NVlabs/cutile-rs#205, opened by @goog00 on 2026-08-05. 3 comments remain on the original.
Context
Follow-up to #193.
The in-process JIT cache uses OnceCell to compile each kernel only once per process. The persistent disk cache can be shared across processes, but compilation is not deduplicated across process boundaries.
When multiple processes sharing the same cache directory cold-start concurrently — commonly with one process per GPU — they can all miss the same key, spawn tileiras, and compile the same kernel.
This is correct: atomic temporary-file + rename writes ensure that the cache converges on one identical entry. However, the first parallel launch wastes N−1 compiles. Subsequent starts hit the populated cache.
Decision for #193
Merge without a per-key cross-process compilation lock and track the limitation here.
A blocking flock was left out because:
- A slow or hung lock holder could block every waiter.
- Waiters cannot reliably distinguish active compilation from a stuck compiler.
- File-lock semantics and reliability can vary across NFS deployments, where shared caches are likely to live.
- The stampede affects only a cold cache and converges correctly afterward.
Users can avoid the initial stampede by warming the shared cache with one process before launching parallel workers. This workaround is documented in cutile-book/guide/jit-compilation.md.
Follow-up
Revisit cross-process compilation coordination if cold-start stampedes become a significant real-world cost.
Any future solution should:
- Where cross-process coordination is supported, allow only one process to compile a missing cache entry while the others reuse its result.
- Document whether this coordination is supported on network filesystems such as NFS.
- Where coordination is unavailable, fall back to redundant compilation rather than fail a kernel launch or block indefinitely.
- Dominant language
- Rust
- Stars
- 3.8k
- Forks
- 325
- Avg merge
- 6d 8h
- Merged PRs (30d)
- 66
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuda-rust
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NVIDIA/cuda-rust#1568 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: The doc of trait `LoadTileLike` is incorrectMay be free again @akhil9tiet claimed this 7 days ago, and no pull request is open. Openbug
Difficulty 1/5 Under an hour Newbie friendliness 72/100
NVIDIA/cuda-rust#1523 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA/cuda-rust#1303 · 1 comment ·
Maintainers usually reply within 2 days
All issues in NVIDIA/cuda-rust
Similar issues
-
good first issue help wanted r-feature
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
servo/rust-smallvec#792 ·
Maintainers usually reply within 1 day
-
A-Unicode C-bug P-low
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
rust-lang/rustfmt#7210 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
area:sim good first issue kind:feature
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
bitcoindevkit/bdk#2432 ·
Maintainers usually reply within 3 days