# Support for TVM Relay with WASM Runtime

**URL:** <https://discuss.tvm.apache.org/t/support-for-tvm-relay-with-wasm-runtime/6765>\
**Category:** Questions\
**Created:** [May 21, 2020, 8:03pm UTC](https://discuss.tvm.apache.org/t/support-for-tvm-relay-with-wasm-runtime/6765 "2020-05-21T20:03:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![videetparekh](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/videetparekh/32/1700_2.png) [@videetparekh](https://discuss.tvm.apache.org/u/videetparekh)\
**Post date:** [May 21, 2020, 8:03pm UTC](https://discuss.tvm.apache.org/t/support-for-tvm-relay-with-wasm-runtime/6765/1 "2020-05-21T20:03:51Z")

</div>

I have an int8 quantized model (with json, params) compiled to WASM and another params file that holds dequantization data. While ingesting the model in a NodeJS app, I need to dequantize the weights back to fp32, which requires me to read the parameter files, dequantize the weights and save the parameter dictionary again.

Is there a way to support TVM Relay functions that allow access to the graph and parameters(save\_params\_dict, load\_params\_dict) with a WASM library the way the TVM Runtime is supported?

---

<div class="post-metadata">

**Author:** ![videetparekh](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/videetparekh/32/1700_2.png) [@videetparekh](https://discuss.tvm.apache.org/u/videetparekh)\
**Post date:** [May 26, 2020, 4:09pm UTC](https://discuss.tvm.apache.org/t/support-for-tvm-relay-with-wasm-runtime/6765/2 "2020-05-26T16:09:11Z")

</div>

Following up here: Are there plans to extend TVM Relay support to WASM?

---

<div class="post-metadata">

**Author:** ![3160104812](https://discuss.tvm.apache.org/letter_avatar_proxy/v4/letter/3/3da27b/32.png) [@3160104812](https://discuss.tvm.apache.org/u/3160104812)\
**Post date:** [June 12, 2020, 12:57pm UTC](https://discuss.tvm.apache.org/t/support-for-tvm-relay-with-wasm-runtime/6765/3 "2020-06-12T12:57:54Z")

</div>

Hi, I am kind of curious your method to compile the module,json,params items into 1 .wasm. May I get some guidance on that?

---

<div class="post-metadata">

**Author:** ![videetparekh](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/videetparekh/32/1700_2.png) [@videetparekh](https://discuss.tvm.apache.org/u/videetparekh)\
**Post date:** [July 15, 2020, 8:44pm UTC](https://discuss.tvm.apache.org/t/support-for-tvm-relay-with-wasm-runtime/6765/4 "2020-07-15T20:44:20Z")

</div>

Here’s a great example by Tianqi to compile to the model.

> <https://github.com/tqchen/tvm-webgpu-example/blob/master/build.py>

I take this and apply it to a pretrained TF model to compile to WASM. If you look carefully at the repo, you will also find a sample script to deploy the model for WebGPU.
