You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@teaclave.apache.org by ms...@apache.org on 2021/08/04 03:41:34 UTC

[incubator-teaclave] branch master updated: Add TVM MNIST example (#535)

This is an automated email from the ASF dual-hosted git repository.

mssun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-teaclave.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f53426  Add TVM MNIST example (#535)
5f53426 is described below

commit 5f534263721a99e9aba19a1c4688720c5b34e2cb
Author: Hongbo <12...@users.noreply.github.com>
AuthorDate: Tue Aug 3 23:41:11 2021 -0400

    Add TVM MNIST example (#535)
    
    - Enlarge enclave stack for larger tasks
    - Enlarge WAMR stack and heap for larger tasks
    - Add TVM MNIST example and related tests
---
 .github/workflows/ci.yml                           |   22 +-
 cmake/scripts/test.sh                              |    3 +-
 docker/build.ubuntu-1804.sgx-2.14.Dockerfile       |   14 +
 docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile  |   14 +
 examples/python/wasm_tvm_mnist.py                  |  108 ++
 .../python/wasm_tvm_mnist_payload/.cargo/config    |    3 +
 examples/python/wasm_tvm_mnist_payload/.gitignore  |    1 +
 examples/python/wasm_tvm_mnist_payload/Cargo.lock  | 1934 ++++++++++++++++++++
 examples/python/wasm_tvm_mnist_payload/Cargo.toml  |   38 +
 examples/python/wasm_tvm_mnist_payload/Makefile    |   30 +
 examples/python/wasm_tvm_mnist_payload/build.rs    |   23 +
 .../python/wasm_tvm_mnist_payload/build_lib.py     |  103 ++
 .../python/wasm_tvm_mnist_payload/data/img_10.jpg  |  Bin 0 -> 555 bytes
 examples/python/wasm_tvm_mnist_payload/src/lib.rs  |   85 +
 .../python/wasm_tvm_mnist_payload/src/types.rs     |  208 +++
 .../python/wasm_tvm_mnist_payload/src/utils.rs     |   69 +
 examples/python/wasm_tvm_mnist_payload/test_lib.py |   51 +
 executor/src/wamr.rs                               |   45 +-
 services/execution/enclave/Enclave.config.xml      |    2 +-
 services/management/enclave/Enclave.config.xml     |    2 +-
 services/scheduler/enclave/Enclave.config.xml      |    2 +-
 services/storage/enclave/Enclave.config.xml        |    4 +-
 tests/fixtures/functions/wamr_tvm_mnist/img_10.jpg |  Bin 0 -> 555 bytes
 .../functions/wamr_tvm_mnist/img_10.jpg.enc        |  Bin 0 -> 4096 bytes
 tests/fixtures/functions/wamr_tvm_mnist/mnist.wasm |  Bin 0 -> 1126160 bytes
 25 files changed, 2747 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 6d54178..60452aa 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -28,7 +28,7 @@ jobs:
           cd sdk/swift/TeaclaveClientSDK && xcodebuild -scheme TeaclaveClientSDK
   sim-debug-ubuntu-1804:
     runs-on: ubuntu-18.04
-    container: teaclave/teaclave-build-ubuntu-1804-sgx-2.14:0.1.0
+    container: teaclave/teaclave-build-ubuntu-1804-sgx-2.14:0.1.1
     steps:
       - uses: actions/checkout@v2
       - name: Setting up $HOME
@@ -49,6 +49,22 @@ jobs:
           . ~/.cargo/env &&
           cd build &&
           make VERBOSE=1
+      - name: Prepare TVM example building environment and TVM example
+        run: |
+          git clone https://github.com/apache/tvm /tvm &&
+          cd /tvm &&
+          git checkout df06c5848f59108a8e6e7dffb997b4b659b573a7 &&
+          git submodule init &&
+          git submodule update &&
+          mkdir build &&
+          cd build &&
+          cp ../cmake/config.cmake ./ &&
+          sed -i '/set(USE_LLVM OFF)/c\set(USE_LLVM ON)' config.cmake &&
+          cmake -DUSE_LLVM=ON .. &&
+          make -j4 &&
+          . ~/.cargo/env &&
+          cd ${GITHUB_WORKSPACE}/examples/python/wasm_tvm_mnist_payload &&
+          make
       - name: Run tests and examples
         run: |
           export AS_SPID="00000000000000000000000000000000" &&
@@ -61,7 +77,7 @@ jobs:
 
   format:
     runs-on: ubuntu-18.04
-    container: teaclave/teaclave-build-ubuntu-1804-sgx-2.14:0.1.0
+    container: teaclave/teaclave-build-ubuntu-1804-sgx-2.14:0.1.1
     steps:
       - uses: actions/checkout@v2
       - name: Setting up $HOME
@@ -82,7 +98,7 @@ jobs:
           cd build && make check
   lint:
     runs-on: ubuntu-18.04
-    container: teaclave/teaclave-build-ubuntu-1804-sgx-2.14:0.1.0
+    container: teaclave/teaclave-build-ubuntu-1804-sgx-2.14:0.1.1
     steps:
       - uses: actions/checkout@v2
       - name: Setting up $HOME
diff --git a/cmake/scripts/test.sh b/cmake/scripts/test.sh
index f45926a..6d6c61a 100755
--- a/cmake/scripts/test.sh
+++ b/cmake/scripts/test.sh
@@ -219,7 +219,7 @@ run_examples() {
   sleep 3    # wait for execution services
   popd
 
-  # Generate WASM file for WAMR Rust example21
+  # Generate WASM file for WAMR Rust example
   pushd ${TEACLAVE_PROJECT_ROOT}/examples/python/wasm_rust_psi_payload
   make
   popd
@@ -238,6 +238,7 @@ run_examples() {
   python3 builtin_password_check.py
   python3 wasm_c_simple_add.py
   python3 wasm_rust_psi.py
+  python3 wasm_tvm_mnist.py
   popd
 
   pushd ${TEACLAVE_PROJECT_ROOT}/examples/c
diff --git a/docker/build.ubuntu-1804.sgx-2.14.Dockerfile b/docker/build.ubuntu-1804.sgx-2.14.Dockerfile
index 35f8427..b120fad 100644
--- a/docker/build.ubuntu-1804.sgx-2.14.Dockerfile
+++ b/docker/build.ubuntu-1804.sgx-2.14.Dockerfile
@@ -82,6 +82,20 @@ RUN apt-get update && apt-get install -q -y \
 
 RUN pip3 install pyopenssl toml cryptography yapf requests Pillow
 
+# install TVM dependencies
+RUN apt-get install -q -y \
+    llvm-10 \
+    clang-10 \
+    protobuf-compiler \
+    libprotoc-dev \
+    libtinfo-dev \
+    zlib1g-dev \
+    libedit-dev \
+    libxml2-dev
+
+# TVM Python builder dependencies
+RUN pip3 install onnx==1.9.0 numpy decorator attrs spicy
+
 # clean up apt caches
 
 RUN apt-get clean && \
diff --git a/docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile b/docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile
index 3bb57ad..592c372 100644
--- a/docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile
+++ b/docker/build.ubuntu-1804.sgx-dcap-1.11.Dockerfile
@@ -90,6 +90,20 @@ RUN apt-get update && apt-get install -q -y \
 
 RUN pip3 install pyopenssl toml cryptography yapf requests Pillow
 
+# install TVM dependencies
+RUN apt-get install -q -y \
+    llvm-10 \
+    clang-10 \
+    protobuf-compiler \
+    libprotoc-dev \
+    libtinfo-dev \
+    zlib1g-dev \
+    libedit-dev \
+    libxml2-dev
+
+# TVM Python builder dependencies
+RUN pip3 install onnx==1.9.0 numpy decorator attrs spicy
+
 # clean up apt caches
 
 RUN apt-get clean && \
diff --git a/examples/python/wasm_tvm_mnist.py b/examples/python/wasm_tvm_mnist.py
new file mode 100644
index 0000000..59274e5
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist.py
@@ -0,0 +1,108 @@
+#!/usr/bin/env python3
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import sys
+
+from teaclave import (AuthenticationService, FrontendService, FunctionInput,
+                      DataMap, OwnerList)
+from utils import (AUTHENTICATION_SERVICE_ADDRESS, FRONTEND_SERVICE_ADDRESS,
+                   AS_ROOT_CA_CERT_PATH, ENCLAVE_INFO_PATH, USER_ID,
+                   USER_PASSWORD)
+
+# If you're using `docker-compose` to start the Teaclave server containers,
+# please change `localhost` to `teaclave-file-service`
+INPUT_FILE_URL_PREFIX = "http://localhost:6789/fixtures/functions/wamr_tvm_mnist/"
+INPUT_FILENAME = "img_10.jpg.enc"
+INPUT_URL = INPUT_FILE_URL_PREFIX + INPUT_FILENAME
+INPUT_CMAC = [
+    0xcc, 0x7f, 0xd1, 0xf6, 0x76, 0xd9, 0x3c, 0xfa, 0x52, 0x63, 0x3a, 0x25,
+    0xd8, 0x1c, 0xee, 0x74
+]
+INPUT_KEY = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
+USER_ID = "user_mnist"
+USER_PASSWORD = "password_mnist"
+PAYLOAD_FILE = "wasm_tvm_mnist_payload/target/wasm32-unknown-unknown/release/mnist.wasm"
+
+
+def main():
+
+    client = AuthenticationService(AUTHENTICATION_SERVICE_ADDRESS,
+                                   AS_ROOT_CA_CERT_PATH,
+                                   ENCLAVE_INFO_PATH).connect().get_client()
+
+    print(f"[+] {USER_ID} registering user")
+    client.user_register(USER_ID, USER_PASSWORD)
+
+    print(f"[+] {USER_ID} login")
+    token = client.user_login(USER_ID, USER_PASSWORD)
+
+    client = FrontendService(FRONTEND_SERVICE_ADDRESS, AS_ROOT_CA_CERT_PATH,
+                             ENCLAVE_INFO_PATH).connect().get_client()
+    metadata = {"id": USER_ID, "token": token}
+    client.metadata = metadata
+
+    print(f"[+] {USER_ID} registering function")
+
+    with open(PAYLOAD_FILE, "rb") as f:
+        payload = f.read()
+
+    function_id = client.register_function(
+        name="wasm-tvm-mnist",
+        description="WAMR TVM MNIST Prediction",
+        payload=list(payload),
+        executor_type="wamr",
+        arguments=["input_img"],
+        inputs=[
+            FunctionInput("input_img",
+                          "Input image for handwriting number perdiction")
+        ],
+        outputs=[])
+
+    print(f"[+] {USER_ID} creating task")
+    task_id = client.create_task(
+        function_id=function_id,
+        function_arguments=({
+            "input_img": "input_img",
+        }),
+        executor="wamr",
+        inputs_ownership=[OwnerList("input_img", [USER_ID])],
+        outputs_ownership=[])
+
+    print(f"[+] {USER_ID} registering input file")
+    schema = "teaclave-file-128"
+    input_id = client.register_input_file(INPUT_URL, schema, INPUT_KEY, [],
+                                          INPUT_CMAC)
+
+    print(f"[+] {USER_ID} assigning data to task")
+    client.assign_data_to_task(task_id, [DataMap("input_img", input_id)], [])
+
+    print(f"[+] {USER_ID} approving task")
+    client.approve_task(task_id)
+
+    print(f"[+] {USER_ID} invoking task")
+    client.invoke_task(task_id)
+
+    print(f"[+] {USER_ID} getting task result")
+    result = client.get_task_result(task_id)
+
+    print("[+] User result: " + bytes(result).decode("utf-8"))
+
+
+if __name__ == '__main__':
+    main()
diff --git a/examples/python/wasm_tvm_mnist_payload/.cargo/config b/examples/python/wasm_tvm_mnist_payload/.cargo/config
new file mode 100644
index 0000000..c0f4de2
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/.cargo/config
@@ -0,0 +1,3 @@
+[build]
+target = "wasm32-unknown-unknown"
+rustflags = ["-C", "link-arg=--whole-archive", "-C", "link-arg=-lgraph_wasm32"]
diff --git a/examples/python/wasm_tvm_mnist_payload/.gitignore b/examples/python/wasm_tvm_mnist_payload/.gitignore
new file mode 100644
index 0000000..edad5fc
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/.gitignore
@@ -0,0 +1 @@
+/outlib
\ No newline at end of file
diff --git a/examples/python/wasm_tvm_mnist_payload/Cargo.lock b/examples/python/wasm_tvm_mnist_payload/Cargo.lock
new file mode 100644
index 0000000..66f4e27
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/Cargo.lock
@@ -0,0 +1,1934 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "adler32"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
+
+[[package]]
+name = "ansi_term"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "ansi_term"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "anyhow"
+version = "1.0.42"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486"
+
+[[package]]
+name = "arrayvec"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
+
+[[package]]
+name = "atty"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
+dependencies = [
+ "hermit-abi",
+ "libc",
+ "winapi",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
+
+[[package]]
+name = "bindgen"
+version = "0.57.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd4865004a46a0aafb2a0a5eb19d3c9fc46ee5f063a6cfc605c69ac9ecf5263d"
+dependencies = [
+ "bitflags",
+ "cexpr",
+ "clang-sys",
+ "lazy_static",
+ "lazycell",
+ "peeking_take_while",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "regex",
+ "rustc-hash",
+ "shlex",
+]
+
+[[package]]
+name = "bitflags"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
+
+[[package]]
+name = "bstr"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d"
+dependencies = [
+ "lazy_static",
+ "memchr",
+ "regex-automata",
+ "serde",
+]
+
+[[package]]
+name = "byteorder"
+version = "1.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
+
+[[package]]
+name = "cc"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
+dependencies = [
+ "jobserver",
+]
+
+[[package]]
+name = "cexpr"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27"
+dependencies = [
+ "nom",
+]
+
+[[package]]
+name = "cfg-if"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "chrono"
+version = "0.4.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
+dependencies = [
+ "libc",
+ "num-integer",
+ "num-traits",
+ "winapi",
+]
+
+[[package]]
+name = "clang-sys"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c"
+dependencies = [
+ "glob",
+ "libc",
+ "libloading 0.7.0",
+]
+
+[[package]]
+name = "clap"
+version = "2.33.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
+dependencies = [
+ "ansi_term 0.11.0",
+ "atty",
+ "bitflags",
+ "strsim",
+ "textwrap",
+ "unicode-width",
+ "vec_map",
+]
+
+[[package]]
+name = "cmake"
+version = "0.1.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855"
+dependencies = [
+ "cc",
+]
+
+[[package]]
+name = "color_quant"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
+
+[[package]]
+name = "core-foundation"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171"
+dependencies = [
+ "core-foundation-sys",
+ "libc",
+]
+
+[[package]]
+name = "core-foundation-sys"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac"
+
+[[package]]
+name = "crossbeam-channel"
+version = "0.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87"
+dependencies = [
+ "crossbeam-utils 0.7.2",
+ "maybe-uninit",
+]
+
+[[package]]
+name = "crossbeam-channel"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4"
+dependencies = [
+ "cfg-if 1.0.0",
+ "crossbeam-utils 0.8.5",
+]
+
+[[package]]
+name = "crossbeam-deque"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
+dependencies = [
+ "cfg-if 1.0.0",
+ "crossbeam-epoch",
+ "crossbeam-utils 0.8.5",
+]
+
+[[package]]
+name = "crossbeam-epoch"
+version = "0.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
+dependencies = [
+ "cfg-if 1.0.0",
+ "crossbeam-utils 0.8.5",
+ "lazy_static",
+ "memoffset",
+ "scopeguard",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
+dependencies = [
+ "autocfg",
+ "cfg-if 0.1.10",
+ "lazy_static",
+]
+
+[[package]]
+name = "crossbeam-utils"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"
+dependencies = [
+ "cfg-if 1.0.0",
+ "lazy_static",
+]
+
+[[package]]
+name = "csv"
+version = "1.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1"
+dependencies = [
+ "bstr",
+ "csv-core",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "csv-core"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "darwin-libproc"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9fb90051930c9a0f09e585762152048e23ac74d20c10590ef7cf01c0343c3046"
+dependencies = [
+ "darwin-libproc-sys",
+ "libc",
+ "memchr",
+]
+
+[[package]]
+name = "darwin-libproc-sys"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57cebb5bde66eecdd30ddc4b9cd208238b15db4982ccc72db59d699ea10867c1"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "deflate"
+version = "0.7.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4"
+dependencies = [
+ "adler32",
+ "byteorder",
+]
+
+[[package]]
+name = "dirs"
+version = "3.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309"
+dependencies = [
+ "dirs-sys",
+]
+
+[[package]]
+name = "dirs-sys"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780"
+dependencies = [
+ "libc",
+ "redox_users",
+ "winapi",
+]
+
+[[package]]
+name = "either"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
+
+[[package]]
+name = "enumn"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e58b112d5099aa0857c5d05f0eacab86406dd8c0f85fe5d320a13256d29ecf4"
+dependencies = [
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "form_urlencoded"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
+dependencies = [
+ "matches",
+ "percent-encoding",
+]
+
+[[package]]
+name = "futures"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-executor",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
+[[package]]
+name = "futures-core"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99"
+
+[[package]]
+name = "futures-executor"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-io"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582"
+
+[[package]]
+name = "futures-macro"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57"
+dependencies = [
+ "autocfg",
+ "proc-macro-hack",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "futures-sink"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53"
+
+[[package]]
+name = "futures-task"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2"
+
+[[package]]
+name = "futures-util"
+version = "0.3.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78"
+dependencies = [
+ "autocfg",
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-macro",
+ "futures-sink",
+ "futures-task",
+ "memchr",
+ "pin-project-lite",
+ "pin-utils",
+ "proc-macro-hack",
+ "proc-macro-nested",
+ "slab",
+]
+
+[[package]]
+name = "getrandom"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "wasi",
+]
+
+[[package]]
+name = "gif"
+version = "0.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "471d90201b3b223f3451cd4ad53e34295f16a1df17b1edf3736d47761c3981af"
+dependencies = [
+ "color_quant",
+ "lzw",
+]
+
+[[package]]
+name = "git2"
+version = "0.13.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9831e983241f8c5591ed53f17d874833e2fa82cac2625f3888c50cbfe136cba"
+dependencies = [
+ "bitflags",
+ "libc",
+ "libgit2-sys",
+ "log",
+ "openssl-probe",
+ "openssl-sys",
+ "url",
+]
+
+[[package]]
+name = "glob"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
+
+[[package]]
+name = "goblin"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d20fd25aa456527ce4f544271ae4fea65d2eda4a6561ea56f39fb3ee4f7e3884"
+dependencies = [
+ "log",
+ "plain",
+ "scroll",
+]
+
+[[package]]
+name = "heck"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
+dependencies = [
+ "unicode-segmentation",
+]
+
+[[package]]
+name = "heim"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4da6d047f03312960babf4d2032a6551bd14b4293b9cba61c17e33e1ef4b652d"
+dependencies = [
+ "heim-common",
+ "heim-cpu",
+ "heim-disk",
+ "heim-host",
+ "heim-memory",
+ "heim-net",
+ "heim-process",
+ "heim-runtime",
+ "heim-sensors",
+ "heim-virt",
+]
+
+[[package]]
+name = "heim-common"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f5a8c66797cb950fdbf6ea1d750f5ffe687e4cb13713fe1f3214d693ffd72a4"
+dependencies = [
+ "cfg-if 0.1.10",
+ "core-foundation",
+ "futures-core",
+ "futures-util",
+ "lazy_static",
+ "libc",
+ "mach",
+ "nix",
+ "pin-utils",
+ "uom",
+ "winapi",
+]
+
+[[package]]
+name = "heim-cpu"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cc191b97ede884083df6d4c0ac47246b86782a0d253d001d7b4610f6ec9cb21f"
+dependencies = [
+ "cfg-if 0.1.10",
+ "heim-common",
+ "heim-runtime",
+ "lazy_static",
+ "libc",
+ "mach",
+ "winapi",
+]
+
+[[package]]
+name = "heim-disk"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "876034f2b6a4360668fded6bb1d787a76acd5d896998a035466c301f0bc98299"
+dependencies = [
+ "bitflags",
+ "cfg-if 0.1.10",
+ "core-foundation",
+ "heim-common",
+ "heim-runtime",
+ "libc",
+ "mach",
+ "widestring",
+ "winapi",
+]
+
+[[package]]
+name = "heim-host"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5e323e5563d38acfba5400a5b6fea252d40fb03c0318844f9c37501d2eda9564"
+dependencies = [
+ "cfg-if 0.1.10",
+ "heim-common",
+ "heim-runtime",
+ "lazy_static",
+ "libc",
+ "mach",
+ "platforms",
+ "winapi",
+]
+
+[[package]]
+name = "heim-memory"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "679781f53236883fe4f26c29c7973cf30fdd1812de7fd15f673dd84027bfe4a3"
+dependencies = [
+ "cfg-if 0.1.10",
+ "heim-common",
+ "heim-runtime",
+ "lazy_static",
+ "libc",
+ "mach",
+ "winapi",
+]
+
+[[package]]
+name = "heim-net"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03cfb3cdf09eee9abe0f01360e3270a45829851c9266dd99ee511b4c621840ea"
+dependencies = [
+ "bitflags",
+ "cfg-if 0.1.10",
+ "heim-common",
+ "heim-runtime",
+ "hex",
+ "libc",
+ "macaddr",
+ "nix",
+]
+
+[[package]]
+name = "heim-process"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "58bc17fe0cb77010de2a2d82f98af1e6be6bcd28ea1f5b10e57658630f6ce77c"
+dependencies = [
+ "cfg-if 0.1.10",
+ "darwin-libproc",
+ "heim-common",
+ "heim-cpu",
+ "heim-host",
+ "heim-net",
+ "heim-runtime",
+ "lazy_static",
+ "libc",
+ "mach",
+ "memchr",
+ "ntapi",
+ "ordered-float",
+ "winapi",
+]
+
+[[package]]
+name = "heim-runtime"
+version = "0.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1504955d04ec7cf8df8bbe541a8636f619450af6f618a6a6111dfecc79743ee5"
+dependencies = [
+ "cfg-if 0.1.10",
+ "futures-channel",
+ "heim-common",
+ "lazy_static",
+ "threadpool",
+]
+
+[[package]]
+name = "heim-sensors"
+version = "0.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "397b856317d361806d1428cabb261188d71d02faaf01463f12637b56ce0c7961"
+dependencies = [
+ "cfg-if 0.1.10",
+ "heim-common",
+ "heim-runtime",
+]
+
+[[package]]
+name = "heim-virt"
+version = "0.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "79e1d9cb9d87a4f8bc8721ae86c00eb2a232853bca969e63ff8f62660493c477"
+dependencies = [
+ "cfg-if 0.1.10",
+ "heim-common",
+ "heim-runtime",
+ "raw-cpuid",
+]
+
+[[package]]
+name = "hermit-abi"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "hex"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e"
+
+[[package]]
+name = "idna"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
+dependencies = [
+ "matches",
+ "unicode-bidi",
+ "unicode-normalization",
+]
+
+[[package]]
+name = "image"
+version = "0.20.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44665b4395d1844c96e7dc8ed5754782a1cdfd9ef458a80bbe45702681450504"
+dependencies = [
+ "byteorder",
+ "gif",
+ "jpeg-decoder",
+ "lzw",
+ "num-iter",
+ "num-rational 0.2.4",
+ "num-traits",
+ "png",
+ "scoped_threadpool",
+ "tiff",
+]
+
+[[package]]
+name = "inflate"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff"
+dependencies = [
+ "adler32",
+]
+
+[[package]]
+name = "itertools"
+version = "0.7.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itertools"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itoa"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
+
+[[package]]
+name = "jobserver"
+version = "0.1.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "jpeg-decoder"
+version = "0.1.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2"
+dependencies = [
+ "rayon",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+
+[[package]]
+name = "lazycell"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
+
+[[package]]
+name = "lexical-core"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe"
+dependencies = [
+ "arrayvec",
+ "bitflags",
+ "cfg-if 1.0.0",
+ "ryu",
+ "static_assertions",
+]
+
+[[package]]
+name = "libc"
+version = "0.2.98"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
+
+[[package]]
+name = "libgit2-sys"
+version = "0.12.21+1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86271bacd72b2b9e854c3dcfb82efd538f15f870e4c11af66900effb462f6825"
+dependencies = [
+ "cc",
+ "libc",
+ "libssh2-sys",
+ "libz-sys",
+ "openssl-sys",
+ "pkg-config",
+]
+
+[[package]]
+name = "libloading"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753"
+dependencies = [
+ "cc",
+ "winapi",
+]
+
+[[package]]
+name = "libloading"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a"
+dependencies = [
+ "cfg-if 1.0.0",
+ "winapi",
+]
+
+[[package]]
+name = "libssh2-sys"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e0186af0d8f171ae6b9c4c90ec51898bad5d08a2d5e470903a50d9ad8959cbee"
+dependencies = [
+ "cc",
+ "libc",
+ "libz-sys",
+ "openssl-sys",
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
+name = "libz-sys"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66"
+dependencies = [
+ "cc",
+ "libc",
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
+name = "log"
+version = "0.4.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
+dependencies = [
+ "cfg-if 1.0.0",
+]
+
+[[package]]
+name = "lzw"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084"
+
+[[package]]
+name = "macaddr"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baee0bbc17ce759db233beb01648088061bf678383130602a298e6998eedb2d8"
+
+[[package]]
+name = "mach"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "matchers"
+version = "0.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1"
+dependencies = [
+ "regex-automata",
+]
+
+[[package]]
+name = "matches"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
+
+[[package]]
+name = "matrixmultiply"
+version = "0.1.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dcad67dcec2d58ff56f6292582377e6921afdf3bfbd533e26fb8900ae575e002"
+dependencies = [
+ "rawpointer",
+]
+
+[[package]]
+name = "maybe-uninit"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
+
+[[package]]
+name = "memchr"
+version = "2.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
+
+[[package]]
+name = "memoffset"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "mnist"
+version = "0.1.0"
+dependencies = [
+ "csv",
+ "image",
+ "lazy_static",
+ "ndarray",
+ "teaclave_context",
+ "tvm-graph-rt",
+ "tvm-sys",
+]
+
+[[package]]
+name = "ndarray"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7cf380a8af901ad627594013a3bbac903ae0a6f94e176e47e46b5bbc1877b928"
+dependencies = [
+ "itertools 0.7.11",
+ "matrixmultiply",
+ "num-complex",
+ "num-traits",
+]
+
+[[package]]
+name = "nix"
+version = "0.17.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363"
+dependencies = [
+ "bitflags",
+ "cc",
+ "cfg-if 0.1.10",
+ "libc",
+ "void",
+]
+
+[[package]]
+name = "nom"
+version = "5.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
+dependencies = [
+ "lexical-core",
+ "memchr",
+ "version_check",
+]
+
+[[package]]
+name = "ntapi"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "num-complex"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95"
+dependencies = [
+ "autocfg",
+ "num-traits",
+]
+
+[[package]]
+name = "num-derive"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2"
+dependencies = [
+ "proc-macro2 0.4.30",
+ "quote 0.6.13",
+ "syn 0.15.44",
+]
+
+[[package]]
+name = "num-integer"
+version = "0.1.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
+dependencies = [
+ "autocfg",
+ "num-traits",
+]
+
+[[package]]
+name = "num-iter"
+version = "0.1.42"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "num_cpus"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
+dependencies = [
+ "hermit-abi",
+ "libc",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
+
+[[package]]
+name = "openssl-probe"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"
+
+[[package]]
+name = "openssl-sys"
+version = "0.9.65"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a7907e3bfa08bb85105209cdfcb6c63d109f8f6c1ed6ca318fff5c1853fbc1d"
+dependencies = [
+ "autocfg",
+ "cc",
+ "libc",
+ "pkg-config",
+ "vcpkg",
+]
+
+[[package]]
+name = "ordered-float"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518"
+dependencies = [
+ "num-traits",
+]
+
+[[package]]
+name = "peeking_take_while"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
+
+[[package]]
+name = "percent-encoding"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
+
+[[package]]
+name = "pin-project-lite"
+version = "0.2.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"
+
+[[package]]
+name = "pin-utils"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
+
+[[package]]
+name = "pkg-config"
+version = "0.3.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
+
+[[package]]
+name = "plain"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
+
+[[package]]
+name = "platforms"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e"
+
+[[package]]
+name = "png"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f54b9600d584d3b8a739e1662a595fab051329eff43f20e7d8cc22872962145b"
+dependencies = [
+ "bitflags",
+ "deflate",
+ "inflate",
+ "num-iter",
+]
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "proc-macro-error"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
+dependencies = [
+ "proc-macro-error-attr",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-error-attr"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+dependencies = [
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-hack"
+version = "0.5.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
+
+[[package]]
+name = "proc-macro-nested"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
+
+[[package]]
+name = "proc-macro2"
+version = "0.4.30"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
+dependencies = [
+ "unicode-xid 0.1.0",
+]
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612"
+dependencies = [
+ "unicode-xid 0.2.2",
+]
+
+[[package]]
+name = "quote"
+version = "0.6.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
+dependencies = [
+ "proc-macro2 0.4.30",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
+dependencies = [
+ "proc-macro2 1.0.28",
+]
+
+[[package]]
+name = "rand"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "rand_hc",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
+dependencies = [
+ "getrandom",
+]
+
+[[package]]
+name = "rand_hc"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
+dependencies = [
+ "rand_core",
+]
+
+[[package]]
+name = "raw-cpuid"
+version = "7.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "beb71f708fe39b2c5e98076204c3cc094ee5a4c12c4cdb119a2b72dc34164f41"
+dependencies = [
+ "bitflags",
+ "cc",
+ "rustc_version",
+]
+
+[[package]]
+name = "rawpointer"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ebac11a9d2e11f2af219b8b8d833b76b1ea0e054aa0e8d8e9e4cbde353bdf019"
+
+[[package]]
+name = "rayon"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
+dependencies = [
+ "autocfg",
+ "crossbeam-deque",
+ "either",
+ "rayon-core",
+]
+
+[[package]]
+name = "rayon-core"
+version = "1.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
+dependencies = [
+ "crossbeam-channel 0.5.1",
+ "crossbeam-deque",
+ "crossbeam-utils 0.8.5",
+ "lazy_static",
+ "num_cpus",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.2.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "redox_users"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
+dependencies = [
+ "getrandom",
+ "redox_syscall",
+]
+
+[[package]]
+name = "regex"
+version = "1.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
+dependencies = [
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
+dependencies = [
+ "regex-syntax",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.6.25"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
+
+[[package]]
+name = "remove_dir_all"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "rustc-hash"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
+
+[[package]]
+name = "rustc_version"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
+dependencies = [
+ "semver",
+]
+
+[[package]]
+name = "ryu"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
+
+[[package]]
+name = "scoped_threadpool"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8"
+
+[[package]]
+name = "scopeguard"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
+
+[[package]]
+name = "scroll"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec"
+dependencies = [
+ "scroll_derive",
+]
+
+[[package]]
+name = "scroll_derive"
+version = "0.10.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0"
+dependencies = [
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "semver"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
+dependencies = [
+ "semver-parser",
+]
+
+[[package]]
+name = "semver-parser"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
+
+[[package]]
+name = "serde"
+version = "1.0.127"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.127"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc"
+dependencies = [
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.66"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "sharded-slab"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982"
+dependencies = [
+ "lazy_static",
+]
+
+[[package]]
+name = "shlex"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
+
+[[package]]
+name = "slab"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527"
+
+[[package]]
+name = "smallvec"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
+
+[[package]]
+name = "static_assertions"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
+
+[[package]]
+name = "strsim"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
+
+[[package]]
+name = "structopt"
+version = "0.3.22"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "69b041cdcb67226aca307e6e7be44c8806423d83e018bd662360a93dabce4d71"
+dependencies = [
+ "clap",
+ "lazy_static",
+ "structopt-derive",
+]
+
+[[package]]
+name = "structopt-derive"
+version = "0.4.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7813934aecf5f51a54775e00068c237de98489463968231a51746bbbc03f9c10"
+dependencies = [
+ "heck",
+ "proc-macro-error",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "syn"
+version = "0.15.44"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
+dependencies = [
+ "proc-macro2 0.4.30",
+ "quote 0.6.13",
+ "unicode-xid 0.1.0",
+]
+
+[[package]]
+name = "syn"
+version = "1.0.74"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c"
+dependencies = [
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "unicode-xid 0.2.2",
+]
+
+[[package]]
+name = "teaclave_context"
+version = "0.1.0"
+
+[[package]]
+name = "tempfile"
+version = "3.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "rand",
+ "redox_syscall",
+ "remove_dir_all",
+ "winapi",
+]
+
+[[package]]
+name = "textwrap"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
+dependencies = [
+ "unicode-width",
+]
+
+[[package]]
+name = "thiserror"
+version = "1.0.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2"
+dependencies = [
+ "thiserror-impl",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745"
+dependencies = [
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "thread_local"
+version = "1.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd"
+dependencies = [
+ "once_cell",
+]
+
+[[package]]
+name = "threadpool"
+version = "1.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa"
+dependencies = [
+ "num_cpus",
+]
+
+[[package]]
+name = "tiff"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e4834f28a0330cb9f3f2c87d2649dca723cb33802e2bdcf18da32759fbec7ce"
+dependencies = [
+ "byteorder",
+ "lzw",
+ "num-derive",
+ "num-traits",
+]
+
+[[package]]
+name = "tinyvec"
+version = "1.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "848a1e1181b9f6753b5e96a092749e29b11d19ede67dfbbd6c7dc7e0f49b5338"
+dependencies = [
+ "tinyvec_macros",
+]
+
+[[package]]
+name = "tinyvec_macros"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
+
+[[package]]
+name = "tracing"
+version = "0.1.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
+dependencies = [
+ "cfg-if 1.0.0",
+ "pin-project-lite",
+ "tracing-attributes",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-attributes"
+version = "0.1.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2"
+dependencies = [
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "tracing-core"
+version = "0.1.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052"
+dependencies = [
+ "lazy_static",
+]
+
+[[package]]
+name = "tracing-log"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3"
+dependencies = [
+ "lazy_static",
+ "log",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-serde"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b"
+dependencies = [
+ "serde",
+ "tracing-core",
+]
+
+[[package]]
+name = "tracing-subscriber"
+version = "0.2.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ab69019741fca4d98be3c62d2b75254528b5432233fd8a4d2739fec20278de48"
+dependencies = [
+ "ansi_term 0.12.1",
+ "chrono",
+ "lazy_static",
+ "matchers",
+ "regex",
+ "serde",
+ "serde_json",
+ "sharded-slab",
+ "smallvec",
+ "thread_local",
+ "tracing",
+ "tracing-core",
+ "tracing-log",
+ "tracing-serde",
+]
+
+[[package]]
+name = "tvm-build"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d455ff5208e80e0a968b9445951cfa9d74f63e565b86a5a302bf1e426e9f6ccd"
+dependencies = [
+ "anyhow",
+ "cmake",
+ "dirs",
+ "futures",
+ "git2",
+ "heim",
+ "serde",
+ "serde_json",
+ "structopt",
+ "tempfile",
+ "thiserror",
+ "tracing",
+ "tracing-subscriber",
+]
+
+[[package]]
+name = "tvm-graph-rt"
+version = "0.1.0-alpha"
+dependencies = [
+ "crossbeam-channel 0.4.4",
+ "itertools 0.8.2",
+ "lazy_static",
+ "libloading 0.5.2",
+ "ndarray",
+ "nom",
+ "num_cpus",
+ "serde",
+ "serde_json",
+ "thiserror",
+ "tvm-macros",
+ "tvm-sys",
+]
+
+[[package]]
+name = "tvm-macros"
+version = "0.1.1-alpha"
+dependencies = [
+ "goblin",
+ "proc-macro-error",
+ "proc-macro2 1.0.28",
+ "quote 1.0.9",
+ "syn 1.0.74",
+]
+
+[[package]]
+name = "tvm-sys"
+version = "0.1.1-alpha"
+dependencies = [
+ "anyhow",
+ "bindgen",
+ "enumn",
+ "ndarray",
+ "thiserror",
+ "tvm-build",
+]
+
+[[package]]
+name = "typenum"
+version = "1.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
+
+[[package]]
+name = "unicode-bidi"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0"
+dependencies = [
+ "matches",
+]
+
+[[package]]
+name = "unicode-normalization"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9"
+dependencies = [
+ "tinyvec",
+]
+
+[[package]]
+name = "unicode-segmentation"
+version = "1.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
+
+[[package]]
+name = "unicode-width"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
+
+[[package]]
+name = "unicode-xid"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
+
+[[package]]
+name = "unicode-xid"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
+
+[[package]]
+name = "uom"
+version = "0.30.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e76503e636584f1e10b9b3b9498538279561adcef5412927ba00c2b32c4ce5ed"
+dependencies = [
+ "num-rational 0.3.2",
+ "num-traits",
+ "typenum",
+]
+
+[[package]]
+name = "url"
+version = "2.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
+dependencies = [
+ "form_urlencoded",
+ "idna",
+ "matches",
+ "percent-encoding",
+]
+
+[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
+[[package]]
+name = "vec_map"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
+
+[[package]]
+name = "version_check"
+version = "0.9.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
+
+[[package]]
+name = "void"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
+
+[[package]]
+name = "wasi"
+version = "0.10.2+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
+
+[[package]]
+name = "widestring"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c"
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
diff --git a/examples/python/wasm_tvm_mnist_payload/Cargo.toml b/examples/python/wasm_tvm_mnist_payload/Cargo.toml
new file mode 100644
index 0000000..67cc8c5
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/Cargo.toml
@@ -0,0 +1,38 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+name = "mnist"
+version = "0.1.0"
+edition = "2018"
+license = "Apache-2.0"
+
+[profile.release]
+lto = true
+opt-level = 's'
+
+[lib]
+crate-type = ['cdylib']
+
+[dependencies]
+teaclave_context = {path = "../../../sdk/payload/wasm/teaclave_context/"}
+image = "0.20"
+ndarray = "0.12"
+csv = "1.1"
+tvm-sys = { path = "/tvm/rust/tvm-sys" }
+tvm-graph-rt = { path = "/tvm/rust/tvm-graph-rt" }
+lazy_static = "1.1.1"
diff --git a/examples/python/wasm_tvm_mnist_payload/Makefile b/examples/python/wasm_tvm_mnist_payload/Makefile
new file mode 100644
index 0000000..954a7ef
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/Makefile
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+export TVM_HOME = /tvm
+export PYTHONPATH = $(shell printenv PYTHONPATH):${TVM_HOME}/python
+
+all:
+	@rustup default 1.54
+	@./build_lib.py
+	@rustup +stable target add wasm32-unknown-unknown
+	@cargo +stable build --release
+#	@wasm-gc target/wasm32-unknown-unknown/release/mnist.wasm
+
+clean:
+	@cargo clean
+	@rm ./outlib/*
diff --git a/examples/python/wasm_tvm_mnist_payload/build.rs b/examples/python/wasm_tvm_mnist_payload/build.rs
new file mode 100644
index 0000000..52192e9
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/build.rs
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+fn main() {
+    let out_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/outlib");
+    println!("cargo:rustc-link-search=native={}", out_dir);
+}
diff --git a/examples/python/wasm_tvm_mnist_payload/build_lib.py b/examples/python/wasm_tvm_mnist_payload/build_lib.py
new file mode 100755
index 0000000..fbd3a66
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/build_lib.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python3
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Builds a simple resnet50 graph for testing."""
+import argparse
+import os
+import subprocess
+import sys
+
+import onnx
+import tvm
+from tvm import relay, runtime
+from tvm.contrib.download import download_testdata
+from tvm.contrib import graph_executor
+
+from PIL import Image
+import numpy as np
+import tvm.relay as relay
+
+# https://github.com/onnx/models/tree/master/vision/classification/mnist
+
+# This example uses mnist-8 model
+model_url = "".join([
+    "https://github.com/onnx/models/raw/master",
+    "/vision/classification/mnist/model/mnist-8.onnx"
+])
+
+
+def build_graph_lib(opt_level):
+    """Compiles the pre-trained model with TVM"""
+    out_dir = os.path.join(sys.path[0], "./outlib")
+    if not os.path.exists(out_dir):
+        os.makedirs(out_dir)
+
+    # Follow the tutorial to download and compile the model
+    model_path = download_testdata(model_url,
+                                   "mnist-8.onnx",
+                                   module="onnx",
+                                   overwrite=True)
+    # print(model_path)
+    onnx_model = onnx.load(model_path)
+    img_path = "./data/img_10.jpg"
+
+    # Resize it to 28X28 and formalize
+    resized_image = Image.open(img_path).resize((28, 28))
+    img_data = np.asarray(resized_image).astype("float32") / 255
+
+    img_data = np.reshape(img_data, (1, 1, 28, 28))
+
+    input_name = "Input3"
+    shape_dict = {input_name: img_data.shape}
+
+    mod, params = relay.frontend.from_onnx(onnx_model, shape_dict)
+    target = "llvm -mtriple=wasm32-unknown-unknown --system-lib"
+
+    with tvm.transform.PassContext(opt_level=opt_level):
+        factory = relay.build(mod, target=target, params=params)
+
+    # Save the model artifacts to obj_file
+    obj_file = os.path.join(out_dir, "graph.o")
+
+    factory.get_lib().save(obj_file)
+
+    # Run llvm-ar to archive obj_file into lib_file
+    lib_file = os.path.join(out_dir, "libgraph_wasm32.a")
+    cmds = [os.environ.get("LLVM_AR", "llvm-ar-10"), "rcs", lib_file, obj_file]
+    subprocess.run(cmds)
+
+    # Save the json and params
+    with open(os.path.join(out_dir, "graph.json"), "w") as f_graph:
+        f_graph.write(factory.get_graph_json())
+    with open(os.path.join(out_dir, "graph.params"), "wb") as f_params:
+        f_params.write(runtime.save_param_dict(factory.get_params()))
+
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser(
+        description="TVM MNIST model builder for WASM32")
+    parser.add_argument(
+        "-O",
+        "--opt-level",
+        type=int,
+        default=3,
+        help=
+        "level of optimization. 0 is non-optimized and 3 is the highest level",
+    )
+    args = parser.parse_args()
+
+    build_graph_lib(args.opt_level)
diff --git a/examples/python/wasm_tvm_mnist_payload/data/img_10.jpg b/examples/python/wasm_tvm_mnist_payload/data/img_10.jpg
new file mode 100644
index 0000000..40a9004
Binary files /dev/null and b/examples/python/wasm_tvm_mnist_payload/data/img_10.jpg differ
diff --git a/examples/python/wasm_tvm_mnist_payload/src/lib.rs b/examples/python/wasm_tvm_mnist_payload/src/lib.rs
new file mode 100644
index 0000000..5b23afb
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/src/lib.rs
@@ -0,0 +1,85 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+#[macro_use]
+extern crate lazy_static;
+
+mod types;
+pub mod utils;
+
+use std::ffi::CStr;
+use std::os::raw::{c_char, c_int};
+use std::{collections::HashMap, convert::TryFrom, env, sync::Mutex};
+use tvm_graph_rt::{Graph, GraphExecutor, SystemLibModule, Tensor as TVMTensor};
+use types::Tensor;
+
+#[no_mangle]
+pub extern "C" fn entrypoint(argc: c_int, argv: *const *const c_char) -> i32 {
+    assert_eq!(argc, 2);
+
+    // convert `argv` to `Vec<str>`
+    let argv: Vec<_> = (0..argc)
+        .map(|i| unsafe { CStr::from_ptr(*argv.add(i as usize)).to_string_lossy() })
+        .collect();
+
+    // Arguments are referenced in ODD indices
+    run(argv[1].as_ref())
+}
+
+lazy_static! {
+    static ref SYSLIB: SystemLibModule = SystemLibModule::default();
+    static ref GRAPH_EXECUTOR: Mutex<GraphExecutor<'static, 'static>> = {
+        let graph = Graph::try_from(include_str!(concat!(
+            env!("CARGO_MANIFEST_DIR"),
+            "/outlib/graph.json"
+        )))
+        .unwrap();
+
+        let params_bytes =
+            include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/outlib/graph.params"));
+        let params = tvm_graph_rt::load_param_dict(params_bytes)
+            .unwrap()
+            .into_iter()
+            .map(|(k, v)| (k, v.to_owned()))
+            .collect::<HashMap<String, TVMTensor<'static>>>();
+
+        let mut exec = GraphExecutor::new(graph, &*SYSLIB).unwrap();
+
+        exec.load_params(params);
+
+        Mutex::new(exec)
+    };
+}
+
+fn run(input_file: &str) -> i32 {
+    let in_tensor = utils::load_input(input_file);
+    let input: TVMTensor = in_tensor.as_dltensor().into();
+
+    // since this executor is not multi-threaded, we can acquire lock once
+    let mut executor = GRAPH_EXECUTOR.lock().unwrap();
+
+    executor.set_input("Input3", input);
+
+    executor.run();
+
+    let output = executor.get_output(0).unwrap().as_dltensor(false);
+
+    let out_tensor: Tensor = output.into();
+    utils::handle_output(out_tensor)
+}
diff --git a/examples/python/wasm_tvm_mnist_payload/src/types.rs b/examples/python/wasm_tvm_mnist_payload/src/types.rs
new file mode 100644
index 0000000..3be7d16
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/src/types.rs
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use std::{
+    any::TypeId,
+    mem,
+    os::raw::{c_int, c_void},
+    slice,
+};
+pub use tvm_sys::ffi::DLTensor;
+use tvm_sys::ffi::{
+    DLDataType, DLDataTypeCode_kDLFloat, DLDataTypeCode_kDLInt, DLDevice, DLDeviceType_kDLCPU,
+};
+
+#[derive(Debug, PartialEq, Clone)]
+pub enum DataType {
+    FP32,
+    INT32,
+    INT8,
+}
+
+impl DataType {
+    pub fn as_dldtype(&self) -> DLDataType {
+        match self {
+            DataType::INT32 => DLDataType {
+                code: DLDataTypeCode_kDLInt as u8,
+                bits: 32u8,
+                lanes: 1u16,
+            },
+            DataType::INT8 => DLDataType {
+                code: DLDataTypeCode_kDLInt as u8,
+                bits: 8u8,
+                lanes: 1u16,
+            },
+            DataType::FP32 => DLDataType {
+                code: DLDataTypeCode_kDLFloat as u8,
+                bits: 32u8,
+                lanes: 1u16,
+            },
+        }
+    }
+
+    /// Returns whether this `DataType` represents primitive type `T`.
+    pub fn is_type<T: 'static>(&self) -> bool {
+        let typ = TypeId::of::<T>();
+        typ == TypeId::of::<i32>() || typ == TypeId::of::<i8>() || typ == TypeId::of::<f32>()
+    }
+}
+
+impl From<DLDataType> for DataType {
+    fn from(dl_dtype: DLDataType) -> Self {
+        if dl_dtype.code == DLDataTypeCode_kDLInt as u8 && dl_dtype.bits == 32u8 {
+            DataType::INT32
+        } else if dl_dtype.code == DLDataTypeCode_kDLInt as u8 && dl_dtype.bits == 8u8 {
+            DataType::INT8
+        } else if dl_dtype.code == DLDataTypeCode_kDLFloat as u8 && dl_dtype.bits == 32u8 {
+            DataType::FP32
+        } else {
+            DataType::FP32
+        }
+    }
+}
+
+#[derive(Debug, Clone)]
+pub struct Tensor {
+    pub(crate) dtype: DataType,
+    pub(crate) shape: Vec<i64>,
+    pub(crate) strides: Option<Vec<usize>>,
+    pub(crate) data: Vec<u8>,
+}
+
+#[allow(dead_code)]
+impl Tensor {
+    pub fn new(dtype: DataType, shape: Vec<i64>, strides: Vec<usize>, data: Vec<u8>) -> Self {
+        Tensor {
+            dtype,
+            shape,
+            strides: Some(strides),
+            data,
+        }
+    }
+
+    pub fn dtype(&self) -> DataType {
+        self.dtype.clone()
+    }
+
+    pub fn ndim(&self) -> usize {
+        self.shape.len()
+    }
+
+    pub fn shape(&self) -> Vec<i64> {
+        self.shape.clone()
+    }
+
+    pub fn data(&self) -> Vec<u8> {
+        self.data.clone()
+    }
+
+    pub fn as_dltensor(&self) -> DLTensor {
+        DLTensor {
+            data: self.data.as_ptr() as *mut c_void,
+            device: DLDevice {
+                device_type: DLDeviceType_kDLCPU,
+                device_id: 0 as c_int,
+            },
+            ndim: self.shape.len() as c_int,
+            dtype: self.dtype().as_dldtype(),
+            shape: self.shape.as_ptr() as *mut i64,
+            strides: self.strides.as_ref().unwrap().as_ptr() as *mut i64,
+            byte_offset: 0,
+            ..Default::default()
+        }
+    }
+
+    /// Returns the data of this `Tensor` as a `Vec`.
+    ///
+    /// # Panics
+    ///
+    /// Panics if the `Tensor` does not contain elements of type `T`.
+    pub fn to_vec<T: 'static + std::fmt::Debug + Clone>(&self) -> Vec<T> {
+        assert!(self.dtype().is_type::<T>());
+
+        unsafe {
+            slice::from_raw_parts(
+                self.data().as_ptr() as *const T,
+                self.shape().iter().map(|v| *v as usize).product::<usize>() as usize,
+            )
+            .to_vec()
+        }
+    }
+}
+
+impl Default for Tensor {
+    fn default() -> Self {
+        Self {
+            dtype: DataType::FP32,
+            shape: Vec::new(),
+            strides: None,
+            data: Vec::new(),
+        }
+    }
+}
+
+impl From<DLTensor> for Tensor {
+    fn from(dlt: DLTensor) -> Self {
+        unsafe {
+            let shape = slice::from_raw_parts_mut(dlt.shape, dlt.ndim as usize).to_vec();
+            let size = shape.iter().map(|v| *v as usize).product::<usize>() as usize;
+            let itemsize: usize = (dlt.dtype.bits >> 3).into();
+            let data = slice::from_raw_parts(dlt.data as *const u8, size * itemsize).to_vec();
+
+            Self {
+                dtype: DataType::from(dlt.dtype),
+                shape,
+                strides: if dlt.strides.is_null() {
+                    None
+                } else {
+                    Some(
+                        slice::from_raw_parts_mut(dlt.strides as *mut usize, dlt.ndim as usize)
+                            .to_vec(),
+                    )
+                },
+                data,
+            }
+        }
+    }
+}
+
+/// `From` conversions to `Tensor` for `ndarray::Array`.
+/// Takes a reference to the `ndarray` since `Tensor` is not owned.
+macro_rules! impl_tensor_from_ndarray {
+    ($type:ty, $typecode:expr) => {
+        impl<D: ndarray::Dimension> From<ndarray::Array<$type, D>> for Tensor {
+            fn from(arr: ndarray::Array<$type, D>) -> Self {
+                Tensor {
+                    dtype: $typecode,
+                    shape: arr.shape().iter().map(|v| *v as i64).collect(),
+                    strides: Some(arr.strides().iter().map(|v| *v as usize).collect()),
+                    data: unsafe {
+                        slice::from_raw_parts(
+                            arr.as_ptr() as *const u8,
+                            arr.len() * mem::size_of::<$type>(),
+                        )
+                        .to_vec()
+                    },
+                }
+            }
+        }
+    };
+}
+
+impl_tensor_from_ndarray!(f32, DataType::FP32);
diff --git a/examples/python/wasm_tvm_mnist_payload/src/utils.rs b/examples/python/wasm_tvm_mnist_payload/src/utils.rs
new file mode 100644
index 0000000..7ada306
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/src/utils.rs
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+use super::types::*;
+use image::imageops::FilterType;
+use ndarray::Array;
+use std::io::{BufReader, Read};
+use teaclave_context::*;
+
+const IMG_HEIGHT: usize = 28;
+const IMG_WIDTH: usize = 28;
+
+pub fn load_input(in_filename: &str) -> Tensor {
+    let img_file = TeaclaveContextFile::open_input(in_filename).unwrap();
+
+    let mut reader = BufReader::new(img_file);
+    let mut buf = vec![];
+    let _ = reader.read_to_end(&mut buf);
+
+    let img = image::load_from_memory(&buf).unwrap();
+
+    data_preprocess(img)
+}
+
+pub fn handle_output(out_tensor: Tensor) -> i32 {
+    let out_vec = out_tensor.to_vec::<f32>();
+
+    let mut max_idx = 0;
+    for i in 0..out_vec.len() {
+        if out_vec[i] > out_vec[max_idx] {
+            max_idx = i;
+        }
+    }
+
+    max_idx as _
+}
+
+fn data_preprocess(img: image::DynamicImage) -> Tensor {
+    let img = img
+        .resize_exact(IMG_HEIGHT as u32, IMG_WIDTH as u32, FilterType::Nearest)
+        .grayscale();
+
+    let pixels = img.raw_pixels();
+
+    let mut averaged = vec![];
+    for p in pixels {
+        averaged.push((p as f32) / 255.0);
+    }
+
+    let arr = Array::from_shape_vec((IMG_HEIGHT, IMG_WIDTH, 1), averaged).unwrap();
+    let arr = Array::from_iter(arr.into_iter().copied().map(|v| v));
+    Tensor::from(arr)
+}
diff --git a/examples/python/wasm_tvm_mnist_payload/test_lib.py b/examples/python/wasm_tvm_mnist_payload/test_lib.py
new file mode 100755
index 0000000..5ff3df5
--- /dev/null
+++ b/examples/python/wasm_tvm_mnist_payload/test_lib.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import numpy as np
+import tvm
+from PIL import Image
+from tvm.contrib import graph_executor
+
+lib_path = "./outlib/graph.o.so"
+param_path = "./outlib/graph.params"
+json_path = "./outlib/graph.json"
+img_path = "./data/img_10.jpg"
+
+loaded_lib = tvm.runtime.load_module(lib_path)
+print(loaded_lib)
+
+dev = tvm.runtime.cpu()
+module = graph_executor.create(open(json_path).read(), loaded_lib, dev)
+
+loaded_param = bytearray(open(param_path, "rb").read())
+module.load_params(loaded_param)
+
+# Resize it to 28X28
+resized_image = Image.open(img_path).resize((28, 28))
+img_data = np.asarray(resized_image).astype("float32") / 255
+img_data = np.reshape(img_data, (1, 1, 28, 28))
+
+print(loaded_lib)
+
+module.set_input("Input3", img_data)
+module.run()
+
+output_shape = (1, 10)
+tvm_output = module.get_output(0, tvm.nd.empty(output_shape)).numpy()
+
+print(tvm_output)
diff --git a/executor/src/wamr.rs b/executor/src/wamr.rs
index 8c43e38..c2e793e 100644
--- a/executor/src/wamr.rs
+++ b/executor/src/wamr.rs
@@ -29,8 +29,9 @@ use std::os::raw::{c_char, c_int};
 
 use teaclave_types::{FunctionArguments, FunctionRuntime, TeaclaveExecutor};
 
-const DEFAULT_HEAP_SIZE: u32 = 8092;
-const DEFAULT_STACK_SIZE: u32 = 8092;
+// TVM example needs 20MB heap to run in WAMR
+const DEFAULT_HEAP_SIZE: u32 = 20971520;
+const DEFAULT_STACK_SIZE: u32 = 163840;
 const DEFAULT_ERROR_BUF_SIZE: usize = 128;
 
 #[repr(C)]
@@ -257,10 +258,41 @@ pub mod tests {
     use teaclave_types::*;
 
     pub fn run_tests() -> bool {
-        run_tests!(test_wamr,)
+        run_tests!(test_wamr_tvm_mnist, test_wamr_millionaire,)
     }
 
-    fn test_wamr() {
+    fn test_wamr_tvm_mnist() {
+        let mut args = HashMap::new();
+
+        args.insert("input_img".to_string(), "input_img".to_string());
+        let args = FunctionArguments::from(args);
+
+        let wa_payload = include_bytes!("../../tests/fixtures/functions/wamr_tvm_mnist/mnist.wasm");
+
+        let wa_payload = wa_payload.to_vec();
+        let input_img = "fixtures/functions/wamr_tvm_mnist/img_10.jpg";
+
+        let input_img_info =
+            StagedFileInfo::new(input_img, TeaclaveFile128Key::random(), FileAuthTag::mock());
+
+        let input_files = StagedFiles::new(hashmap!("input_img" => input_img_info));
+        let output_files = StagedFiles::default();
+
+        let runtime = Box::new(RawIoRuntime::new(input_files, output_files));
+
+        let function = WAMicroRuntime::default();
+        let summary = function
+            .execute("".to_string(), args, wa_payload, runtime)
+            .unwrap();
+        log::debug!(
+            "IN TEST test_wamr_tvm_mnist: AFTER execution, summary: {:?}",
+            summary
+        );
+
+        assert_eq!(summary, "3");
+    }
+
+    fn test_wamr_millionaire() {
         let mut args = HashMap::new();
 
         args.insert("input_file_id1".to_string(), "pf_in_a".to_string());
@@ -295,7 +327,10 @@ pub mod tests {
         let summary = function
             .execute("".to_string(), args, wa_payload, runtime)
             .unwrap();
-        log::debug!("IN TEST test_wamr: AFTER execution, summary: {:?}", summary);
+        log::debug!(
+            "IN TEST test_wamr_millionaire: AFTER execution, summary: {:?}",
+            summary
+        );
 
         assert_eq!(summary, "7");
 
diff --git a/services/execution/enclave/Enclave.config.xml b/services/execution/enclave/Enclave.config.xml
index 854f777..ee30b65 100644
--- a/services/execution/enclave/Enclave.config.xml
+++ b/services/execution/enclave/Enclave.config.xml
@@ -3,7 +3,7 @@
   <ProdID>0</ProdID>
   <ISVSVN>0</ISVSVN>
   <StackMaxSize>0x200000</StackMaxSize> <!-- 2M -->
-  <HeapMaxSize>0x10000000</HeapMaxSize> <!-- 256M -->
+  <HeapMaxSize>0x30000000</HeapMaxSize> <!-- 768M -->
   <TCSNum>22</TCSNum>
   <TCSPolicy>0</TCSPolicy>
   <DisableDebug>0</DisableDebug>
diff --git a/services/management/enclave/Enclave.config.xml b/services/management/enclave/Enclave.config.xml
index 854f777..ee30b65 100644
--- a/services/management/enclave/Enclave.config.xml
+++ b/services/management/enclave/Enclave.config.xml
@@ -3,7 +3,7 @@
   <ProdID>0</ProdID>
   <ISVSVN>0</ISVSVN>
   <StackMaxSize>0x200000</StackMaxSize> <!-- 2M -->
-  <HeapMaxSize>0x10000000</HeapMaxSize> <!-- 256M -->
+  <HeapMaxSize>0x30000000</HeapMaxSize> <!-- 768M -->
   <TCSNum>22</TCSNum>
   <TCSPolicy>0</TCSPolicy>
   <DisableDebug>0</DisableDebug>
diff --git a/services/scheduler/enclave/Enclave.config.xml b/services/scheduler/enclave/Enclave.config.xml
index 854f777..ee30b65 100644
--- a/services/scheduler/enclave/Enclave.config.xml
+++ b/services/scheduler/enclave/Enclave.config.xml
@@ -3,7 +3,7 @@
   <ProdID>0</ProdID>
   <ISVSVN>0</ISVSVN>
   <StackMaxSize>0x200000</StackMaxSize> <!-- 2M -->
-  <HeapMaxSize>0x10000000</HeapMaxSize> <!-- 256M -->
+  <HeapMaxSize>0x30000000</HeapMaxSize> <!-- 768M -->
   <TCSNum>22</TCSNum>
   <TCSPolicy>0</TCSPolicy>
   <DisableDebug>0</DisableDebug>
diff --git a/services/storage/enclave/Enclave.config.xml b/services/storage/enclave/Enclave.config.xml
index 854f777..1ab5f39 100644
--- a/services/storage/enclave/Enclave.config.xml
+++ b/services/storage/enclave/Enclave.config.xml
@@ -2,8 +2,8 @@
 <EnclaveConfiguration>
   <ProdID>0</ProdID>
   <ISVSVN>0</ISVSVN>
-  <StackMaxSize>0x200000</StackMaxSize> <!-- 2M -->
-  <HeapMaxSize>0x10000000</HeapMaxSize> <!-- 256M -->
+  <StackMaxSize>0x400000</StackMaxSize> <!-- 2M -->
+  <HeapMaxSize>0x30000000</HeapMaxSize> <!-- 768M -->
   <TCSNum>22</TCSNum>
   <TCSPolicy>0</TCSPolicy>
   <DisableDebug>0</DisableDebug>
diff --git a/tests/fixtures/functions/wamr_tvm_mnist/img_10.jpg b/tests/fixtures/functions/wamr_tvm_mnist/img_10.jpg
new file mode 100644
index 0000000..40a9004
Binary files /dev/null and b/tests/fixtures/functions/wamr_tvm_mnist/img_10.jpg differ
diff --git a/tests/fixtures/functions/wamr_tvm_mnist/img_10.jpg.enc b/tests/fixtures/functions/wamr_tvm_mnist/img_10.jpg.enc
new file mode 100644
index 0000000..3ec4157
Binary files /dev/null and b/tests/fixtures/functions/wamr_tvm_mnist/img_10.jpg.enc differ
diff --git a/tests/fixtures/functions/wamr_tvm_mnist/mnist.wasm b/tests/fixtures/functions/wamr_tvm_mnist/mnist.wasm
new file mode 100755
index 0000000..0e207ec
Binary files /dev/null and b/tests/fixtures/functions/wamr_tvm_mnist/mnist.wasm differ

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@teaclave.apache.org
For additional commands, e-mail: commits-help@teaclave.apache.org