Skip to content

warp-lang: Add version 1.16.0 - #2138

Draft
luhenry wants to merge 1 commit into
mainfrom
warp-lang
Draft

luhenry wants to merge 1 commit into
mainfrom
warp-lang

Conversation

@luhenry

@luhenry luhenry commented Sep 20, 2026

Copy link
Copy Markdown
Member

Compiles Warp's native runtime (warp.so) and the Clang/LLVM library that JIT-compiles kernels to native code at run time (warp-clang.so), plus the Clang/LLVM 21.1.0 it links. Upstream publishes no riscv64 wheel.

Mirrors upstream's build-llvm-sdk.yml and the create wheels job of .gitlab-ci.yml.

Differs from upstream

  • --no-cuda - no CUDA toolkit, libmathdx or driver for riscv64; upstream's own macOS configuration.
  • --build-llvm instead of a prebuilt SDK bundle - upstream publishes none for riscv64.
  • dnf install libstdc++-static - warp links -static-libstdc++, and the riscv64 image ships no libstdc++.a.
  • examples/assets and tests/assets are fetched from media.githubusercontent.com - setup.py packages both, both are git-lfs, and nothing guarantees a git-lfs client on the self-hosted runner.
  • Test suite runs in its own job - the Clang/LLVM compile already fills most of one job's budget.

Matrix: single build - the wheel is py3-none-<platform>, so one build serves every interpreter (imports smoke-tested on cp312/cp313/cp314/cp314t).

Testing

  • same as upstream (python -m warp.tests), run against the installed wheel rather than the build tree.

License: Wheel bundles Clang/LLVM (Apache-2.0 WITH LLVM-exception, licence text already shipped by upstream) and statically links the image's libstdc++/libgcc (GPL-3.0 with runtime exception), whose sources the gpl_sources job collects.

Patches

  • 0001-Add-riscv64-to-the-build-and-packaging-platform-tabl.patch - To upstream. machine_architecture() raises on riscv64, so the build aborts; setup.py's platform table and LLVM_TARGETS_TO_BUILD need the arch too. riscv64-only.
  • 0002-clang-name-the-rv64gc-lp64d-target-ABI-for-JIT-compi.patch - To upstream. cc1 defaults RV64 to rv64i and soft-float lp64, so JIT-compiled kernels would pass floats in the wrong registers when calling into crt.cpp. riscv64-only.
  • 0003-Convert-fp16-in-software-on-RISC-V-targets-without-Z.patch - To upstream. rv64gc has no half-precision hardware, so Clang lowers builtin.h's _Float16 conversions to the compiler-rt libcalls __extendhfsf2/__truncsfhf2, and wp_load_obj() resolves a JIT module's externals from a curated CRT table that holds no compiler builtins - so every module with an fp16 kernel failed to materialize and took its non-fp16 kernels with it. x86_64 avoids this with +f16c, aarch64 with armv8-a's fcvt; RISC-V has no baseline equivalent (Zfh is optional and not in rv64gc). The software routines are bit-for-bit what _Float16 yields elsewhere, verified exhaustively over all 2^32 floats and all 2^16 halves. riscv64-only.
  • 0004-tests-let-the-environment-raise-the-parallel-run-s-w.patch - To upstream. unittest_parallel caps the whole parallel run at a hard-coded 3600s; Warp compiles every kernel with Clang on the machine running the tests, so four riscv64 cores got through 137 of 180 suites in the hour and the rest were marked crashed. Reads the cap from WARP_TEST_SUITE_TIMEOUT, default unchanged.

luhenry added a commit that referenced this pull request Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-2138/

Built to branch gh-pages at 2026-09-21 10:22 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@luhenry
luhenry force-pushed the warp-lang branch 2 times, most recently from b38fb84 to 5782841 Compare September 20, 2026 21:05
Builds the CPU-only configuration of NVIDIA Warp for riscv64: the core runtime
plus the bundled Clang/LLVM that JIT-compiles kernels to native code at run
time. Upstream publishes no riscv64 wheel, and no prebuilt riscv64 Clang/LLVM
SDK either, so the workflow compiles LLVM from source in the manylinux
container the way upstream's own build-llvm-sdk.yml does for x86_64/aarch64.

CUDA is off (upstream's --no-cuda, the configuration it ships macOS with):
neither the CUDA toolkit nor libmathdx exists for riscv64, and the NVIDIA
driver does not either, so a GPU build would have no device to run on.

Four patches. 0001 and 0002 make the build work at all - the platform tables,
and the rv64gc/lp64d ABI the Clang frontend does not default to at the cc1
level. 0003 and 0004 come from the first full run of upstream's test suite on
the wheel, which accounted for every one of its 1552 errors:

  - 649 were one bug. RV64GC has no half-precision hardware, so Clang lowers
    builtin.h's _Float16 conversions to __extendhfsf2/__truncsfhf2, and
    wp_load_obj() resolves a JIT-compiled module's externals from a curated CRT
    table holding no compiler builtins - so every module with an fp16 kernel
    failed to materialize and took its non-fp16 kernels with it. x86_64 avoids
    this with +f16c and aarch64 with armv8-a's fcvt; RISC-V has no baseline
    equivalent (Zfh is optional and not in rv64gc), so 0003 converts in
    software, bit-for-bit what _Float16 yields elsewhere.
  - 903 were the test runner's hard-coded 3600s wall-clock limit. Warp compiles
    every kernel with Clang on the machine running the tests, and four riscv64
    cores got through 137 of 180 suites inside the hour; the other 43 were
    marked crashed. 0004 reads the limit from WARP_TEST_SUITE_TIMEOUT.

setup.py packages examples/assets and tests/assets, both git-lfs, so the wheel
shipped pointer stubs and example_nvdb died on "NanoVDB signature not found".
The blobs are fetched over the media CDN rather than by checking out with
lfs: true, which would need a git-lfs client on the runner (gotcha 296).
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.

1 participant