Skip to content

[RFC][Rust][Roadmap] Expand Rust capabilities #2523

@nhynes

Description

@nhynes

The one thing that common to Rust programmers is that, if it's not written in Rust, it probably almost definitely should be. In the case of TVM, we can do this rather painlessly and incrementally since the "frontend" (i.e. bindings) made by @ehsanmok allow us to replicate the functionality of c++ TVM until the pure-Rust portion (currently a CPU-only static runtime) is feature complete.

The target for the next TVM release (0.6) will be (in order):

  • upgrade to Rust 2018 ([Rust] Update rustc #2524)
  • unify bindings and runtime under a single tvm namespace
    • use single bindgen-generated ffi in common, remove tvm-sys
    • use common types for packed_func, module, (DL)Tensor
  • make bindings optional using feature flag and conditional compilation
  • use newer failure crate for errors
  • Rust DeviceAPI (Add FFI DeviceAPI #2525)
  • Relay graph runtime
  • assess feasibility of porting compiler (incl. python bindings)

For those wondering "why even??," my main response would be that rust is more ergonomic than C++ (having powerful macros, a package manager, a sane standard library); safety is also nice to have but mostly for the runtime. In an ideal world, all of the boilerplate associated with creating new passes and operators is handled by a few proc_macros and some build.rs scripts--same with generating the python bindings (complete with docs; ref: #2328 (comment)).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions