Skip to main content

gpark (Python)

The Python half of gpark. An independent implementation of the same kernel IR and PTX emitter as the Elixir half — not a binding to it.

The one rule

For the same kernel spec in corpus/specs/, both implementations must emit the same bytes of PTX. That is enforced by tests/test_corpus.py, which reads the goldens the Elixir side produced. The two opcode tables are also cross-checked against each other on every test run.

If the formatting were merely similar, every diff against real nvcc output would be noise, and the shared corpus would prove nothing.

Usage

from gpark import addr, block, check, emit, imm, instr, kernel, param, param_decl, reg

k = kernel("scale_f32", params=[param_decl("x", "u64"), param_decl("n", "u32")], blocks=[
    block("entry", [
        instr("mov", dtype="u32", dest=reg("u32", 1), ops=[imm(0)]),
        instr("ret", ),
    ]),
])

ok, issues = check(k)
if ok:
    print(emit(k))
else:
    for i in issues:
        print(f"{i.kind}: {i.message}")

Tests

make -C .. test      # both Elixir and Python suites
make test            # just this one

The opcode cross-check shells out to mix; if Elixir is not installed that one test skips rather than failing, and the golden check still runs.

Status

The backend compiles, validates and emits PTX. Nothing has been run on a GPU yet — see ../docs/ROADMAP.md.

Metadata

Release files for gpark 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 gpark 0.1.0
File Size Uploaded Provenance Actions
gpark-0.1.0.tar.gz 21.7 kB Without provenance Details for gpark-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gpark 0.1.0
File Interpreter ABI Platform Actions
gpark-0.1.0-py3-none-any.whl Python 3 none any Details for gpark-0.1.0-py3-none-any.whl

Total release size: 43.3 kB

Release files / gpark-0.1.0.tar.gz

Download URL gpark-0.1.0.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
97dfc568c7fd6d0e9c1687af2ac937d73216b6f7fcc0eb732144cdccdce697dc
BLAKE2b-256 checksum
How to use checksums
cb9fb9ecf662f24f06f8c097410081a6d16132d858c8ff6f972ede80199b8201
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / gpark-0.1.0-py3-none-any.whl

Download URL gpark-0.1.0-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80f70c587a7da844fc4b6dabc232b44852ba71642a47387641c5ae8e7a1de703
BLAKE2b-256 checksum
How to use checksums
fcb04eab1c4a0e6f51382c033a3d56f6ca04a7db5badf2b8cab2d7d923042861
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for gpark 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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