Skip to content

feat: add explicit inputs/outputs protocol#12

Open
teelaitila wants to merge 1 commit intogpu-mode:masterfrom
teelaitila:codex/multi-output
Open

feat: add explicit inputs/outputs protocol#12
teelaitila wants to merge 1 commit intogpu-mode:masterfrom
teelaitila:codex/multi-output

Conversation

@teelaitila
Copy link
Contributor

Note: This is my take on solving this. Totally happy to adjust direction or make changes if you think there’s a better way.

Introduces an explicit multi-output test-case protocol:

test_generator now returns:

(inputs, outputs, expected)

What changed

  • C++ benchmark flow now keeps inputs, outputs, and expected separate.
  • Kernel launch is now kernel(*outputs, *inputs).
  • Result checking now validates each output tensor (not just the first output).
  • Updated Python types/docs to match the new format.
  • Updated exploit fixtures to the new multi-output kernel signature.

Note

This is a breaking change for test_generator return format.

Old:

return (out, x), (expected, rtol, atol)

New:

return (x,), (out,), ((expected, rtol, atol),)

Tested on Modal with both single-output and multi-output grayscale cases.

@ngc92
Copy link
Collaborator

ngc92 commented Mar 2, 2026

there are also in/out args, such as C += AB in a gemm. Would be nice if we could support this, too, and I'm not sure if this approach generalizes well. Otherwise, I like it.

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.

2 participants