Allow rust tvm build configuration through cargo features#8665
Allow rust tvm build configuration through cargo features#8665jroesch merged 2 commits intoapache:mainfrom
Conversation
| runtime-only = ["tvm-sys/runtime-only"] | ||
| blas = ["ndarray/blas"] | ||
| # Enabling any of the following features is like setting the value to "ON" in config.cmake. | ||
| use-cuda = ["tvm-sys/use-cuda"] |
There was a problem hiding this comment.
hey @schell just wondering, is it possible to auto-generate this file?
There was a problem hiding this comment.
I'm sure it's possible but it's definitely not standard. It would be a bespoke generator for sure.
This is the defacto Rust project declaration, so I think auto-generating it would be confusing for Rust contributors in the long run. I do agree that keeping these in sync with TVM proper will be a bit error prone though - especially since it has to happen in a number of crates in this repo. Unfortunately there doesn't seem to be any way to iterate over user-set features in Rust at the moment, which was what I was hoping to do to cut down on the boiler plate here.
Ultimately this approach is explicit, which is good - I learned about the CoreML support by adding these! But it does mean that the configurable features will always lag behind TVM proper.
There was a problem hiding this comment.
Maybe we can think about this kind of stuff in the Backlog @areusch
jroesch
left a comment
There was a problem hiding this comment.
LGTM as first cut, feel free to follow up with more PRs.
|
Thank you for the fast turn-around :) 👍 |
After octoml/tvm-build#6 goes through we can update the cargo path totvm-buildand set this draft as ready to PR.Ready!