Adds verify utility for kernels - #31
Open
manupak wants to merge 1 commit into
Open
Conversation
This is a helper script verify e2e numerical equivalence of two MLIR programs.
Contributor
Author
|
Im looking for a place to park this script. This would allow us to compare two MLIR programs -- numerically. |
saienduri
reviewed
Nov 15, 2024
| "--device_allocator=caching", | ||
| f"--module={vmfb_file}", | ||
| "--function=main", | ||
| f"--input=@{inputs[0].name}", |
Contributor
There was a problem hiding this comment.
Seems hardcoded for 3 inputs for attention. Want to generalize that?
saienduri
reviewed
Nov 15, 2024
| import argparse | ||
| from utils import * | ||
|
|
||
| def compile_attention_mlir_file(mlir_file : str, target_device: str, hip_target: str, extra_flags: list): |
Contributor
There was a problem hiding this comment.
Let's change to just compile_mlir_file
saienduri
reviewed
Nov 15, 2024
| return vmfb_file | ||
|
|
||
| def get_output_npy(vmfb_file : str, inputs : List[str], target_device: str): | ||
| with tempfile.NamedTemporaryFile(suffix='.npy', delete=False) as out: |
Contributor
There was a problem hiding this comment.
We usually use bin files for validation. (We've actually noticed a difference between the two in some special cases 😄). Want to change to bin?
Contributor
|
Yeah this would definitely be helpful and seems like a good spot for it to go |
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.
This is a helper script verify
e2e numerical equivalence of
two MLIR programs.