-
Notifications
You must be signed in to change notification settings - Fork 8
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
Compiled code isn't standalone #28
Comments
There is apparently a C backend for TVM (idk if it's been merged into mainline yet) that generates C implementations of the operators, which we could possibly inline into these generated programs. I am not sure about the resulting performance, though. @MarisaKirisame do you have any thoughts? |
Does cross-compiling work for you? It will still emit those Get("") files, but they will be the right architecture. |
I'm not sure where the target of the |
@SWu they are so/dlls. |
@MarisaKirisame do you know where those are? I don't see any .so other than the compiled librelay_aot_1.so from source.cc |
@SWu tvm will emit source code and compile them into so/dll, see https://github.com/dmlc/tvm/blob/51785062553b19a219b2639cd230b7da7455cd0d/src/codegen/source_module.cc#L97. It is possible to send them onto another machine to execute. This process will be similiar for aot, but require changes to aot. Is a native dll standalone enough? |
Or you can cross compile all the source once tvm finished codegen. |
Is there some example of how to directly call codegen? Does aot currently call that codegen for the underlying ops? |
@jroesch I am not very familiar with low level part of tvm. can we meet and talk about changes need to make this happend. |
I don't think the compiled function is standalone right now, as ops inside the function are registered at compile-time as hashed references to JIT functions (i.e. here), which show up in the generated source.cc as e.g.
runtime::Registry::Get("op_-3048088960110736787");
I believe this means that outside of the context of the python interpreter where the function is first compiled, these references won't be valid. In particular, I don't think it's possible to directly use the
source.cc
as integration in a C++ app.Is there a way to generate truly standalone native code?
The text was updated successfully, but these errors were encountered: