Add support for test generation when manual test is provided#117
Open
Add support for test generation when manual test is provided#117
Conversation
|
@Jack-Khuu has imported this pull request. If you are a Meta employee, you can view this in D95858679. |
kaiming-cheng
requested changes
Mar 10, 2026
Contributor
kaiming-cheng
left a comment
There was a problem hiding this comment.
Overall looks good! My comments is mainly on the design of using a list to store different test cases. Let me know what you think!
kaiming-cheng
approved these changes
Mar 10, 2026
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.
tldr: Add support to still generate tests when a custom one is provided to
TKA.generate_kernel.Currently, when a custom test is provided, the pipeline does not attempt to generate an LLM test for the problem.
This is fine, but the generated testing is very useful to have even if there is a custom test (e.g. if the custom test is expensive to run or incomplete).
This PR adds support for generating this test via a
generate_default_testflag.test_codesignature throughout the repo needed to be updated fromstrtolist[str]. Most of the files are changed, just change the type for test_code fromstr=>list[str].The only interesting changes are:
triton_kernel_agent/agent.py and triton_kernel_agent/worker.py
When multiple tests are provided, code extraction will prefer the code block with
kernel_functionin it.Extraction is unchanged for single tests
triton_kernel_agent/worker_util.py
Helper for formatting the additional tests as context
Note: this does not enable secondary tests for the Fuser path. This would require a separate effort as testing occurs only during
compositionwhich is after the sub-kernels have already been builtThis use case will be used for integrating auxiliary testing (internally)
Tested internally via