Add packed f16x2 arithmetic intrinsics#332
Open
honeyspoon wants to merge 1 commit into
Open
Conversation
Mirror the existing bf16x2 module to support packed f16x2 arithmetic across all four compiler layers (cuda-device, dialect-nvvm, mir-importer, mir-lower). Nine new intrinsics: - add_f16x2, sub_f16x2, mul_f16x2, fma_f16x2, neg_f16x2, abs_f16x2 (sm_53+) - min_f16x2, max_f16x2, fma_relu_f16x2 (sm_80+) All operands and results are u32 (packed f16x2). The sm_80+ operations (min, max, fma.relu) are added to the pipeline's sm_80 feature detection. The sm_53+ operations are below the project's Volta floor and do not affect architecture target selection. Includes dialect-nvvm verifier tests and mir-lower lowering tests. Part of tracking issue NVlabs#274 (Phase 6). Signed-off-by: abder <bobmatt911@gmail.com>
This was referenced Jul 3, 2026
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.
Summary
Adds nine packed f16x2 arithmetic intrinsics across all four compiler layers (
cuda-device,dialect-nvvm,mir-importer,mir-lower), mirroring the existing bf16x2 module (#279).f16 is more widely used than bf16 in many inference workloads. This closes the gap where bf16x2 had full arithmetic support but f16x2 did not.
Part of tracking issue #274 (Phase 6).
What changed
cuda-device: Addedf16x2module with 9 user-facing#[inline(never)]stubs.dialect-nvvm: Added 9 operations (AddF16x2Op,SubF16x2Op, ...) with verifier tests.mir-importer: Added dispatch table entries andf16x2intrinsic emitter module.mir-lower: Added lowering conversions (inline asm with=r,r,rconstraints for binary ops,=r,r,r,rfor ternary). sm_80+ ops added to pipeline feature detection.Testing
cargo fmt --checkcleancargo test -p dialect-nvvm --all-targets— verifier tests passcargo test -p mir-lower --all-targets— lowering tests passcargo oxide rune2e on sm_80+ GPUChecklist
crates/cuda-bindings/changes