-
Notifications
You must be signed in to change notification settings - Fork 45
Add triton to kernel bench #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Would it make sense to add the artefacts produced (ie, results) of one of the LLMs at least that can be obtained when executing via this PR to its description for reference? For anything that we do with this new "KernelBench-Triton" variant, it might prove helpful to have some expected numbers to compare against in order to check correctness of this and subsequent implementations. Appending a bunch of the generated prompt->response pairs of both success and failure cases may also help us convincing ourselves that everything makes sense as suggested in here. For example, if any particular model should obtain a 0% score, I think we should quickly rule out that a trivial issue is causing that. |
@PaliC once you have the format decided, Another thing @msaroufim mentioned is we might need to filter out how many KernelBench problems are purely functional to satisfy the format. |
def prompt_fix_compile(ref_arch_src, custom_kernel, metadata): | ||
prompt = PROBLEM_STATEMENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for this PR!
Btw, this PROBLEM_STATEMENT
and some other things are easily caught by a linter.
As this PR is very stale and breaks KernelBench upstream quite a bit, please move discussion to #35 which does the same thing on the current iteration of kernelbench. |
Adds triton support to kernel bench (not including CoT or multiturn).
The simple bit is just adding a triton prompt and support for switching from cuda to triton.
The more risky bit is evaluation. Because triton usually uses decorators like @triton.jit which are not supported in
exec
, now instead of taking the model from generated code usingexec
, we use a hacky solution of writing a temp file and importing directly from that file. Unfortunately, that temp file has to be deleted manually, but afaict (without just using the on disk source file for the generated code which we could do), there isn't really another way to cleanly run decorators outside of modifying the generated code.Test Plan:
I ran the following commands and things seemed to work as expected: