This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm-tirx.git
The following commit(s) were added to refs/heads/main by this push:
new 27772b261 [Rust] Move the crate into a rust/ workspace (#229)
27772b261 is described below
commit 27772b26114741f5040d5e62002c1cdc5141fdb6
Author: Tianqi Chen <[email protected]>
AuthorDate: Sat Nov 7 21:08:45 2026 -0500
[Rust] Move the crate into a rust/ workspace (#229)
`rust/` becomes a Cargo workspace and the `tvm-tirx` crate moves
unchanged to `rust/tvm-tirx`, aligning the layout with tvm-ffi and
leaving room for more crates if needed.
- `rust/Cargo.toml` is the workspace manifest; `Cargo.lock`,
`rustfmt.toml` and the target directory stay at `rust/`.
- The CMake build, the example crates, the release dependency rewrite,
the publish workflow, the stubgen paths and the docs point at
`rust/tvm-tirx`.
---
.github/workflows/publish_crate.yml | 8 ++---
AGENTS.md | 6 ++--
ci/wheel/detect_tvm_ffi_version.py | 2 +-
cmake/modules/Rust.cmake | 10 +++----
docs/dev/doc_build.rst | 4 +--
examples/extension_guides/rust/Cargo.toml | 2 +-
examples/ir_guides/rust/Cargo.toml | 2 +-
rust/Cargo.toml | 35 ++--------------------
rust/{ => tvm-tirx}/Cargo.toml | 5 +---
rust/{ => tvm-tirx}/build.rs | 0
rust/{ => tvm-tirx}/examples/define_ir.rs | 0
rust/{ => tvm-tirx}/src/backend.rs | 0
rust/{ => tvm-tirx}/src/backend/cuda.rs | 0
rust/{ => tvm-tirx}/src/backend/cuda/op.rs | 0
rust/{ => tvm-tirx}/src/codegen.rs | 0
rust/{ => tvm-tirx}/src/codegen/llvm.rs | 0
rust/{ => tvm-tirx}/src/ir.rs | 0
rust/{ => tvm-tirx}/src/ir/attrs.rs | 0
rust/{ => tvm-tirx}/src/ir/base.rs | 0
rust/{ => tvm-tirx}/src/ir/dtype.rs | 0
rust/{ => tvm-tirx}/src/ir/expr.rs | 0
rust/{ => tvm-tirx}/src/ir/function.rs | 0
rust/{ => tvm-tirx}/src/ir/global_info.rs | 0
rust/{ => tvm-tirx}/src/ir/location.rs | 0
rust/{ => tvm-tirx}/src/ir/module.rs | 0
rust/{ => tvm-tirx}/src/ir/op.rs | 0
rust/{ => tvm-tirx}/src/ir/op_def.rs | 0
rust/{ => tvm-tirx}/src/ir/prim.rs | 0
rust/{ => tvm-tirx}/src/ir/prim/const_fold.rs | 0
rust/{ => tvm-tirx}/src/ir/prim/expr.rs | 0
rust/{ => tvm-tirx}/src/ir/prim/op.rs | 0
rust/{ => tvm-tirx}/src/ir/prim/vector_expr.rs | 0
rust/{ => tvm-tirx}/src/ir/stmt.rs | 0
rust/{ => tvm-tirx}/src/ir/support.rs | 0
rust/{ => tvm-tirx}/src/ir/transform.rs | 0
rust/{ => tvm-tirx}/src/ir/transform/core.rs | 0
rust/{ => tvm-tirx}/src/ir/transform/instrument.rs | 0
rust/{ => tvm-tirx}/src/ir/type.rs | 0
rust/{ => tvm-tirx}/src/ir/type_def.rs | 0
rust/{ => tvm-tirx}/src/ir/unique_name_supply.rs | 0
rust/{ => tvm-tirx}/src/lib.rs | 2 +-
rust/{ => tvm-tirx}/src/macro.rs | 0
.../src/macro/def_expr_op_overloads.rs | 0
rust/{ => tvm-tirx}/src/runtime.rs | 0
rust/{ => tvm-tirx}/src/script.rs | 0
rust/{ => tvm-tirx}/src/sym.rs | 0
rust/{ => tvm-tirx}/src/sym/analyzer.rs | 0
rust/{ => tvm-tirx}/src/sym/constraint.rs | 0
rust/{ => tvm-tirx}/src/sym/int_set.rs | 0
rust/{ => tvm-tirx}/src/sym/iter_affine_map.rs | 0
rust/{ => tvm-tirx}/src/target.rs | 0
rust/{ => tvm-tirx}/src/tirx.rs | 0
rust/{ => tvm-tirx}/src/tirx/analysis.rs | 0
rust/{ => tvm-tirx}/src/tirx/analysis/analysis.rs | 0
rust/{ => tvm-tirx}/src/tirx/function.rs | 0
rust/{ => tvm-tirx}/src/tirx/index_map.rs | 0
rust/{ => tvm-tirx}/src/tirx/layout.rs | 0
rust/{ => tvm-tirx}/src/tirx/op.rs | 0
rust/{ => tvm-tirx}/src/tirx/op_attr.rs | 0
rust/{ => tvm-tirx}/src/tirx/structural.rs | 0
.../tirx/structural_map_with_constraint_context.rs | 0
.../structural_mutate_with_constraint_context.rs | 0
.../structural_visit_with_constraint_context.rs | 0
.../structural_walk_with_constraint_context.rs | 0
rust/{ => tvm-tirx}/src/tirx/tensor.rs | 0
rust/{ => tvm-tirx}/src/tirx/thread_scope.rs | 0
rust/{ => tvm-tirx}/src/tirx/tile.rs | 0
rust/{ => tvm-tirx}/src/tirx/tile/dispatch.rs | 0
rust/{ => tvm-tirx}/src/tirx/tile/instruction.rs | 0
rust/{ => tvm-tirx}/src/tirx/transform.rs | 0
.../src/tirx/transform/function_pass.rs | 0
.../{ => tvm-tirx}/src/tirx/transform/transform.rs | 0
rust/{ => tvm-tirx}/src/tirx/type.rs | 0
rust/{ => tvm-tirx}/tests/codegen/llvm.rs | 0
rust/{ => tvm-tirx}/tests/codegen/main.rs | 0
rust/{ => tvm-tirx}/tests/common/mod.rs | 0
rust/{ => tvm-tirx}/tests/ir/expr.rs | 0
rust/{ => tvm-tirx}/tests/ir/function.rs | 0
rust/{ => tvm-tirx}/tests/ir/location.rs | 0
rust/{ => tvm-tirx}/tests/ir/main.rs | 0
rust/{ => tvm-tirx}/tests/ir/module.rs | 0
rust/{ => tvm-tirx}/tests/ir/op.rs | 0
rust/{ => tvm-tirx}/tests/ir/op_def.rs | 0
rust/{ => tvm-tirx}/tests/ir/prim.rs | 0
rust/{ => tvm-tirx}/tests/ir/prim/expr.rs | 0
rust/{ => tvm-tirx}/tests/ir/prim/op.rs | 0
rust/{ => tvm-tirx}/tests/ir/prim/vector_expr.rs | 0
rust/{ => tvm-tirx}/tests/ir/stmt.rs | 0
rust/{ => tvm-tirx}/tests/ir/transform.rs | 0
rust/{ => tvm-tirx}/tests/ir/transform/core.rs | 0
.../tests/ir/transform/instrument.rs | 0
rust/{ => tvm-tirx}/tests/ir/type.rs | 0
rust/{ => tvm-tirx}/tests/ir/unique_name_supply.rs | 0
rust/{ => tvm-tirx}/tests/runtime/main.rs | 0
rust/{ => tvm-tirx}/tests/script/main.rs | 0
rust/{ => tvm-tirx}/tests/sym/analyzer.rs | 0
rust/{ => tvm-tirx}/tests/sym/int_set.rs | 0
rust/{ => tvm-tirx}/tests/sym/iter_affine_map.rs | 0
rust/{ => tvm-tirx}/tests/sym/main.rs | 0
rust/{ => tvm-tirx}/tests/target/main.rs | 0
rust/{ => tvm-tirx}/tests/tirx/analysis.rs | 0
.../{ => tvm-tirx}/tests/tirx/analysis/analysis.rs | 0
rust/{ => tvm-tirx}/tests/tirx/function.rs | 0
rust/{ => tvm-tirx}/tests/tirx/index_map.rs | 0
rust/{ => tvm-tirx}/tests/tirx/layout.rs | 0
rust/{ => tvm-tirx}/tests/tirx/main.rs | 0
rust/{ => tvm-tirx}/tests/tirx/op.rs | 0
.../tirx/structural_map_with_constraint_context.rs | 0
.../structural_mutate_with_constraint_context.rs | 0
.../structural_visit_with_constraint_context.rs | 0
.../structural_walk_with_constraint_context.rs | 0
rust/{ => tvm-tirx}/tests/tirx/tensor.rs | 0
rust/{ => tvm-tirx}/tests/tirx/thread_scope.rs | 0
rust/{ => tvm-tirx}/tests/tirx/tile.rs | 0
rust/{ => tvm-tirx}/tests/tirx/tile/dispatch.rs | 0
rust/{ => tvm-tirx}/tests/tirx/tile/instruction.rs | 0
rust/{ => tvm-tirx}/tests/tirx/transform.rs | 0
.../tests/tirx/transform/function_pass.rs | 0
.../tests/tirx/transform/transform.rs | 0
tests/python/ir/test_op_rust.py | 6 ++--
tests/scripts/task_build_cpu.sh | 2 +-
tests/scripts/task_build_gpu.sh | 2 +-
tests/scripts/task_install_rust.sh | 2 +-
123 files changed, 28 insertions(+), 60 deletions(-)
diff --git a/.github/workflows/publish_crate.yml
b/.github/workflows/publish_crate.yml
index 76ef39d8b..a04e0bdfe 100644
--- a/.github/workflows/publish_crate.yml
+++ b/.github/workflows/publish_crate.yml
@@ -176,18 +176,18 @@ jobs:
run: rustup toolchain install stable --profile minimal
- name: Test crate
- working-directory: rust
+ working-directory: rust/tvm-tirx
run: cargo +stable test --release
# Packages and verifies the crate with the release metadata and registry
dependency edits.
- name: Dry-run crate publication
- working-directory: rust
+ working-directory: rust/tvm-tirx
run: cargo +stable publish --dry-run --registry crates-io --allow-dirty
# The dry run keeps its .crate file in a temporary directory; write it
out again, without
# re-verifying, for the artifact upload.
- name: Package crate
- working-directory: rust
+ working-directory: rust/tvm-tirx
run: cargo +stable package --registry crates-io --allow-dirty
--no-verify
- name: Upload crate artifact
@@ -246,4 +246,4 @@ jobs:
exit 1
fi
echo "Publishing tvm-tirx@${CRATE_VERSION}"
- cargo +stable publish --manifest-path rust/Cargo.toml --registry
crates-io --allow-dirty --no-verify
+ cargo +stable publish --manifest-path rust/tvm-tirx/Cargo.toml
--registry crates-io --allow-dirty --no-verify
diff --git a/AGENTS.md b/AGENTS.md
index 2d06444d3..ad824a542 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -34,7 +34,7 @@ harnesses on top. The Python package is `tvm_tirx`; the
distribution is
include/tvm/ C++ public headers (ir, sym, tirx, target, runtime,
backends)
src/ C++ compiler and runtime implementations
python/tvm_tirx/ Python package and reflected C++ bindings
-rust/ Rust crate: IR, analysis, passes, and extension APIs
+rust/tvm-tirx/ Rust crate: IR, analysis, passes, and extension APIs
tests/cpp/ GoogleTest C++ tests
tests/python/ pytest tests organized by owning namespace and backend
tests/lint/ ASF header and file-type checks
@@ -124,7 +124,7 @@ describe missing coverage; they do not demonstrate that a
backend works.
### Rust crate
-`rust/` is a standalone crate (`tvm-tirx`) over the initialized
+`rust/` is a Cargo workspace; its crate `rust/tvm-tirx` (`tvm-tirx`) builds
over the initialized
`3rdparty/tvm-ffi/rust` submodule sources. Release CI requires the submodule
on an exact TVM FFI release tag and rewrites the dependency to that exact
crates.io version before packaging or publishing. The Rust definitions of
@@ -139,7 +139,7 @@ so build TIRx first. Its build script needs
`tvm-ffi-config` and
install:
```bash
-uv run --no-sync tvm-ffi-stubgen rust/src --target rust --dlls
build/lib/libtvm_tirx_compiler.so --check
+uv run --no-sync tvm-ffi-stubgen rust/tvm-tirx/src --target rust --dlls
build/lib/libtvm_tirx_compiler.so --check
uv run --no-sync cargo fmt --check --manifest-path rust/Cargo.toml
uv run --no-sync cargo test --manifest-path rust/Cargo.toml
```
diff --git a/ci/wheel/detect_tvm_ffi_version.py
b/ci/wheel/detect_tvm_ffi_version.py
index de3daa8be..cf2bc41db 100644
--- a/ci/wheel/detect_tvm_ffi_version.py
+++ b/ci/wheel/detect_tvm_ffi_version.py
@@ -76,7 +76,7 @@ def rewrite_dependency(root, version):
if not re.fullmatch(VERSION_PATTERN, version):
raise SystemExit("version must come from the verified submodule
release tag")
main = tomlkit.parse((root / "pyproject.toml").read_text(encoding="utf-8"))
- crate_path = root / "rust/Cargo.toml"
+ crate_path = root / "rust/tvm-tirx/Cargo.toml"
crate = tomlkit.parse(crate_path.read_text(encoding="utf-8"))
# Remove the source path entirely. An exact requirement preserves
prerelease versions
# such as 0.1.15-post2, which a caret requirement could replace with the
older 0.1.15.
diff --git a/cmake/modules/Rust.cmake b/cmake/modules/Rust.cmake
index 94c90c274..4bdbd7f78 100644
--- a/cmake/modules/Rust.cmake
+++ b/cmake/modules/Rust.cmake
@@ -15,10 +15,10 @@
# specific language governing permissions and limitations
# under the License.
-# The crate in rust/, built by cargo as a shared library and installed as
libtvm_tirx_rust next to
-# libtvm_tirx_compiler. `import tvm_tirx` loads it through the backend
autoload and registers the
-# operators it defines (python/tvm_tirx/backend/rust), as loading the compiler
registers the C++
-# ones.
+# The crate in rust/tvm-tirx, built by cargo as a shared library and installed
as
+# libtvm_tirx_rust next to libtvm_tirx_compiler. `import tvm_tirx` loads it
through the backend
+# autoload and registers the operators it defines
(python/tvm_tirx/backend/rust), as loading the
+# compiler registers the C++ ones.
#
# TVM_TIRX_USE_RUST is ON, OFF or AUTO. AUTO builds the library when it can:
with the crate's
# sources (a source distribution has none), with a cargo at least as new as
the crate's
@@ -34,7 +34,7 @@ if("${TVM_TIRX_USE_RUST}" MATCHES ${IS_FALSE_PATTERN})
file(REMOVE "${_rust_old_lib}")
return()
endif()
-set(_rust_manifest "${CMAKE_CURRENT_SOURCE_DIR}/rust/Cargo.toml")
+set(_rust_manifest "${CMAKE_CURRENT_SOURCE_DIR}/rust/tvm-tirx/Cargo.toml")
set(_rust_problem "")
if(NOT EXISTS "${_rust_manifest}")
set(_rust_problem "${_rust_manifest} does not exist")
diff --git a/docs/dev/doc_build.rst b/docs/dev/doc_build.rst
index da0c05b1a..42d528253 100644
--- a/docs/dev/doc_build.rst
+++ b/docs/dev/doc_build.rst
@@ -91,7 +91,7 @@ Set ``BUILD_CPP_DOCS=1`` on the desired build command to
enable the extra step:
Build with Rust Docs
--------------------
-The Rust API reference is the ``cargo doc`` output of the ``rust/`` crate,
copied
+The Rust API reference is the ``cargo doc`` output of the ``rust/tvm-tirx``
crate, copied
under ``reference/rust/generated`` of the HTML output. Use Rust 1.95 or newer,
as required by the crate and its ``tvm-ffi`` dependency. The crate's build
script runs
``tvm-tirx-config`` to find ``libtvm_tirx_compiler``, so
@@ -103,7 +103,7 @@ build the package first; ``uv run`` puts the helper on
``PATH``. Set
# Interactive build with auto-rebuild on crate changes
BUILD_RUST_DOCS=1 uv run --no-sync sphinx-autobuild docs docs/_build/html \
--ignore docs/reference/python/generated --ignore
docs/reference/cpp/generated \
- --watch rust/src
+ --watch rust/tvm-tirx/src
# One-off build
BUILD_RUST_DOCS=1 uv run --no-sync python -m sphinx -b html -W docs
docs/_build/html
diff --git a/examples/extension_guides/rust/Cargo.toml
b/examples/extension_guides/rust/Cargo.toml
index a224f8446..8f94d2c5d 100644
--- a/examples/extension_guides/rust/Cargo.toml
+++ b/examples/extension_guides/rust/Cargo.toml
@@ -28,6 +28,6 @@ crate-type = ["cdylib"]
[dependencies]
# This example builds against this checkout. A standalone extension depends on
# the published releases instead, e.g. tvm-tirx = "<version>".
-tvm-tirx = { path = "../../../rust" }
+tvm-tirx = { path = "../../../rust/tvm-tirx" }
# Procedural macros resolve the FFI crate directly; use the same pinned
sources.
tvm-ffi = { path = "../../../3rdparty/tvm-ffi/rust/tvm-ffi" }
diff --git a/examples/ir_guides/rust/Cargo.toml
b/examples/ir_guides/rust/Cargo.toml
index 61a6ba338..59164be56 100644
--- a/examples/ir_guides/rust/Cargo.toml
+++ b/examples/ir_guides/rust/Cargo.toml
@@ -28,6 +28,6 @@ crate-type = ["cdylib"]
[dependencies]
# Use the bindings from this checkout to match the current IR node fields.
-tvm-tirx = { path = "../../../rust" }
+tvm-tirx = { path = "../../../rust/tvm-tirx" }
# Procedural macros resolve the FFI crate directly; use the same pinned
sources.
tvm-ffi = { path = "../../../3rdparty/tvm-ffi/rust/tvm-ffi" }
diff --git a/rust/Cargo.toml b/rust/Cargo.toml
index 5fdac8a72..a95b462f1 100644
--- a/rust/Cargo.toml
+++ b/rust/Cargo.toml
@@ -15,36 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-[package]
-name = "tvm-tirx"
-version = "0.1.0-alpha.5"
-edition = "2021"
-# The oldest toolchain that builds the crate and tvm-ffi; CMake checks cargo
against it.
-rust-version = "1.95"
-description = "The TVM TIRx compiler in Rust: IR, analysis, passes, and IR
extensions"
-license = "Apache-2.0"
-homepage = "https://tvm.apache.org/tirx/"
-documentation = "https://tvm.apache.org/tirx/reference/rust/"
-repository = "https://github.com/apache/tvm-tirx"
-keywords = ["tvm", "compiler", "tensor", "ir", "ffi"]
-categories = ["compilers"]
-# The build directories CMake creates here are not part of the crate.
-include = ["/build.rs", "/src", "/examples", "/tests"]
-
-[lib]
-name = "tvm_tirx"
-# The shared library is the one `import tvm_tirx` loads, installed as
`libtvm_tirx_rust`.
-crate-type = ["rlib", "cdylib"]
-
-[dependencies]
-# Develop against the submodule sources, including changes between tvm-ffi
releases.
-# Release CI replaces this with an exact crates.io version from the submodule
release tag.
-tvm-ffi = { path = "../3rdparty/tvm-ffi/rust/tvm-ffi" }
-
-# A library of operators and a type defined in Rust, which
`tests/python/ir/test_op_rust.py` loads.
-[[example]]
-name = "define_ir"
-crate-type = ["cdylib"]
-
-# Standalone crate: not a member of any enclosing workspace.
[workspace]
+members = ["tvm-tirx"]
+
+resolver = "2"
diff --git a/rust/Cargo.toml b/rust/tvm-tirx/Cargo.toml
similarity index 93%
copy from rust/Cargo.toml
copy to rust/tvm-tirx/Cargo.toml
index 5fdac8a72..9cee43c4e 100644
--- a/rust/Cargo.toml
+++ b/rust/tvm-tirx/Cargo.toml
@@ -39,12 +39,9 @@ crate-type = ["rlib", "cdylib"]
[dependencies]
# Develop against the submodule sources, including changes between tvm-ffi
releases.
# Release CI replaces this with an exact crates.io version from the submodule
release tag.
-tvm-ffi = { path = "../3rdparty/tvm-ffi/rust/tvm-ffi" }
+tvm-ffi = { path = "../../3rdparty/tvm-ffi/rust/tvm-ffi" }
# A library of operators and a type defined in Rust, which
`tests/python/ir/test_op_rust.py` loads.
[[example]]
name = "define_ir"
crate-type = ["cdylib"]
-
-# Standalone crate: not a member of any enclosing workspace.
-[workspace]
diff --git a/rust/build.rs b/rust/tvm-tirx/build.rs
similarity index 100%
rename from rust/build.rs
rename to rust/tvm-tirx/build.rs
diff --git a/rust/examples/define_ir.rs b/rust/tvm-tirx/examples/define_ir.rs
similarity index 100%
rename from rust/examples/define_ir.rs
rename to rust/tvm-tirx/examples/define_ir.rs
diff --git a/rust/src/backend.rs b/rust/tvm-tirx/src/backend.rs
similarity index 100%
rename from rust/src/backend.rs
rename to rust/tvm-tirx/src/backend.rs
diff --git a/rust/src/backend/cuda.rs b/rust/tvm-tirx/src/backend/cuda.rs
similarity index 100%
rename from rust/src/backend/cuda.rs
rename to rust/tvm-tirx/src/backend/cuda.rs
diff --git a/rust/src/backend/cuda/op.rs b/rust/tvm-tirx/src/backend/cuda/op.rs
similarity index 100%
rename from rust/src/backend/cuda/op.rs
rename to rust/tvm-tirx/src/backend/cuda/op.rs
diff --git a/rust/src/codegen.rs b/rust/tvm-tirx/src/codegen.rs
similarity index 100%
rename from rust/src/codegen.rs
rename to rust/tvm-tirx/src/codegen.rs
diff --git a/rust/src/codegen/llvm.rs b/rust/tvm-tirx/src/codegen/llvm.rs
similarity index 100%
rename from rust/src/codegen/llvm.rs
rename to rust/tvm-tirx/src/codegen/llvm.rs
diff --git a/rust/src/ir.rs b/rust/tvm-tirx/src/ir.rs
similarity index 100%
rename from rust/src/ir.rs
rename to rust/tvm-tirx/src/ir.rs
diff --git a/rust/src/ir/attrs.rs b/rust/tvm-tirx/src/ir/attrs.rs
similarity index 100%
rename from rust/src/ir/attrs.rs
rename to rust/tvm-tirx/src/ir/attrs.rs
diff --git a/rust/src/ir/base.rs b/rust/tvm-tirx/src/ir/base.rs
similarity index 100%
rename from rust/src/ir/base.rs
rename to rust/tvm-tirx/src/ir/base.rs
diff --git a/rust/src/ir/dtype.rs b/rust/tvm-tirx/src/ir/dtype.rs
similarity index 100%
rename from rust/src/ir/dtype.rs
rename to rust/tvm-tirx/src/ir/dtype.rs
diff --git a/rust/src/ir/expr.rs b/rust/tvm-tirx/src/ir/expr.rs
similarity index 100%
rename from rust/src/ir/expr.rs
rename to rust/tvm-tirx/src/ir/expr.rs
diff --git a/rust/src/ir/function.rs b/rust/tvm-tirx/src/ir/function.rs
similarity index 100%
rename from rust/src/ir/function.rs
rename to rust/tvm-tirx/src/ir/function.rs
diff --git a/rust/src/ir/global_info.rs b/rust/tvm-tirx/src/ir/global_info.rs
similarity index 100%
rename from rust/src/ir/global_info.rs
rename to rust/tvm-tirx/src/ir/global_info.rs
diff --git a/rust/src/ir/location.rs b/rust/tvm-tirx/src/ir/location.rs
similarity index 100%
rename from rust/src/ir/location.rs
rename to rust/tvm-tirx/src/ir/location.rs
diff --git a/rust/src/ir/module.rs b/rust/tvm-tirx/src/ir/module.rs
similarity index 100%
rename from rust/src/ir/module.rs
rename to rust/tvm-tirx/src/ir/module.rs
diff --git a/rust/src/ir/op.rs b/rust/tvm-tirx/src/ir/op.rs
similarity index 100%
rename from rust/src/ir/op.rs
rename to rust/tvm-tirx/src/ir/op.rs
diff --git a/rust/src/ir/op_def.rs b/rust/tvm-tirx/src/ir/op_def.rs
similarity index 100%
rename from rust/src/ir/op_def.rs
rename to rust/tvm-tirx/src/ir/op_def.rs
diff --git a/rust/src/ir/prim.rs b/rust/tvm-tirx/src/ir/prim.rs
similarity index 100%
rename from rust/src/ir/prim.rs
rename to rust/tvm-tirx/src/ir/prim.rs
diff --git a/rust/src/ir/prim/const_fold.rs
b/rust/tvm-tirx/src/ir/prim/const_fold.rs
similarity index 100%
rename from rust/src/ir/prim/const_fold.rs
rename to rust/tvm-tirx/src/ir/prim/const_fold.rs
diff --git a/rust/src/ir/prim/expr.rs b/rust/tvm-tirx/src/ir/prim/expr.rs
similarity index 100%
rename from rust/src/ir/prim/expr.rs
rename to rust/tvm-tirx/src/ir/prim/expr.rs
diff --git a/rust/src/ir/prim/op.rs b/rust/tvm-tirx/src/ir/prim/op.rs
similarity index 100%
rename from rust/src/ir/prim/op.rs
rename to rust/tvm-tirx/src/ir/prim/op.rs
diff --git a/rust/src/ir/prim/vector_expr.rs
b/rust/tvm-tirx/src/ir/prim/vector_expr.rs
similarity index 100%
rename from rust/src/ir/prim/vector_expr.rs
rename to rust/tvm-tirx/src/ir/prim/vector_expr.rs
diff --git a/rust/src/ir/stmt.rs b/rust/tvm-tirx/src/ir/stmt.rs
similarity index 100%
rename from rust/src/ir/stmt.rs
rename to rust/tvm-tirx/src/ir/stmt.rs
diff --git a/rust/src/ir/support.rs b/rust/tvm-tirx/src/ir/support.rs
similarity index 100%
rename from rust/src/ir/support.rs
rename to rust/tvm-tirx/src/ir/support.rs
diff --git a/rust/src/ir/transform.rs b/rust/tvm-tirx/src/ir/transform.rs
similarity index 100%
rename from rust/src/ir/transform.rs
rename to rust/tvm-tirx/src/ir/transform.rs
diff --git a/rust/src/ir/transform/core.rs
b/rust/tvm-tirx/src/ir/transform/core.rs
similarity index 100%
rename from rust/src/ir/transform/core.rs
rename to rust/tvm-tirx/src/ir/transform/core.rs
diff --git a/rust/src/ir/transform/instrument.rs
b/rust/tvm-tirx/src/ir/transform/instrument.rs
similarity index 100%
rename from rust/src/ir/transform/instrument.rs
rename to rust/tvm-tirx/src/ir/transform/instrument.rs
diff --git a/rust/src/ir/type.rs b/rust/tvm-tirx/src/ir/type.rs
similarity index 100%
rename from rust/src/ir/type.rs
rename to rust/tvm-tirx/src/ir/type.rs
diff --git a/rust/src/ir/type_def.rs b/rust/tvm-tirx/src/ir/type_def.rs
similarity index 100%
rename from rust/src/ir/type_def.rs
rename to rust/tvm-tirx/src/ir/type_def.rs
diff --git a/rust/src/ir/unique_name_supply.rs
b/rust/tvm-tirx/src/ir/unique_name_supply.rs
similarity index 100%
rename from rust/src/ir/unique_name_supply.rs
rename to rust/tvm-tirx/src/ir/unique_name_supply.rs
diff --git a/rust/src/lib.rs b/rust/tvm-tirx/src/lib.rs
similarity index 99%
rename from rust/src/lib.rs
rename to rust/tvm-tirx/src/lib.rs
index bcece86e9..decc8f748 100644
--- a/rust/src/lib.rs
+++ b/rust/tvm-tirx/src/lib.rs
@@ -149,7 +149,7 @@
//! rebuilding `libtvm_tirx_compiler` (`--check` only reports stale blocks):
//!
//! ```bash
-//! tvm-ffi-stubgen rust/src --target rust --dlls
build/lib/libtvm_tirx_compiler.so
+//! tvm-ffi-stubgen rust/tvm-tirx/src --target rust --dlls
build/lib/libtvm_tirx_compiler.so
//! ```
//!
//! # Tests
diff --git a/rust/src/macro.rs b/rust/tvm-tirx/src/macro.rs
similarity index 100%
rename from rust/src/macro.rs
rename to rust/tvm-tirx/src/macro.rs
diff --git a/rust/src/macro/def_expr_op_overloads.rs
b/rust/tvm-tirx/src/macro/def_expr_op_overloads.rs
similarity index 100%
rename from rust/src/macro/def_expr_op_overloads.rs
rename to rust/tvm-tirx/src/macro/def_expr_op_overloads.rs
diff --git a/rust/src/runtime.rs b/rust/tvm-tirx/src/runtime.rs
similarity index 100%
rename from rust/src/runtime.rs
rename to rust/tvm-tirx/src/runtime.rs
diff --git a/rust/src/script.rs b/rust/tvm-tirx/src/script.rs
similarity index 100%
rename from rust/src/script.rs
rename to rust/tvm-tirx/src/script.rs
diff --git a/rust/src/sym.rs b/rust/tvm-tirx/src/sym.rs
similarity index 100%
rename from rust/src/sym.rs
rename to rust/tvm-tirx/src/sym.rs
diff --git a/rust/src/sym/analyzer.rs b/rust/tvm-tirx/src/sym/analyzer.rs
similarity index 100%
rename from rust/src/sym/analyzer.rs
rename to rust/tvm-tirx/src/sym/analyzer.rs
diff --git a/rust/src/sym/constraint.rs b/rust/tvm-tirx/src/sym/constraint.rs
similarity index 100%
rename from rust/src/sym/constraint.rs
rename to rust/tvm-tirx/src/sym/constraint.rs
diff --git a/rust/src/sym/int_set.rs b/rust/tvm-tirx/src/sym/int_set.rs
similarity index 100%
rename from rust/src/sym/int_set.rs
rename to rust/tvm-tirx/src/sym/int_set.rs
diff --git a/rust/src/sym/iter_affine_map.rs
b/rust/tvm-tirx/src/sym/iter_affine_map.rs
similarity index 100%
rename from rust/src/sym/iter_affine_map.rs
rename to rust/tvm-tirx/src/sym/iter_affine_map.rs
diff --git a/rust/src/target.rs b/rust/tvm-tirx/src/target.rs
similarity index 100%
rename from rust/src/target.rs
rename to rust/tvm-tirx/src/target.rs
diff --git a/rust/src/tirx.rs b/rust/tvm-tirx/src/tirx.rs
similarity index 100%
rename from rust/src/tirx.rs
rename to rust/tvm-tirx/src/tirx.rs
diff --git a/rust/src/tirx/analysis.rs b/rust/tvm-tirx/src/tirx/analysis.rs
similarity index 100%
rename from rust/src/tirx/analysis.rs
rename to rust/tvm-tirx/src/tirx/analysis.rs
diff --git a/rust/src/tirx/analysis/analysis.rs
b/rust/tvm-tirx/src/tirx/analysis/analysis.rs
similarity index 100%
rename from rust/src/tirx/analysis/analysis.rs
rename to rust/tvm-tirx/src/tirx/analysis/analysis.rs
diff --git a/rust/src/tirx/function.rs b/rust/tvm-tirx/src/tirx/function.rs
similarity index 100%
rename from rust/src/tirx/function.rs
rename to rust/tvm-tirx/src/tirx/function.rs
diff --git a/rust/src/tirx/index_map.rs b/rust/tvm-tirx/src/tirx/index_map.rs
similarity index 100%
rename from rust/src/tirx/index_map.rs
rename to rust/tvm-tirx/src/tirx/index_map.rs
diff --git a/rust/src/tirx/layout.rs b/rust/tvm-tirx/src/tirx/layout.rs
similarity index 100%
rename from rust/src/tirx/layout.rs
rename to rust/tvm-tirx/src/tirx/layout.rs
diff --git a/rust/src/tirx/op.rs b/rust/tvm-tirx/src/tirx/op.rs
similarity index 100%
rename from rust/src/tirx/op.rs
rename to rust/tvm-tirx/src/tirx/op.rs
diff --git a/rust/src/tirx/op_attr.rs b/rust/tvm-tirx/src/tirx/op_attr.rs
similarity index 100%
rename from rust/src/tirx/op_attr.rs
rename to rust/tvm-tirx/src/tirx/op_attr.rs
diff --git a/rust/src/tirx/structural.rs b/rust/tvm-tirx/src/tirx/structural.rs
similarity index 100%
rename from rust/src/tirx/structural.rs
rename to rust/tvm-tirx/src/tirx/structural.rs
diff --git a/rust/src/tirx/structural_map_with_constraint_context.rs
b/rust/tvm-tirx/src/tirx/structural_map_with_constraint_context.rs
similarity index 100%
rename from rust/src/tirx/structural_map_with_constraint_context.rs
rename to rust/tvm-tirx/src/tirx/structural_map_with_constraint_context.rs
diff --git a/rust/src/tirx/structural_mutate_with_constraint_context.rs
b/rust/tvm-tirx/src/tirx/structural_mutate_with_constraint_context.rs
similarity index 100%
rename from rust/src/tirx/structural_mutate_with_constraint_context.rs
rename to rust/tvm-tirx/src/tirx/structural_mutate_with_constraint_context.rs
diff --git a/rust/src/tirx/structural_visit_with_constraint_context.rs
b/rust/tvm-tirx/src/tirx/structural_visit_with_constraint_context.rs
similarity index 100%
rename from rust/src/tirx/structural_visit_with_constraint_context.rs
rename to rust/tvm-tirx/src/tirx/structural_visit_with_constraint_context.rs
diff --git a/rust/src/tirx/structural_walk_with_constraint_context.rs
b/rust/tvm-tirx/src/tirx/structural_walk_with_constraint_context.rs
similarity index 100%
rename from rust/src/tirx/structural_walk_with_constraint_context.rs
rename to rust/tvm-tirx/src/tirx/structural_walk_with_constraint_context.rs
diff --git a/rust/src/tirx/tensor.rs b/rust/tvm-tirx/src/tirx/tensor.rs
similarity index 100%
rename from rust/src/tirx/tensor.rs
rename to rust/tvm-tirx/src/tirx/tensor.rs
diff --git a/rust/src/tirx/thread_scope.rs
b/rust/tvm-tirx/src/tirx/thread_scope.rs
similarity index 100%
rename from rust/src/tirx/thread_scope.rs
rename to rust/tvm-tirx/src/tirx/thread_scope.rs
diff --git a/rust/src/tirx/tile.rs b/rust/tvm-tirx/src/tirx/tile.rs
similarity index 100%
rename from rust/src/tirx/tile.rs
rename to rust/tvm-tirx/src/tirx/tile.rs
diff --git a/rust/src/tirx/tile/dispatch.rs
b/rust/tvm-tirx/src/tirx/tile/dispatch.rs
similarity index 100%
rename from rust/src/tirx/tile/dispatch.rs
rename to rust/tvm-tirx/src/tirx/tile/dispatch.rs
diff --git a/rust/src/tirx/tile/instruction.rs
b/rust/tvm-tirx/src/tirx/tile/instruction.rs
similarity index 100%
rename from rust/src/tirx/tile/instruction.rs
rename to rust/tvm-tirx/src/tirx/tile/instruction.rs
diff --git a/rust/src/tirx/transform.rs b/rust/tvm-tirx/src/tirx/transform.rs
similarity index 100%
rename from rust/src/tirx/transform.rs
rename to rust/tvm-tirx/src/tirx/transform.rs
diff --git a/rust/src/tirx/transform/function_pass.rs
b/rust/tvm-tirx/src/tirx/transform/function_pass.rs
similarity index 100%
rename from rust/src/tirx/transform/function_pass.rs
rename to rust/tvm-tirx/src/tirx/transform/function_pass.rs
diff --git a/rust/src/tirx/transform/transform.rs
b/rust/tvm-tirx/src/tirx/transform/transform.rs
similarity index 100%
rename from rust/src/tirx/transform/transform.rs
rename to rust/tvm-tirx/src/tirx/transform/transform.rs
diff --git a/rust/src/tirx/type.rs b/rust/tvm-tirx/src/tirx/type.rs
similarity index 100%
rename from rust/src/tirx/type.rs
rename to rust/tvm-tirx/src/tirx/type.rs
diff --git a/rust/tests/codegen/llvm.rs b/rust/tvm-tirx/tests/codegen/llvm.rs
similarity index 100%
rename from rust/tests/codegen/llvm.rs
rename to rust/tvm-tirx/tests/codegen/llvm.rs
diff --git a/rust/tests/codegen/main.rs b/rust/tvm-tirx/tests/codegen/main.rs
similarity index 100%
rename from rust/tests/codegen/main.rs
rename to rust/tvm-tirx/tests/codegen/main.rs
diff --git a/rust/tests/common/mod.rs b/rust/tvm-tirx/tests/common/mod.rs
similarity index 100%
rename from rust/tests/common/mod.rs
rename to rust/tvm-tirx/tests/common/mod.rs
diff --git a/rust/tests/ir/expr.rs b/rust/tvm-tirx/tests/ir/expr.rs
similarity index 100%
rename from rust/tests/ir/expr.rs
rename to rust/tvm-tirx/tests/ir/expr.rs
diff --git a/rust/tests/ir/function.rs b/rust/tvm-tirx/tests/ir/function.rs
similarity index 100%
rename from rust/tests/ir/function.rs
rename to rust/tvm-tirx/tests/ir/function.rs
diff --git a/rust/tests/ir/location.rs b/rust/tvm-tirx/tests/ir/location.rs
similarity index 100%
rename from rust/tests/ir/location.rs
rename to rust/tvm-tirx/tests/ir/location.rs
diff --git a/rust/tests/ir/main.rs b/rust/tvm-tirx/tests/ir/main.rs
similarity index 100%
rename from rust/tests/ir/main.rs
rename to rust/tvm-tirx/tests/ir/main.rs
diff --git a/rust/tests/ir/module.rs b/rust/tvm-tirx/tests/ir/module.rs
similarity index 100%
rename from rust/tests/ir/module.rs
rename to rust/tvm-tirx/tests/ir/module.rs
diff --git a/rust/tests/ir/op.rs b/rust/tvm-tirx/tests/ir/op.rs
similarity index 100%
rename from rust/tests/ir/op.rs
rename to rust/tvm-tirx/tests/ir/op.rs
diff --git a/rust/tests/ir/op_def.rs b/rust/tvm-tirx/tests/ir/op_def.rs
similarity index 100%
rename from rust/tests/ir/op_def.rs
rename to rust/tvm-tirx/tests/ir/op_def.rs
diff --git a/rust/tests/ir/prim.rs b/rust/tvm-tirx/tests/ir/prim.rs
similarity index 100%
rename from rust/tests/ir/prim.rs
rename to rust/tvm-tirx/tests/ir/prim.rs
diff --git a/rust/tests/ir/prim/expr.rs b/rust/tvm-tirx/tests/ir/prim/expr.rs
similarity index 100%
rename from rust/tests/ir/prim/expr.rs
rename to rust/tvm-tirx/tests/ir/prim/expr.rs
diff --git a/rust/tests/ir/prim/op.rs b/rust/tvm-tirx/tests/ir/prim/op.rs
similarity index 100%
rename from rust/tests/ir/prim/op.rs
rename to rust/tvm-tirx/tests/ir/prim/op.rs
diff --git a/rust/tests/ir/prim/vector_expr.rs
b/rust/tvm-tirx/tests/ir/prim/vector_expr.rs
similarity index 100%
rename from rust/tests/ir/prim/vector_expr.rs
rename to rust/tvm-tirx/tests/ir/prim/vector_expr.rs
diff --git a/rust/tests/ir/stmt.rs b/rust/tvm-tirx/tests/ir/stmt.rs
similarity index 100%
rename from rust/tests/ir/stmt.rs
rename to rust/tvm-tirx/tests/ir/stmt.rs
diff --git a/rust/tests/ir/transform.rs b/rust/tvm-tirx/tests/ir/transform.rs
similarity index 100%
rename from rust/tests/ir/transform.rs
rename to rust/tvm-tirx/tests/ir/transform.rs
diff --git a/rust/tests/ir/transform/core.rs
b/rust/tvm-tirx/tests/ir/transform/core.rs
similarity index 100%
rename from rust/tests/ir/transform/core.rs
rename to rust/tvm-tirx/tests/ir/transform/core.rs
diff --git a/rust/tests/ir/transform/instrument.rs
b/rust/tvm-tirx/tests/ir/transform/instrument.rs
similarity index 100%
rename from rust/tests/ir/transform/instrument.rs
rename to rust/tvm-tirx/tests/ir/transform/instrument.rs
diff --git a/rust/tests/ir/type.rs b/rust/tvm-tirx/tests/ir/type.rs
similarity index 100%
rename from rust/tests/ir/type.rs
rename to rust/tvm-tirx/tests/ir/type.rs
diff --git a/rust/tests/ir/unique_name_supply.rs
b/rust/tvm-tirx/tests/ir/unique_name_supply.rs
similarity index 100%
rename from rust/tests/ir/unique_name_supply.rs
rename to rust/tvm-tirx/tests/ir/unique_name_supply.rs
diff --git a/rust/tests/runtime/main.rs b/rust/tvm-tirx/tests/runtime/main.rs
similarity index 100%
rename from rust/tests/runtime/main.rs
rename to rust/tvm-tirx/tests/runtime/main.rs
diff --git a/rust/tests/script/main.rs b/rust/tvm-tirx/tests/script/main.rs
similarity index 100%
rename from rust/tests/script/main.rs
rename to rust/tvm-tirx/tests/script/main.rs
diff --git a/rust/tests/sym/analyzer.rs b/rust/tvm-tirx/tests/sym/analyzer.rs
similarity index 100%
rename from rust/tests/sym/analyzer.rs
rename to rust/tvm-tirx/tests/sym/analyzer.rs
diff --git a/rust/tests/sym/int_set.rs b/rust/tvm-tirx/tests/sym/int_set.rs
similarity index 100%
rename from rust/tests/sym/int_set.rs
rename to rust/tvm-tirx/tests/sym/int_set.rs
diff --git a/rust/tests/sym/iter_affine_map.rs
b/rust/tvm-tirx/tests/sym/iter_affine_map.rs
similarity index 100%
rename from rust/tests/sym/iter_affine_map.rs
rename to rust/tvm-tirx/tests/sym/iter_affine_map.rs
diff --git a/rust/tests/sym/main.rs b/rust/tvm-tirx/tests/sym/main.rs
similarity index 100%
rename from rust/tests/sym/main.rs
rename to rust/tvm-tirx/tests/sym/main.rs
diff --git a/rust/tests/target/main.rs b/rust/tvm-tirx/tests/target/main.rs
similarity index 100%
rename from rust/tests/target/main.rs
rename to rust/tvm-tirx/tests/target/main.rs
diff --git a/rust/tests/tirx/analysis.rs b/rust/tvm-tirx/tests/tirx/analysis.rs
similarity index 100%
rename from rust/tests/tirx/analysis.rs
rename to rust/tvm-tirx/tests/tirx/analysis.rs
diff --git a/rust/tests/tirx/analysis/analysis.rs
b/rust/tvm-tirx/tests/tirx/analysis/analysis.rs
similarity index 100%
rename from rust/tests/tirx/analysis/analysis.rs
rename to rust/tvm-tirx/tests/tirx/analysis/analysis.rs
diff --git a/rust/tests/tirx/function.rs b/rust/tvm-tirx/tests/tirx/function.rs
similarity index 100%
rename from rust/tests/tirx/function.rs
rename to rust/tvm-tirx/tests/tirx/function.rs
diff --git a/rust/tests/tirx/index_map.rs
b/rust/tvm-tirx/tests/tirx/index_map.rs
similarity index 100%
rename from rust/tests/tirx/index_map.rs
rename to rust/tvm-tirx/tests/tirx/index_map.rs
diff --git a/rust/tests/tirx/layout.rs b/rust/tvm-tirx/tests/tirx/layout.rs
similarity index 100%
rename from rust/tests/tirx/layout.rs
rename to rust/tvm-tirx/tests/tirx/layout.rs
diff --git a/rust/tests/tirx/main.rs b/rust/tvm-tirx/tests/tirx/main.rs
similarity index 100%
rename from rust/tests/tirx/main.rs
rename to rust/tvm-tirx/tests/tirx/main.rs
diff --git a/rust/tests/tirx/op.rs b/rust/tvm-tirx/tests/tirx/op.rs
similarity index 100%
rename from rust/tests/tirx/op.rs
rename to rust/tvm-tirx/tests/tirx/op.rs
diff --git a/rust/tests/tirx/structural_map_with_constraint_context.rs
b/rust/tvm-tirx/tests/tirx/structural_map_with_constraint_context.rs
similarity index 100%
rename from rust/tests/tirx/structural_map_with_constraint_context.rs
rename to rust/tvm-tirx/tests/tirx/structural_map_with_constraint_context.rs
diff --git a/rust/tests/tirx/structural_mutate_with_constraint_context.rs
b/rust/tvm-tirx/tests/tirx/structural_mutate_with_constraint_context.rs
similarity index 100%
rename from rust/tests/tirx/structural_mutate_with_constraint_context.rs
rename to rust/tvm-tirx/tests/tirx/structural_mutate_with_constraint_context.rs
diff --git a/rust/tests/tirx/structural_visit_with_constraint_context.rs
b/rust/tvm-tirx/tests/tirx/structural_visit_with_constraint_context.rs
similarity index 100%
rename from rust/tests/tirx/structural_visit_with_constraint_context.rs
rename to rust/tvm-tirx/tests/tirx/structural_visit_with_constraint_context.rs
diff --git a/rust/tests/tirx/structural_walk_with_constraint_context.rs
b/rust/tvm-tirx/tests/tirx/structural_walk_with_constraint_context.rs
similarity index 100%
rename from rust/tests/tirx/structural_walk_with_constraint_context.rs
rename to rust/tvm-tirx/tests/tirx/structural_walk_with_constraint_context.rs
diff --git a/rust/tests/tirx/tensor.rs b/rust/tvm-tirx/tests/tirx/tensor.rs
similarity index 100%
rename from rust/tests/tirx/tensor.rs
rename to rust/tvm-tirx/tests/tirx/tensor.rs
diff --git a/rust/tests/tirx/thread_scope.rs
b/rust/tvm-tirx/tests/tirx/thread_scope.rs
similarity index 100%
rename from rust/tests/tirx/thread_scope.rs
rename to rust/tvm-tirx/tests/tirx/thread_scope.rs
diff --git a/rust/tests/tirx/tile.rs b/rust/tvm-tirx/tests/tirx/tile.rs
similarity index 100%
rename from rust/tests/tirx/tile.rs
rename to rust/tvm-tirx/tests/tirx/tile.rs
diff --git a/rust/tests/tirx/tile/dispatch.rs
b/rust/tvm-tirx/tests/tirx/tile/dispatch.rs
similarity index 100%
rename from rust/tests/tirx/tile/dispatch.rs
rename to rust/tvm-tirx/tests/tirx/tile/dispatch.rs
diff --git a/rust/tests/tirx/tile/instruction.rs
b/rust/tvm-tirx/tests/tirx/tile/instruction.rs
similarity index 100%
rename from rust/tests/tirx/tile/instruction.rs
rename to rust/tvm-tirx/tests/tirx/tile/instruction.rs
diff --git a/rust/tests/tirx/transform.rs
b/rust/tvm-tirx/tests/tirx/transform.rs
similarity index 100%
rename from rust/tests/tirx/transform.rs
rename to rust/tvm-tirx/tests/tirx/transform.rs
diff --git a/rust/tests/tirx/transform/function_pass.rs
b/rust/tvm-tirx/tests/tirx/transform/function_pass.rs
similarity index 100%
rename from rust/tests/tirx/transform/function_pass.rs
rename to rust/tvm-tirx/tests/tirx/transform/function_pass.rs
diff --git a/rust/tests/tirx/transform/transform.rs
b/rust/tvm-tirx/tests/tirx/transform/transform.rs
similarity index 100%
rename from rust/tests/tirx/transform/transform.rs
rename to rust/tvm-tirx/tests/tirx/transform/transform.rs
diff --git a/tests/python/ir/test_op_rust.py b/tests/python/ir/test_op_rust.py
index 0d129139e..bf52b81b7 100644
--- a/tests/python/ir/test_op_rust.py
+++ b/tests/python/ir/test_op_rust.py
@@ -16,7 +16,7 @@
# under the License.
"""Operators defined in Rust are registered when their library loads, as C++
ones are.
-``rust/examples/define_ir.rs`` is built by cargo into a library of its own,
which a fresh
+``rust/tvm-tirx/examples/define_ir.rs`` is built by cargo into a library of
its own, which a fresh
interpreter loads, as ``import tvm_tirx`` loads libtvm_tirx_rust, and then
uses its operators as it
uses C++ ones: registering them also gives them their TVMScript builders. Its
type is registered
with them. A copy of the library is a second library with the same blocks, as
libraries that link
@@ -42,7 +42,7 @@ EXTENSION_DIR = RUST_DIR.parent / "examples" /
"extension_guides"
def find_cargo():
"""A cargo as new as the crate's rust-version, rustup's first, as the
CMake build looks."""
- manifest = (RUST_DIR / "Cargo.toml").read_text()
+ manifest = (RUST_DIR / "tvm-tirx" / "Cargo.toml").read_text()
needed = re.search(r'^rust-version *= *"([0-9.]+)"', manifest,
re.M).group(1)
needed = tuple(int(part) for part in needed.split("."))
homes = [Path(os.environ["CARGO_HOME"])] if "CARGO_HOME" in os.environ
else []
@@ -79,7 +79,7 @@ def library_name(name):
def build_rust_example(example):
"""Build an example library of Rust operators and types with cargo."""
- debug_dir = cargo_build(RUST_DIR / "Cargo.toml", "--example", example)
+ debug_dir = cargo_build(RUST_DIR / "tvm-tirx" / "Cargo.toml", "--example",
example)
return debug_dir / "examples" / library_name(example)
diff --git a/tests/scripts/task_build_cpu.sh b/tests/scripts/task_build_cpu.sh
index 216db8a81..b2931cbab 100755
--- a/tests/scripts/task_build_cpu.sh
+++ b/tests/scripts/task_build_cpu.sh
@@ -33,4 +33,4 @@ uv build --wheel --no-build-isolation --offline --out-dir
dist .
PATH="$PWD/build/rust/bin:$PATH" ./tests/scripts/task_rust_unittest.sh
# The bindings that tvm-ffi-stubgen generates in rust/ must match the types of
this build.
-uv run --no-sync python -m tvm_ffi.stub.cli rust/src --target rust --dlls
build/lib/libtvm_tirx_compiler.so --check
+uv run --no-sync python -m tvm_ffi.stub.cli rust/tvm-tirx/src --target rust
--dlls build/lib/libtvm_tirx_compiler.so --check
diff --git a/tests/scripts/task_build_gpu.sh b/tests/scripts/task_build_gpu.sh
index 8dcdbb794..4c23f1e8c 100755
--- a/tests/scripts/task_build_gpu.sh
+++ b/tests/scripts/task_build_gpu.sh
@@ -34,4 +34,4 @@ uv build --wheel --no-build-isolation --offline --out-dir
dist .
./build/tirx_cpptest
# The generated Rust bindings must match the types of this build.
-uv run --no-sync python -m tvm_ffi.stub.cli rust/src --target rust --dlls
build/lib/libtvm_tirx_compiler.so --check
+uv run --no-sync python -m tvm_ffi.stub.cli rust/tvm-tirx/src --target rust
--dlls build/lib/libtvm_tirx_compiler.so --check
diff --git a/tests/scripts/task_install_rust.sh
b/tests/scripts/task_install_rust.sh
index 8144069b8..0dab09a04 100755
--- a/tests/scripts/task_install_rust.sh
+++ b/tests/scripts/task_install_rust.sh
@@ -23,7 +23,7 @@ set -euxo pipefail
export RUSTUP_HOME="$PWD/.local/rustup" CARGO_HOME="$PWD/.local/cargo"
curl --proto '=https' --tlsv1.2 --retry 3 -sSf https://sh.rustup.rs | sh -s --
-y -q \
--no-modify-path --profile minimal \
- --default-toolchain "${1:-$(sed -n 's/^rust-version = "\(.*\)"$/\1/p'
rust/Cargo.toml)}"
+ --default-toolchain "${1:-$(sed -n 's/^rust-version = "\(.*\)"$/\1/p'
rust/tvm-tirx/Cargo.toml)}"
export PATH="$CARGO_HOME/bin:$PATH"
# rustc links with the cc first on PATH, which in the CI images is a wrapper
of sccache: link with