-
Notifications
You must be signed in to change notification settings - Fork 384
[tvm-ffi] Enable tvm-ffi for metal backend #1289
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
642f1e8 to
ab9ad61
Compare
ab9ad61 to
138d475
Compare
|
Some update: tvm's compiled device code into binary and embed them to runtime mod (inside What we need is to fork the current metal codegen from tvm, make sure it's aware of torch's mps context, and see if it works well. |
|
@oraluben Thanks and feel free to connect if you need any help :) |
This PR enables tvm-ffi backend for metal device, and is still under development.
It explicitly passes command buffer maintained by torch to tvm and reuse that buffer.
To run example, checkout tvm: tile-ai/tvm#21 and run
TILELANG_DISABLE_CACHE=1 python test.pyCurrent example hardcode necessary transformation by
register_c_postproc_callback. To archive our goal, the host runtime passestorch::mps::get_command_buffer()to tvm and force it to use it in the module. The runtime module also needs extra torch dependency.Ideally, those transformation should be done by a tvm pass, and the changes to
metal_module.mmdoesn't look very elegant. It would be great if someone familiar with tvm could give some advice.