Skip to main content

SentryWard: Formal verification of warp-specialized GPU kernels

Reveal hidden bugs in GPU kernels.

License Python Target

Features · Results · Getting started · How it works · Blog

SentryWard is a static verifier for NVIDIA PTX kernels, built for the warp-specialized kernels of Blackwell GPUs. Given a kernel's PTX and a launch configuration, it proves that the kernel synchronizes correctly and is free of data races in every schedule. Given a PyTorch reference as well, it also proves that the kernel computes the same function.

Features

  • Well-synchronization. Barriers and mbarriers, including TMA byte counts, behave the same way in every schedule. This also rules out deadlocks.
  • Race freedom. Every pair of conflicting accesses to global, shared or tensor memory is ordered. Footprints follow exact layouts, including swizzling, and an SMT solver decides overlap for symbolic addresses.
  • Resource lifetimes. Tensor memory and barriers are never used after they are freed or invalidated.
  • Equivalence to a reference. The kernel's outputs equal those of a PyTorch reference, in real arithmetic.
  • Witnesses. Every failed check comes with evidence, such as the two unordered accesses of a race. Anything SentryWard cannot decide is reported as unsupported, never as a pass.
  • Blackwell coverage. TMA, tcgen05 MMA and tensor memory, mbarriers, thread-block clusters and asynchronous copies.

Results

Results for every kernel in our benchmark, with diagnostics and evidence, are in Kernel verification results.

SentryWard has found synchronization bugs in popular kernel libraries, such as a signal sent before the asynchronous write it announces has completed, and a buffer reused while the tensor core is still reading it. We have reported some of them upstream.

Removing redundant synchronization

Because SentryWard checks every schedule, it can also show that a synchronization operation is unnecessary: if the kernel still verifies without it, the operation is redundant. We applied this test greedily, one operation at a time, to 50 verified kernels from our benchmark.

Measure Result
Synchronization operations found redundant 48.7% of those tried
Kernels faster on a B200 after removal 35 of 44 reduced kernels
Median reduction in kernel time 6.8%
Output check Identical outputs to the original over 500,000 random launches

Which synchronization is redundant may depend on the input shape. These results hold for the shapes we verified; other shapes may allow fewer removals.

Getting started

Install

pip install sentryward                # synchronization and memory checks
pip install "sentryward[reference]"   # adds PyTorch for reference equivalence

Wheels include the native verifier. Building from source needs CMake 3.27+, a C++20 compiler, OpenSSL, Boost headers and, optionally, Z3.

Verify a kernel

# Check synchronization and memory
sentryward kernel.ptx --input input.json > output.json

# Also check equivalence to a PyTorch reference
sentryward kernel.ptx \
  --input input.json \
  --reference reference.py \
  --reference-binding reference_binding.json \
  --timeout 500 \
  --memory-limit-mib 81920 > output.json

The same check from Python:

from sentryward import verify

result = verify(
    "kernel.ptx",
    input="input.json",
    reference="reference.py",                    # optional
    reference_binding="reference_binding.json",  # optional
    timeout_seconds=500,
    memory_limit_mib=None,                       # unlimited
)
print(result["result"], result["checks"])
CLI Python Description
--input input Required. The kernel's input configuration (JSON).
--reference reference Optional. A Python file that defines a reference(...) function.
--reference-binding reference_binding Optional. Maps the reference to the kernel's inputs and outputs. Defaults to reference_binding.json next to the reference, then in its parent directory.
--timeout timeout_seconds Total budget for the whole call, including reference capture. Default: 600 seconds.
--memory-limit-mib memory_limit_mib Memory budget as a positive integer in MiB, e.g. 81920 for 80 GiB. Default: unlimited.

The reference takes no separate input file. Its arguments are derived from the kernel's input configuration and the binding; anything that cannot be derived goes in the binding's reference section.

Read the result

The CLI prints a JSON result to stdout, and verify returns the same structure as a dictionary:

  • result is the overall verdict. race_free means the synchronization and memory checks passed and no reference was given; verified means equivalence to the reference was proved as well. Other values name a finding, such as potential_race, or the reason the analysis stopped, such as unsupported or timeout.
  • checks gives the status of each check: synchronization, memory and equivalence.
  • diagnostics and warnings hold the details, including witnesses.
  • equivalence holds the complete equivalence result.

How it works

How SentryWard verifies a kernel: specialization, the event and value views, the well-synchronization check, the race and lifecycle check, memory elimination, and the expression check

For details, see our blog post or the paper (coming soon).

Limitations

  • Problem sizes and the launch configuration are fixed.
  • Branches and loop bounds may depend on the launch configuration, but not on tensor data unless explicit representative-control assumptions are enabled; see A006 and A007, both off by default.
  • Fences and the full PTX memory model are not modeled. The hardware model follows our reading of the PTX documentation, which does not specify every detail.
  • Equivalence treats floating-point values as real numbers, and the check is incomplete: finding no proof does not mean the kernel is wrong.

Repository layout

cpp/                C++ frontend, verifier and equivalence engine
sentryward/         Python CLI and process interface
corpus/             Compiled Blackwell PTX kernels of the benchmark
examples/<kernel>/  Input configuration and recorded output.json for each kernel
references/         PyTorch references and reference bindings
config/             Default and available analysis assumptions
skills/             Agent skills: prepare inputs, write reports, extend the PTX frontend
tools/              Example regression and reference-capture tooling
tests/              C++, Python, frontend and end-to-end tests

License

Apache License 2.0; see LICENSE.

Metadata

Release files for sentryward 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sentryward 0.1.0
File Size Uploaded
sentryward-0.1.0.tar.gz 1.7 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for sentryward 0.1.0
File
sentryward-0.1.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details
sentryward-0.1.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details
sentryward-0.1.0-py3-none-macosx_15_0_x86_64.whl Python 3 none macOS 15.0+ x86-64 Details
sentryward-0.1.0-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details

Total release size: 79.7 MB

Release files / sentryward-0.1.0.tar.gz

Download URL sentryward-0.1.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
16487148efd9d053fd1bb45bef8b206feabe2cc7642aaf53d0dfb8d99d1c7f2c
BLAKE2b-256 checksum
How to use checksums
ea2c77d22f01520d7fd6afc0f29b2740a837ba8c7fecc76660dee2805e3cf332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / sentryward-0.1.0-py3-none-manylinux_2_28_x86_64.whl

Download URL sentryward-0.1.0-py3-none-manylinux_2_28_x86_64.whl
Size 22.8 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
33531290a63d382ae141d94a4ab1bd6575d4605858118d6d99140e215a7ee15b
BLAKE2b-256 checksum
How to use checksums
885ee9691811be051c6562ab741cbc891d1857c6b70ff608548ef6b412b8489c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / sentryward-0.1.0-py3-none-manylinux_2_28_aarch64.whl

Download URL sentryward-0.1.0-py3-none-manylinux_2_28_aarch64.whl
Size 21.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f915720dfef176e88c592f9787d729c7709e433b085a780562f077041f98caeb
BLAKE2b-256 checksum
How to use checksums
588231b9680a3c57aae3ddf8ef79825d09f578806f77870a72d5fc6ac44c242d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / sentryward-0.1.0-py3-none-macosx_15_0_x86_64.whl

Download URL sentryward-0.1.0-py3-none-macosx_15_0_x86_64.whl
Size 17.6 MB
Tags Python 3 macOS 15.0+ x86-64
SHA-256 checksum
How to use checksums
63f360e79c55a30a077b25d2a95d398bec13a2b81f040dde9f91641292be0722
BLAKE2b-256 checksum
How to use checksums
4af0b9d59e21f35df5be78540ab8349d7e722834b76a4666b7b33890e2e3024c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / sentryward-0.1.0-py3-none-macosx_14_0_arm64.whl

Download URL sentryward-0.1.0-py3-none-macosx_14_0_arm64.whl
Size 16.7 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
b7fbf18df24555b1ccf90e58aa260a2e93a4dfc2887d772496228aad1dfdc62a
BLAKE2b-256 checksum
How to use checksums
6728f59a2cdf48473fba8166bab0b0e7ffdef44ecb3550419d968b3c5b1a3e16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.1

4 release files

This release

0.1.0 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page