-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: cleanup KLR definitions #17
Conversation
|
||
inductive Stmt where | ||
| pass | ||
| expr (v : Expr) |
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.
Why is expr
a statement in a language without side effects?
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.
Very good question. The (admittedly bad) answer is that I am not sure KLR is the final step. Maybe it isn't pure, but there is a transform we can do to make it pure. For example, we see stuff like:
# in nki.isa
def builtin_custom_op(fn_name, file_name, ucode_version, isa_version, srcs, dsts, **kwargs):
If you call this function, it would look like:
def kernel(...):
...
builtin_custom_op("name", "file", 1, 1, a, b)
return b
Right, now the call to builtin_custom_op
would be one of these expression statements. Not sure what to do here? I think we need to look one-by-one at the ISA operations.
Remove some unnecessary parts of KLR, and reorganize the source files.
Remove some unnecessary parts of KLR, and reorganize the source files.