Skip to content

[LLVM] Fix true16 lowering for packed FP8 conversions - #1110

Open
big-yellow-duck wants to merge 3 commits into
ROCm:mainfrom
big-yellow-duck:fix/llvm-amdgpu-cvt-pk-f32-f8-true16
Open

big-yellow-duck wants to merge 3 commits into
ROCm:mainfrom
big-yellow-duck:fix/llvm-amdgpu-cvt-pk-f32-f8-true16

Conversation

@big-yellow-duck

Copy link
Copy Markdown
Contributor

Summary

  • patch the pinned LLVM AMDGPU MC lowering to select real true16 opcodes for packed FP8/BF8 conversions
  • select the low 16-bit VGPR half required by the true16 encoding while preserving SGPR and immediate operands
  • add gfx1170, gfx12, and gfx1250 code-generation checks
  • apply the LLVM patches idempotently and include every patch input in local and CI cache keys

Motivation

llvm.amdgcn.cvt.pk.f32.{fp8,bf8} is selected through a fake16 pseudo because the intrinsic carries two selectable 16-bit words. On targets using real true16 instructions, the MC lowering must explicitly select the true16 opcode and spell a VGPR source as its low half. Without this, packed conversion lowering can produce an invalid or incorrectly encoded instruction.

This PR is independent of the FlyDSL scalar cvt_f32_fp8 API addition and is based directly on main for focused review.

Validation

  • both FlyDSL LLVM patches pass git apply --check against the pinned LLVM revision e2a39f504fee836e4def9581bed817ecc327b9dc
  • llvm-lit -v llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cvt.fp8.ll passes
  • git clang-format --diff reports no LLVM source formatting changes
  • shell syntax, workflow YAML parsing, cache-key generation, and FlyDSL style checks pass

Patch the pinned LLVM AMDGPU backend to select the real true16 packed FP8/BF8
conversion opcode and the low VGPR half on true16 targets. Apply the patch in
local and CI LLVM builds and include all LLVM patch inputs in cache keys.

Co-authored-by: vllmellm <190700713+vllmellm@users.noreply.github.com>
Co-authored-by: Tan Pin Siang <1716735+tanpinsiang@users.noreply.github.com>
Signed-off-by: big_yellow_duck <83417790+big-yellow-duck@users.noreply.github.com>

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