Skip to content

Add muladd_scaled and FP8 muladd#239

Open
AntonOresten wants to merge 5 commits into
JuliaGPU:mainfrom
AntonOresten:mma-scaled
Open

Add muladd_scaled and FP8 muladd#239
AntonOresten wants to merge 5 commits into
JuliaGPU:mainfrom
AntonOresten:mma-scaled

Conversation

@AntonOresten
Copy link
Copy Markdown
Collaborator

@AntonOresten AntonOresten commented May 29, 2026

Depends on #238

Changes

  • Add public muladd_scaled(a, a_scale, b, b_scale, acc) function
  • Reorganize MicrofloatsExt tests into codegen.jl and device.jl
  • Allow FP8 operand eltype in muladd
  • Add fast_acc=true keyword argument to muladd
  • Add FP8 muladd tests
  • Add i8/u8 muladd tests

Checklist

  • Update README
  • Test on CC 12.1 (Consumer Blackwell)
  • Test on CC 10.3 (Blackwell Ultra)
  • Test on CC 9.0 (Hopper)

Closes #108 🎉

AntonOresten and others added 4 commits May 29, 2026 15:10
The shape helpers and pack/unpack tfuncs ran inside the kernel-inferred
path, where two failure modes produced confusing errors:

- A tfunc returning `nothing` on an indivisible width left the result
  untypable, surfacing downstream as `internal error: invalid terminators`.
- A `throw(ArgumentError(...))` in a shape helper became an unsupported
  `String` in kernel IR (`format_string`/`unsupported String` error),
  masking the intended message.

Make both layers total: pack/unpack tfuncs always return a concrete type
(via `fld`), and the shape helpers are pure arithmetic. Validation now
lives solely in the pack/unpack/reshape emit, which throws a clear
`IRError` (e.g. "unpack: 1 bytes do not evenly divide into Float32").
Valid reinterprets are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AntonOresten AntonOresten changed the title Add muladd_scaled Add muladd_scaled and FP8 muladd May 29, 2026
@AntonOresten
Copy link
Copy Markdown
Collaborator Author

image

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.

Narrow precision block-scaling

1 participant