Skip to content

spec: Draft FMA extension field accelerator#809

Open
RobinJadoul wants to merge 8 commits into
spec/streamingfrom
spec/fext
Open

spec: Draft FMA extension field accelerator#809
RobinJadoul wants to merge 8 commits into
spec/streamingfrom
spec/fext

Conversation

@RobinJadoul

Copy link
Copy Markdown
Collaborator

No description provided.

@RobinJadoul RobinJadoul self-assigned this Jul 14, 2026
@RobinJadoul RobinJadoul added the spec Updates and improvements to the spec document label Jul 14, 2026
@github-actions

Copy link
Copy Markdown

Kimi Code Review

⚠️ Review failed: Kimi API request failed with status 401


Automated review by Kimi (Moonshot AI)

@github-actions

Copy link
Copy Markdown

Codex Code Review

  • High – FMA drops two coefficients of c (fext_fma.toml): output[1] and output[2] omit c[1] and c[2]. Thus the chip computes a*b + (c₀,0,0), not a*b+c. Add the missing terms to both constraints and polynomials.

@erik-3milabs erik-3milabs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Am I correct in understanding that this PR is not yet complete? Right now, there does not seem to be a way to get the information out of the "Extension Field Realm" back to RAM/MEMORY land and interact with it. (I seem to recall we considered having assertions in the Fext-Realm, instead of the load-back, but I don't see any signs this PR introduces that solution yet)

Comment thread spec/fext.typ Outdated
Comment thread spec/fext.typ Outdated
Comment thread spec/src/fext_fma.toml
Comment thread spec/src/fext_load.toml
Comment thread spec/about_ecalls.typ Outdated
Comment thread spec/src/fext_fma.toml Outdated
Comment thread spec/src/fext_fma.toml Outdated
Comment thread spec/src/fext_fma.toml Outdated
Comment thread spec/src/fext_fma.toml Outdated
Comment thread spec/fext.typ
@RobinJadoul

Copy link
Copy Markdown
Collaborator Author

Indeed, the intention was to have an FEXT_ZERO or similar chip. I'm now unsure if I had a reason to delay that, or if I was just forgetful.

RobinJadoul and others added 8 commits July 20, 2026 16:58
Co-authored-by: Erik <159244975+erik-3milabs@users.noreply.github.com>
Co-authored-by: Erik <159244975+erik-3milabs@users.noreply.github.com>
Comment thread spec/fext.typ
Comment thread spec/fext.typ
#let nr_interactions = compute_nr_interactions(fmachip)

To compute a fused multiply-add (FMA) operation `output = a * b + c`, we first load
everything from memory, passing the input (ABB) addresses in A0-A2 and the output address in A3.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you tell me what ABB is? I'm not familiar with the term, and cannot gather its meaning from context.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Perhaps also worth clarifying in the text for this same reason.

Comment thread spec/src/fext_fma.toml
Comment thread spec/fext.typ
Comment on lines +81 to +82
This chip asserts that a field extension element in the ABB is zero.
It uses #nr_variables variables spanning #nr_columns columns and #nr_interactions interactions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You forgot to recompute #nr_variables, #nr_columns, and #nr_interactions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, please highlight that the addr is read from A0.

Comment thread spec/src/fext_zero.toml
Comment on lines +32 to +38
[[constraints.all]]
kind = "interaction"
tag = "MEMW"
input = [["+", 3, "d"], "addr", ["cast", 0, ["BaseField", 8]], "timestamp", 0, 0, 0]
output = ["cast", 0, ["BaseField", 8]]
multiplicity = "μ"
iter = ["d", 0, 2]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is a very elegant solution; nicely done! Perhaps we should dedicate one or two sentences on clarifying to the reader why it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec Updates and improvements to the spec document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants