Skip to content

feat: add staged libdevice math generation - #1646

Open
uurl wants to merge 1 commit into
NVIDIA:mainfrom
uurl:feat/libdevice-math-generator
Open

uurl wants to merge 1 commit into
NVIDIA:mainfrom
uurl:feat/libdevice-math-generator

Conversation

@uurl

@uurl uurl commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Introduce a dedicated libdevice_math shard and deterministic renderer as infrastructure for the libm coverage work in #1224.

The initial shard reproduces the existing 72 f32/f64 libm mappings. Compiler dispatch, handwritten mapping tables, and linking behavior remain unchanged; their migration follows in a separate PR.

Refs #1224 .

Changes

  • Describe existing aliases, signatures, placeholders, libdevice symbols, native LLVM alternatives, and handwritten routes in intrinsics/overlay/libdevice_math.toml.
  • Generate Rust mapping metadata and a Markdown reference through the existing generate and check commands.
  • Keep libdevice metadata separate from the hardware catalog and ABI ledger.
  • Add extract-libdevice and verify-libdevice commands to validate exported definitions and signatures against real bitcode.
  • Capture 64 referenced libdevice signatures with provenance and SHA-256 pins, allowing ordinary generation without CUDA installed.
  • Add regression, negative, and control tests covering mapping equivalence, deterministic output, malformed rows, ABI mismatches, and overlay reconciliation.

This PR targets main independently of #1638 and #1645. The compiler-table migration follows after those PRs and this infrastructure land.

Testing

Run from cuda-oxide/:

  • just check: formatting, Clippy, tests, guards, generated outputs, ABI history, documentation, and doctests passed.
  • cargo test -p cuda-intrinsics-gen --locked --all-targets: 333 tests passed.
  • cargo clippy -p cuda-intrinsics-gen --locked --all-targets -- -D warnings.
  • cargo run -p cuda-intrinsics-gen --locked -- check.
  • verify-libdevice against locally installed CUDA bitcode: all 64 signatures verified.
  • Intrinsic probes: 2,427 target configurations across 1,042 routes passed with --skip-terminal.

A new GPU example is not applicable to this generator-only change.

Checklist

  • All commits signed off (git commit -s).
  • SPDX headers on new source files.

Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@uurl
uurl marked this pull request as ready for review October 26, 2026 06:53
@uurl
uurl requested a review from nihalpasham as a code owner October 26, 2026 06:53

This branch has not been deployed

No deployments
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