tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] siju-samuel commented on a change in pull request #5362: [Tutorial - QNN] Prequantized MXNet model compilation.
Date Sat, 18 Apr 2020 04:37:32 GMT
siju-samuel commented on a change in pull request #5362: [Tutorial - QNN] Prequantized MXNet
model compilation.
URL: https://github.com/apache/incubator-tvm/pull/5362#discussion_r410607028
 
 

 ##########
 File path: tutorials/frontend/deploy_prequantized_mxnet.py
 ##########
 @@ -0,0 +1,232 @@
+# 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.
+"""
+Deploy a Framework-prequantized Model with TVM - Part 2 (MXNet)
+===============================================================
+**Author**: `Animesh Jain <https://github.com/anijain2305>`_
+
+Welcome to Part 2 of Deploy Framework-Prequantized Model with TVM. In this tutorial, we will
start
+with a FP32 MXNet graph, quantize it using MXNet, and then compile and execute it via TVM.
+
+For more details on quantizing the model using MXNet, readers are encouraged to go through
`Model
+Quantization with Calibration Examples
+<https://github.com/apache/incubator-mxnet/tree/master/example/quantization>`_.
+
+Pre-requisites
+    pip3 install mxnet-mkl --user
+    pip3 install gluoncv --user
+"""
+
+
+###############################################################################
+# Necessary imports
+# -----------------
+import os
+
+import mxnet as mx
+from gluoncv.model_zoo import get_model
+from mxnet.contrib.quantization import *
+
+import tvm
+from tvm import relay
+
+
+###############################################################################
+# Helper functions
+# ----------------
+def download_calib_dataset(dataset_url, calib_dataset):
 
 Review comment:
   Can you use `from tvm.contrib.download import download_testdata' as in other tutorials
to download the calib record, currently its downloading to `./data`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message