Skip to content

Add muladd_scaled and FP8 muladd#239

Merged
AntonOresten merged 6 commits into
JuliaGPU:mainfrom
AntonOresten:mma-scaled
Jun 3, 2026
Merged

Add muladd_scaled and FP8 muladd#239
AntonOresten merged 6 commits into
JuliaGPU:mainfrom
AntonOresten:mma-scaled

Conversation

@AntonOresten

@AntonOresten AntonOresten commented May 29, 2026

Copy link
Copy Markdown
Collaborator

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

Closes #108

@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

@maleadt maleadt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits.

Comment thread src/language/operations.jl Outdated
Comment thread src/language/operations.jl Outdated
AntonOresten and others added 6 commits June 3, 2026 21:00
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 merged commit e03a373 into JuliaGPU:main Jun 3, 2026
1 check passed
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

2 participants