PYPI PACKAGE AUDIT v0.10.4 Healthy Package

syncsan

Finds data races in GPU megakernels and shows what each one does to your output.

PyPkgScore syncsan
Methodology & Criteria ♥ Donate
720 / 1000
Quick Install
pip install syncsan
1. Governance
100/200
2. PEP Metadata
200/200
3. Security
150/200
4. Docs & SEO
105/200
5. CI Engineering
165/200
📣 Share Audit: Share this report and visual preview in the current language
Advertisement
PYPI TELEMETRY

Downloads & Community Adoption

Last 30 days (without mirrors)
Last 7 days
217
Last 30 days
217
Total (180 days)
217
Metric / Ecosystem Status / Value Source
Downloads (30d / 180d) — PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) ✕ Not detected PyPI Integrity / Sigstore
Django Packages — djangopackages.org
PyTech / PyPkgScore 720 / 1000 PyPkgScore Engine

Health & Engineering Analysis (5 Pillars)

1. Governance & Community100 / 200 ▾
LICENSE✓ 50 pts
SECURITY.md✕ 0 pts
CONTRIBUTING.md✓ 50 pts
CODE_OF_CONDUCT.md✕ 0 pts
2. PEP Metadata & Packaging200 / 200 ▾
Wheel (.whl)✓ 50 pts
pyproject.toml✓ 50 pts
Project URLs✓ 50 pts
Trove Classifiers✓ 50 pts
3. Security & Supply Chain150 / 200 ▾
Zero CVEs (OSV)✓ 60 pts
Trusted Publishing (OIDC)✕ 0 pts
Snyk / Audit Link✓ 40 pts
HTTPS Repository✓ 50 pts
4. Documentation, SEO & Ecosystem105 / 200 ▾
Structured README✓ 60 pts
Read the Docs✕ 0 pts
Django Packages✕ 0 pts
Website / Technical Articles✓ 45 pts
5. Engineering, CI & Quality165 / 200 ▾
Automated Tests✓ 65 pts
GitHub Actions CI✓ 65 pts
CHANGELOG.md✓ 35 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)✕ 0 pts
Advertisement
README & DOCS

Official Documentation & Usage Guide — syncsan

PyPI Metadata v0.10.4
Show full original documentation (English README) ▾

syncsan

syncsan finds data races in GPU megakernels. It runs your CUDA program unchanged under NVBit and reports every pair of memory accesses that no barrier, fence, release/acquire or async-copy wait puts in order. With SYNCSAN_ADVERSARIAL=1 it also hands each racy load the stale value the PTX memory model allows, so you can see what the race does to your output.

Megakernels need this more than most code. They run a whole model in one launch and pass activations between SMs through counters in global memory. A missing fence in one of those handoffs rarely fails on today's GPUs, so it survives testing.

Quick start

You need Linux, an NVIDIA GPU from the A100 onward, and CUDA 12.

pip install syncsan
syncsan build --arch 90          # once; use 100 for B200, 120 for RTX 50xx, 80 for A100
syncsan run -- python generate.py

To see it work before pointing it at your own code, try examples/handoff.cu. It is the most common megakernel bug in 30 lines: one block writes data, fences and bumps a counter, and another block spins on the counter and reads the data with no fence after the spin.

$ nvcc -arch=sm_90 -lineinfo -o handoff examples/handoff.cu
$ ./handoff
sum = 32896 (expected 32896): correct
$ syncsan run -- ./handoff
syncsan: RACE (write then read) at 0x7ef8ffe00300
  block 1 warp 2: STG.E desc[UR6][R2.64], R5 ;  [handoff(unsigned int*, int*, int*)+0x1e0 handoff.cu:15]
  block 0 warp 2: LDG.E R2, desc[UR6][R2.64] ;  [handoff(unsigned int*, int*, int*)+0x120 handoff.cu:26]
sum = 32896 (expected 32896): correct
$ SYNCSAN_ADVERSARIAL=1 syncsan run -- ./handoff
sum = 0 (expected 32896): WRONG

The kernel gives the right sum on the GPU, syncsan points at the write on line 15 and the read on line 26, and adversarial mode shows the wrong sum the memory model allows. Rebuild with -DFIXED, which adds the fence after the spin, and syncsan reports nothing. Build your own kernels with -lineinfo so the reports name source lines.

--kernel NAME checks only the kernels whose name contains NAME, --exitcode 1 makes a race fail your CI (example workflow), and --sample k checks one in k plain accesses when the full check is too slow. syncsan run --help lists the rest.

What it has found

The clearest case is SuperLU_DIST. A commit that fixed a dropped fence in its GPU triangular solve restored the consumer's acquire but left out the producer's release. syncsan flagged the producer's decrement, and in adversarial mode the solve came back with an error of 0.7. On the fixed commit the error is 6e-15. The maintainers confirmed it and fixed it the same day (xiaoyeli/superlu_dist#261).

In Hazy Research's Llama-1B megakernel, activations move between SMs through a TMA store, a relaxed atomicAdd on a counter and a volatile spin, with no gpu-scope fence. syncsan reports 25 racing pairs, and in adversarial mode the model stops making sense (H100, 8 tokens):

Build Mode Output
original native "Why did the cookie go to the"
original adversarial "iteriteriter abstractجرineronde"
original control "Why did the cookie go to the"
release/acquire counters adversarial "Why did the cookie go to the"

The control run redirects the same loads but hands them their current values, so the redirection itself is not what breaks the output. This race also fails on real hardware. When silu_out is filled with NaN before each step, the original megakernel reads the NaN in all 1,000 generations and the fixed one in none. Making the counters release/acquire fixes it at a 9% latency cost (HazyResearch/Megakernels#16).

The other finds:

Each one has a write-up in docs/findings and a script in reproduce that reruns it on a rented GPU. The summary of every run is in results.

What it checks

syncsan follows the PTX memory model for global memory between thread blocks and for shared memory between warps, including mbarriers and the Hopper and Blackwell copy engine (TMA, cp.async.bulk, cp.async). It does not check races between lanes of one warp, distributed shared memory, or ordering across kernels and streams. It is slow: a 4-token decode of the Hazy megakernel takes 54 s under syncsan and 14 s without it. docs/how-it-works.md describes the model and its limits, and docs/prior-work.md compares syncsan with Barracuda, iGUARD, SuperCollider and compute-sanitizer.

Tests

tests/run_tests.sh sm_90 runs 51 cases with known answers on a local GPU. tests/cuhadron adds six cross-block synchronization tests to NVIDIA's cuHadron race benchmark.

License

Apache 2.0. To cite syncsan, see CITATION.cff.