-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[RFC] [Hybrid Script] A hybrid script backend #2432
Comments
maybe we want to have a pass instead of a backend, if we want to use it as a default debug printer. |
@tqchen A debug printer is far away from what we truly want. As I mention above, Halide To sum up, it is built like a "module" (arguments and buffers), stores information like a "module" (hybrid source code), and runs like a "module" (pass either tensors/placeholders to drive it), why do not we just make it a module? |
@tqchen I now know what you mean. |
Normally we have two kinds dump in traditional compilers,
is the second one what you want? but we can not have single readable and runnable dump this is our internal hacking
and then load json as input,
|
@were Can you provide more details about how this backend is used by developer? |
@kevinthesun I can elaborate it here: |
Sorry to change my mind again and again, and I will never use the term "finally". Making ideas is endless.
An IR Dumper #2288 , is more heavy-weighted than I supposed before.
I now decide to break this issue into 2 steps:
We already have Halide'sIRPrinter
to do a statical sanity check, and also the lowered IRs are too low-level to give good readability. Overall, what I want becomes something which is both runnable and gives full control to the IR body.IRPrinter
has bad support to the double-name thing.This is because currently, TVM uses "unique pointer" to differentiate objects.
For example, these 2 tensors below share the same name, but they are essentially two different tensors.
However, if users use these 2 tensors to build a module, and see the lowered body, it will be extremely confusing.
IRPrinter
just dumps these tensors without checking double-name.Also, he current
IRDump
dumps results of each pass to files whose suffixes are.cc
. I guess the point of doing this is to borrow the syntax highlight of.cc
. However, the contents dumped have nothing to do with C, so I believe migrating the text format to Python, and using Python suffix will be better.Thus,What's more, dumping IR as Python snippet will not suffice. Dumping a complete hybrid script function will be highly desirable.Something which is both runnable and contains its source code is exactly what
module
is in TVM.Finally, I decided to extend a hybrid module looks like this:
The text was updated successfully, but these errors were encountered: