tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[Bug] [Rust] dependency crates out of date?

Open eelgaev opened this issue 3 years ago • 2 comments

Hey, I began to use TVM in my environment to optimize and use trained models, It's really great so far and looks very promising. I'm currently hoping to write a Rust based inference code using tvm, the sample in the tvm-rt crate looks okay. But when I actually try to add the crate, it fails, due to subdependency of tvm-build named "platforms". another question I have, what is the purpose of "tvm-build" crate, and why is it not included here?

Expected behavior

I added the crate to my rust project by running:

cargo add tvm-rt

I was expecting a full build or having all the dependencies resolved.

Actual behavior

But I get errors indicating that the sub-dependency 'platforms' is seriously out of date.

error: failed to select a version for the requirement `platforms = "^0.2.0"`
candidate versions found which didn't match: 3.0.2, 3.0.1, 3.0.0, ...
location searched: crates.io index
required by package `heim-host v0.0.11`
    ... which satisfies dependency `heim-host = "^0.0.11"` of package `heim v0.0.11`
    ... which satisfies dependency `heim = "^0.0.11"` of package `tvm-build v0.1.0`
    ... which satisfies dependency `tvm-build = "^0.1"` of package `tvm-sys v0.1.1-alpha`
    ... which satisfies dependency `tvm-sys = "^0.1.1-alpha"` of package `tvm-rt v0.1.0-alpha`
    ... which satisfies dependency `tvm-rt = "^0.1.0-alpha"` of package `rs v0.1.0 (/home/eli/Projects/tvm/rs)`

Environment

OS: Ubuntu 22.04 LTS x86_64 rustc 1.64.0 (a55dd71d5 2022-09-19) cargo 1.64.0 (387270bc7 2022-09-16)

Steps to reproduce

mkdir try_tvm
cd try_tvm
cargo init
cargo add tvm-rt

Triage

Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).

  • needs-triage

cc @ehsanmok

eelgaev avatar Dec 13 '22 11:12 eelgaev

Okay, I figured it out.

I'm using the TVM I compiled previously by telling cargo to use the crate like that:

tvm-rt = { path = "/home/eli/Projects/tvm/tvm/rust/tvm-rt", features = ["dynamic-linking"] }

Having some other issues at the moment, so I guess this is resolved.

eelgaev avatar Dec 13 '22 14:12 eelgaev

heim is still unmaintained and should probably be replaced by sysinfo or similar.

kaimast avatar Dec 10 '24 03:12 kaimast