Repository navigation
feat(intrinsics): admit bf16x2 to FP8x2 pack conversions - #1354
Merged
Merged
Conversation
Admit the four selectionless bf16x2 pack records as inline PTX. They require PTX ISA 9.1 on sm_100f, sm_110f, and sm_120f. Runtime validation stays unexecuted because ptxas and libNVVM are not available here. Signed-off-by: YeonwooSung <neos960518@gmail.com>
The SIMT tree now lives under cuda-oxide/. Directory-rename detection moved the bf16x2-to-FP8x2 evidence, overlay shard, and probes with intrinsics/. The four selectionless pack records remain the only new admission. Regenerating the catalog was a no-op. Signed-off-by: YeonwooSung <neos960518@gmail.com>
Take main's copy of every generated, probe, evidence and lock file that conflicted. The generated outputs are regenerated in a later commit once the bf16x2 evidence is re-recorded under the current LLVM profile. The overlay shard, ledger entries, generator and target-spec changes keep the branch's side. Signed-off-by: nihalpasham <nihalp@nvidia.com>
The PTX vocabulary now contains +ptx91, so a 9.1 floor can reach an LLVM 22 llc. LLVM 22 ignores the feature with a warning and emits PTX 8.8; the build passed and the module failed to load. The gate refuses PTX 9.1 or newer on anything older than LLVM 23. The fixture for a floor newer than cuda-oxide can request moves to 9.2, and the floors test covers the 9.1 rule. Signed-off-by: nihalpasham <nihalp@nvidia.com>
…ofiles The four bf16x2 to packed-FP8 records now meet the packed-conversion family contract instead of being exempted from it. The LLVM evidence is re-recorded with the pinned nightly-2026-10-11 llc and ptxas 13.3.73 at sm_120f with +ptx91: typed declaration canonicalization, typed and inline codegen, and ptxas assembly of both routes, which produce the same cubin. The libNVVM evidence is a real libNVVM 13.3.73 compile at compute_120f, a ptxas assembly and an nvJitLink 13.3 link of the LTOIR; the previous file reused another record's header around an llc run. The target list is the family-complete Blackwell set the catalog uses for its other family records, because cuda-oxide-codegen matches a family target only on the f suffix and the short list refused sm_120a. The admission test gains the fail-closed cases, the f16x2 field gets its serde default back, the generated outputs are regenerated, and the book catalog stamp moves with them. Signed-off-by: nihalpasham <nihalp@nvidia.com>
…ackwell Adds a kernel that calls the four bf16x2 to packed-FP8 conversions and four host cases checked bit for bit, including +inf saturation and NaN. Verified on an RTX 5090 at sm_120a; compile-only in CI as before. Signed-off-by: nihalpasham <nihalp@nvidia.com>
generated_intrinsics_blackwell now calls the four bf16x2 to packed-FP8
conversions, which are PTX 9.1 forms, so its PTX header moved from
.version 8.7 to .version 9.1 and the blackwell-compile lane's header
pin went red while every other assertion still held. Pin the new floor
and prove the new instructions the way the lane proves the f32 packs:
four distinct cvt.rn.satfinite[.relu].{e4m3x2,e5m2x2}.bf16x2
instructions in the llc-route PTX and four "=h,r" inline-asm calls in
the libNVVM-route NVVM IR.
Signed-off-by: nihalpasham <nihalp@nvidia.com>
generated_intrinsics_blackwell now needs +ptx91 for the bf16x2 to packed-FP8 conversions. llc-22 knows +ptx90 at most, and the codegen gate refuses a PTX 9.1 request below LLVM 23 at compile time, so the compile-only lane cannot build that example under its LLVM 22 pin. Install LLVM 23 from apt.llvm.org instead (the llvm-toolchain-*-23 suites serve 23.1.4 for noble and resolute) and point both CUDA_OXIDE_LLC sites at llc-23, following the previous floor bump from 21 to 22. The floor comment names the new reason and keeps the old one. Signed-off-by: nihalpasham <nihalp@nvidia.com>
The inline-route ptx_assembly detail of the two e5m2x2 records repeated the e4m3x2 records' negative control. Retargeting each form's inline PTX to sm_120 with ptxas 13.3.73 rejects the e5m2x2 forms with "Feature 'cvt.e5m2x2.bf16x2' not supported on .target 'sm_120'", and the two details now quote that message. The catalog carries the detail text, so the generated outputs and the book's catalog stamp move with it; no route, target or signature changes. Signed-off-by: nihalpasham <nihalp@nvidia.com>
nihalpasham
requested review from
binarybana,
cryos,
elibol,
kkraus14,
roivanov and
rparolin
as code owners
October 19, 2026 13:45
Collaborator
|
/ok to test 89e24e2 |
Collaborator
|
Thanks, the four records are right and the generated code is correct: on the 5090 all four forms are bit for bit equal to CUDA's own
At |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Four Blackwell-family pack conversions from packed
bf16x2to packed FP8, admitted to the intrinsic catalog as inline-PTX records:cvt_rn_satfinite_e4m3x2_bf16x2,cvt_rn_satfinite_relu_e4m3x2_bf16x2,cvt_rn_satfinite_e5m2x2_bf16x2andcvt_rn_satfinite_relu_e5m2x2_bf16x2. The generator emits thecuda_device::convertstubs,dialect-nvvmops, importer arms,mir-lowerlowerings, ABI ledger entriesi1030toi1033and the reference rows, the same way as thef16x2siblings.cuda-target-specgains the+ptx91feature these instructions need.Build with
cargo oxide run <example> --arch sm_120a(orsm_120f). CUDA 13.4's owncuda_fp8.hppemits the same instruction for__nv_cvt_bfloat16raw2_to_fp8x2under family-specific compilation.What we fixed
rust-llvm-23.1.3-aab11ee0profile with the typed-NVVM stages and the ptxas assembly the packed-conversion family requires, and removed the bf16x2 exemption from the evidence validator. The pinned llc selectsllvm.nvvm.bf16x2.to.*at sm_100f and sm_120a with+ptx91.sm_100f|sm_110f|sm_120fto the family list the catalog uses for Blackwell records. The compiler matches family targets on the literalfsuffix, so the short list refused--arch sm_120aand sent an arch-lesscargo oxide runon an RTX 5090 to sm_100f, which failed at module load.+ptx90only; withCUDA_OXIDE_LLC=llc-22the build was silent, the PTX said.version 8.8, and the JIT failed at load. The examples-compile lane's LLVM floor moves from 22 to 23 for the same reason.generated_intrinsics_blackwellwith the four bf16x2 forms.Target contract
cargo oxide runwith no--archselects the detected device (sm_120aon a 5090);cargo oxide buildwith no--archcompiles for the first catalog alternative, as for every family-gated record, so pass--archfor a specific device.Implementation
intrinsics/overlay/packed_conversion_fp8_bf16x2.toml(schema 65) is a compact shard:fp8_formats = ["e4m3x2", "e5m2x2"],relu_variants = true,product_count = 4,runtime_validation = "unexecuted"; listed inoverlay.toml.PackedConversionFp8Bf16x2Admissionfails closed on any axis deviation and builds records through the sharedpacked_conversion_overlay_record; four closed recipes carry the ids, ABI ids, operation keys, thev2bf16 -> i16typed signature and the mnemonics.PackedConversionSourceFormat::Bf16x2extends every render and resolve match besideF16x2: 32-bitu32source,u16result,=h,rconstraint, identity half order; the generatedmir-lowerimpl is aconvert_generated_packed_unarycall like its siblings.packed_conversion_floorreturns the 9.1 floor with no minimum SM and the family target list through a named const with the derivation in its comment.cuda-target-specadds 91 to the PTX feature vocabulary; the gate incuda-oxide-codegenis a table of PTX floor to LLVM major (9.0 needs 22, 9.1 needs 23).rust-llvm-23.1.3-aab11ee0-packed-conversion-fp8-bf16x2.jsonandcuda-13.3-libnvvm-13.3.73-packed-conversion-fp8-bf16x2.json, recorded from real tool runs.Verification
Checked at
89e24e263(nightly-2026-10-11, RTX 5090):cuda-intrinsics-gen checkcurrent,probe --all --skip-terminal --per-targetgreen,check-abi-historywith the 1029 base entries preserved and 1033 total; a secondgenerateis a no-op; the book catalog stamp guard passes.cargo test -p cuda-intrinsics-gen --all-targets,cargo test -p cuda-oxide-codegen(the gate test fails without the 9.1 rule), the touched crates' clippy with warnings as errors, rustdoc, fmt, the 18 guards and the lock check.cargo oxide run generated_intrinsics_blackwell --arch sm_120a: all 16 bf16x2 checks match (0x4038/0x403c,0x7eb8/0x7e00, +Inf and NaN cases), memcheck 0 errors; the PTX is.version 9.1with onecvt.rn.satfinite[.relu].{e4m3x2,e5m2x2}.bf16x2per form.cargo oxide runon the 5090 selects sm_120a and passes;CUDA_OXIDE_LLC=llc-22is refused at compile time with the LLVM 23 message.cuda_fp8.hhost conversion, through the llc and libNVVM routes; ptxas 13.4 accepts the instruction on the ten family targets and rejects unsuffixed sm_100 and sm_120.Caveats
runtime_validationstaysunexecutedin the catalog: compact admissions have no runtime stage to record (intrinsics-gen: runtime_validation = "executed" is unreachable for compact admissions (30 guards, no Runtime-stage producer) #1298), so the GPU results live in this description and in the Blackwell example.cvt.rn.bf16x2.e4m3x2is PTX 9.2).probe --candidatecannot record evidence for this family (a pre-existing panic in the packed renderer); the evidence was recorded with the same process as the f16x2 refresh.