We have been working a series of refactors to rebuild the ffi mechanism from ground up
As of the above PR, the ffi module is now a standalone module build from ground up, that takes minimal dependencies from the rest of the project. In this post, we would like to propose moving tvm-ffi into its own separate repo, this will allow the particular module to:
Retain minimum dependency and self-contained
Its own release schedule, which likely should favor stability, minimalism and reuse across projects
Potentially benefit other ml system projects
Hopefully that would marks a milestone that helps us to modularize the project further.
Interacting between Python and C++ is a really common requirement for modern ML systems. TVM FFI is one of the best interfaces (especially in error reporting) I have ever used. I believe this isolation would benefit the whole community
I like this idea. TVM FFI is the community’s learnings on ML system of many years, and can be used in many other projects as a common infrastructure. Previously one inconvenience to use FFI is the huge dependency on the entire TVM codebase. Separating the FFI as a standalone repo makes the FFI minimal and clean, and can significantly reduce the dependency and overhead of leveraging FFI in other projects and codebases, which is a really exciting direction.
Now that the FFI refactor is almost done and stable (thank you @tqchen for working on the FFI refactor throughout the these months), I agree that it’s a right time to take this step of separation. Looking forward to that and happy to help.
Thanks for driving this! This is a great step forward.
Decoupling tvm_ffi into a lightweight, standalone package is the right direction to me. It provides a much clearer separation of concerns and significantly lowers the barrier for ecosystem development (e.g., plugins, runtime extensions).
The improved packaging flexibility and reduced ABI coupling are huge wins for long-term maintainability. I fully support this and see it as a strong foundation for future modularization efforts.
Thanks for your work! And I find that the install from source page should update too, cause now there is no 3rdparty/tvm-ffi folder. While the doc still have somthing like:
Apache TVM relies on the tvm-ffi package to support its python bindings. Therefore, after we finish the build, we need to install the tvm-ffi package.