This is an automated email from the ASF dual-hosted git repository.
areusch pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 55864b2 [Rust] Restore the Rust CI testing after Docker image update
(#8657)
55864b2 is described below
commit 55864b2cae4b7e8e897571ace627afd7974c9f53
Author: Jared Roesch <[email protected]>
AuthorDate: Tue Aug 10 16:49:08 2021 -0700
[Rust] Restore the Rust CI testing after Docker image update (#8657)
* Fix Rust CI
* Turn Rust CI back on
---
Jenkinsfile | 2 +-
rust/tvm-graph-rt/src/allocator.rs | 4 ++--
rust/tvm-graph-rt/src/array.rs | 4 ++--
rust/tvm-graph-rt/src/graph.rs | 2 +-
rust/tvm-graph-rt/src/workspace.rs | 6 +++---
rust/tvm-graph-rt/tests/test_graph_serde.rs | 2 +-
tests/scripts/task_rust.sh | 7 ++++++-
7 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/Jenkinsfile b/Jenkinsfile
index 766f2e2..13ab9e0 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -188,7 +188,7 @@ stage('Build') {
sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh"
// sh "${docker_run} ${ci_cpu} ./tests/scripts/task_golang.sh"
// TODO(@jroesch): need to resolve CI issue will turn back on in
follow up patch
- // sh "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh"
+ sh "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh"
junit "build/pytest-results/*.xml"
}
}
diff --git a/rust/tvm-graph-rt/src/allocator.rs
b/rust/tvm-graph-rt/src/allocator.rs
index 81499af..fe741aa 100644
--- a/rust/tvm-graph-rt/src/allocator.rs
+++ b/rust/tvm-graph-rt/src/allocator.rs
@@ -17,7 +17,7 @@
* under the License.
*/
-use std::alloc::{self, Layout, LayoutErr};
+use std::alloc::{self, Layout, LayoutError};
const DEFAULT_ALIGN_BYTES: usize = 4;
@@ -29,7 +29,7 @@ pub struct Allocation {
impl Allocation {
/// Allocates a chunk of memory of `size` bytes with optional alignment.
- pub fn new(size: usize, align: Option<usize>) -> Result<Self, LayoutErr> {
+ pub fn new(size: usize, align: Option<usize>) -> Result<Self, LayoutError>
{
let alignment = align.unwrap_or(DEFAULT_ALIGN_BYTES);
let layout = Layout::from_size_align(size, alignment)?;
let ptr = unsafe { alloc::alloc(layout) };
diff --git a/rust/tvm-graph-rt/src/array.rs b/rust/tvm-graph-rt/src/array.rs
index 8ae716a..1a8ff81 100644
--- a/rust/tvm-graph-rt/src/array.rs
+++ b/rust/tvm-graph-rt/src/array.rs
@@ -24,7 +24,7 @@ use tvm_sys::{ffi::DLTensor, DataType, Device};
use crate::allocator::Allocation;
use crate::errors::ArrayError;
-use std::alloc::LayoutErr;
+use std::alloc::LayoutError;
/// A `Storage` is a container which holds `Tensor` data.
#[derive(PartialEq)]
@@ -37,7 +37,7 @@ pub enum Storage<'a> {
}
impl<'a> Storage<'a> {
- pub fn new(size: usize, align: Option<usize>) -> Result<Storage<'static>,
LayoutErr> {
+ pub fn new(size: usize, align: Option<usize>) -> Result<Storage<'static>,
LayoutError> {
Ok(Storage::Owned(Allocation::new(size, align)?))
}
diff --git a/rust/tvm-graph-rt/src/graph.rs b/rust/tvm-graph-rt/src/graph.rs
index de2e7dd..058e55b 100644
--- a/rust/tvm-graph-rt/src/graph.rs
+++ b/rust/tvm-graph-rt/src/graph.rs
@@ -233,7 +233,7 @@ impl<'m, 't> GraphExecutor<'m, 't> {
let mut storages: Vec<Storage> = storage_num_bytes
.into_iter()
.map(|nbytes| Storage::new(nbytes, align))
- .collect::<Result<Vec<Storage>, std::alloc::LayoutErr>>()?;
+ .collect::<Result<Vec<Storage>, std::alloc::LayoutError>>()?;
let tensors = izip!(storage_ids, shapes, dtypes)
.map(|(storage_id, shape, dtype)| {
diff --git a/rust/tvm-graph-rt/src/workspace.rs
b/rust/tvm-graph-rt/src/workspace.rs
index cf26497..82bbfdd 100644
--- a/rust/tvm-graph-rt/src/workspace.rs
+++ b/rust/tvm-graph-rt/src/workspace.rs
@@ -26,7 +26,7 @@ use std::{
use crate::allocator::Allocation;
use crate::errors::InvalidPointer;
-use std::alloc::LayoutErr;
+use std::alloc::LayoutError;
const WS_ALIGN: usize = 64; // taken from `kTempAllocaAlignment` in
`device_api.h`
@@ -50,13 +50,13 @@ impl WorkspacePool {
}
}
- fn alloc_new(&mut self, size: usize) -> Result<*mut u8, LayoutErr> {
+ fn alloc_new(&mut self, size: usize) -> Result<*mut u8, LayoutError> {
self.workspaces.push(Allocation::new(size, Some(WS_ALIGN))?);
self.in_use.push(self.workspaces.len() - 1);
Ok(self.workspaces[self.workspaces.len() - 1].as_mut_ptr())
}
- fn alloc(&mut self, size: usize) -> Result<*mut u8, LayoutErr> {
+ fn alloc(&mut self, size: usize) -> Result<*mut u8, LayoutError> {
if self.free.is_empty() {
return self.alloc_new(size);
}
diff --git a/rust/tvm-graph-rt/tests/test_graph_serde.rs
b/rust/tvm-graph-rt/tests/test_graph_serde.rs
index 7d8e867..aaa33ef 100644
--- a/rust/tvm-graph-rt/tests/test_graph_serde.rs
+++ b/rust/tvm-graph-rt/tests/test_graph_serde.rs
@@ -64,7 +64,7 @@ fn test_load_graph() {
.unwrap()
.get("func_name")
.unwrap(),
- "fused_nn_dense_nn_bias_add"
+ "tvmgen_default_fused_nn_dense_nn_bias_add"
);
assert_eq!(graph.nodes[3].inputs[0].index, 0);
assert_eq!(graph.nodes[4].inputs[0].index, 0);
diff --git a/tests/scripts/task_rust.sh b/tests/scripts/task_rust.sh
index 9ddd1f2..4b34b6c 100755
--- a/tests/scripts/task_rust.sh
+++ b/tests/scripts/task_rust.sh
@@ -28,12 +28,17 @@ echo "Using PYTHONPATH=$PYTHONPATH"
export RUST_DIR="$TVM_HOME/rust"
echo "Using RUST_DIR=$RUST_DIR"
-
export LLVM_CONFIG_DEFAULT=`which llvm-config-10`
export LLVM_CONFIG_PATH="${LLVM_CONFIG_PATH:-$LLVM_CONFIG_DEFAULT}"
echo "Using LLVM_CONFIG_PATH=$LLVM_CONFIG_PATH"
+TVM_RUSTC_VERSION=`rustc --version`
+echo "Using TVM_RUSTC_VERSION=$TVM_RUSTC_VERSION"
+
+TVM_CARGO_VERSION=`cargo --version`
+echo "Using TVM_CARGO_VERSION=$TVM_CARGO_VERSION"
+
# to avoid CI CPU thread throttling.
export TVM_BIND_THREADS=0
export OMP_NUM_THREADS=1