From commits-return-11650-archive-asf-public=cust-asf.ponee.io@tvm.apache.org Sat Apr 18 04:37:35 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0116A180647 for ; Sat, 18 Apr 2020 06:37:34 +0200 (CEST) Received: (qmail 12405 invoked by uid 500); 18 Apr 2020 04:37:34 -0000 Mailing-List: contact commits-help@tvm.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tvm.apache.org Delivered-To: mailing list commits@tvm.apache.org Received: (qmail 12338 invoked by uid 99); 18 Apr 2020 04:37:32 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Apr 2020 04:37:32 +0000 From: GitBox To: commits@tvm.apache.org Subject: [GitHub] [incubator-tvm] siju-samuel commented on a change in pull request #5362: [Tutorial - QNN] Prequantized MXNet model compilation. Message-ID: <158718465277.14509.13440454228082673651.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Sat, 18 Apr 2020 04:37:32 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 `_ + +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 +`_. + +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