Skip to content
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

Allow rust tvm build configuration through cargo features #8665

Merged
merged 2 commits into from
Aug 6, 2021

Conversation

schell
Copy link
Contributor

@schell schell commented Aug 5, 2021

  • exposes TVM cmake config settings as cargo features (for settings that make some sense)

After octoml/tvm-build#6 goes through we can update the cargo path to tvm-build and set this draft as ready to PR.

Ready!

@jroesch
Copy link
Member

jroesch commented Aug 5, 2021

cc @vegaluisjose

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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @schell just wondering, is it possible to auto-generate this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can think about this kind of stuff in the Backlog @areusch

@schell schell marked this pull request as ready for review August 5, 2021 22:37
@schell schell requested a review from jroesch as a code owner August 5, 2021 22:37
@schell schell requested a review from areusch August 6, 2021 10:32
Copy link
Member

@jroesch jroesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as first cut, feel free to follow up with more PRs.

@jroesch jroesch merged commit 49756a5 into apache:main Aug 6, 2021
@schell schell deleted the feat/rust-build-config-features branch August 6, 2021 20:47
@schell
Copy link
Contributor Author

schell commented Aug 6, 2021

Thank you for the fast turn-around :) 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants