Skip to content

Add a Mojo solution for PMPP v2 vectoradd - #177

Open
msaroufim wants to merge 2 commits into
mainfrom
mojo-vectoradd-solution
Open

msaroufim wants to merge 2 commits into
mainfrom
mojo-vectoradd-solution

Conversation

@msaroufim

@msaroufim msaroufim commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Supersedes #175 by @tolgacangoz. The commit credits them as co-author.

This adds a Mojo solution for vectoradd_v2, the same approach as #175. The file must not contain the word "stream", because kernelbot rejects such submissions. So it launches on Mojo's default DeviceContext queue. That is a blocking CUDA stream, ordered with the PyTorch default stream that the PMPP v2 eval uses. It also uses a plain import instead of importlib, so KernelGuard classifies it as valid.

It depends on gpu-mode/kernelbot#536, which installs max==26.7.0 in the Modal image.

Verified through the kernelbot API: I used a local server, a runner from gpu-mode/kernelbot#536 deployed to a separate Modal environment, and KernelGuard enabled. Test and leaderboard submissions on H100 succeeded, with a ranked score of 836 µs.

Earlier runner-level runs: I ran the current-stream version of this file through kernelbot's run_config on the real Modal image from that PR. Test and leaderboard modes pass on T4, L4, A100, H100 and B200, and benchmark mode passes on H100. On H100 the ranked mean for 16384² is 0.84 ms.

Not covered: PMPP v2 profile mode passes its check but produces no NCU report for this solution. I believe that is because the PMPP v2 eval has no custom_kernel NVTX range, so it would apply to every solution, but I didn't run another solution to confirm.

msaroufim and others added 2 commits November 23, 2026 01:18
The Mojo kernel is embedded in submission.py, compiled with mojo.importer,
and launched on PyTorch's current stream so evaluator ordering and CUDA
event timing include it.

Co-authored-by: M. Tolga Cangöz <mtcangoz@gmail.com>
Submissions containing "stream" are rejected by the API and Discord, so the
solution uses Mojo's default DeviceContext queue. It is a blocking stream and
stays ordered with PyTorch's default stream, which the PMPP v2 eval uses.
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