Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 defaultDeviceContextqueue. That is a blocking CUDA stream, ordered with the PyTorch default stream that the PMPP v2 eval uses. It also uses a plainimportinstead ofimportlib, so KernelGuard classifies it asvalid.It depends on gpu-mode/kernelbot#536, which installs
max==26.7.0in 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_configon 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_kernelNVTX range, so it would apply to every solution, but I didn't run another solution to confirm.