-
Notifications
You must be signed in to change notification settings - Fork 12
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
Adds verify utility for kernels #31
base: main
Are you sure you want to change the base?
Conversation
This is a helper script verify e2e numerical equivalence of two MLIR programs.
Im looking for a place to park this script. This would allow us to compare two MLIR programs -- numerically. |
"--device_allocator=caching", | ||
f"--module={vmfb_file}", | ||
"--function=main", | ||
f"--input=@{inputs[0].name}", |
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.
Seems hardcoded for 3 inputs for attention. Want to generalize that?
import argparse | ||
from utils import * | ||
|
||
def compile_attention_mlir_file(mlir_file : str, target_device: str, hip_target: str, extra_flags: list): |
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.
Let's change to just compile_mlir_file
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: |
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.
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?
Yeah this would definitely be helpful and seems like a good spot for it to go |
This is a helper script verify
e2e numerical equivalence of
two MLIR programs.