alanmacd commented on code in PR #13978: URL: https://github.com/apache/tvm/pull/13978#discussion_r1105182397
########## tests/micro/common/test_mlperftiny.py: ########## @@ -0,0 +1,295 @@ +# 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 os +from urllib.parse import urlparse + +import pytest +import tensorflow as tf +import numpy as np +import tarfile +import tempfile +import pathlib + +import tvm +import tvm.testing +from tvm import relay +from tvm.relay.backend import Executor, Runtime +from tvm.micro.project_api import server +from tvm.contrib.download import download_testdata +from tvm.micro import export_model_library_format +from tvm.micro.model_library_format import generate_c_interface_header +from tvm.micro.testing import create_aot_session, predict_labels_aot +from tvm.micro.testing.utils import ( + create_header_file, + mlf_extract_workspace_size_bytes, +) + +MLPERF_TINY_MODELS = { + "kws": { + "name": "Keyword Spotting", + "index": 1, + "url": "https://github.com/mlcommons/tiny/raw/bceb91c5ad2e2deb295547d81505721d3a87d578/benchmark/training/keyword_spotting/trained_models/kws_ref_model.tflite", + "sample": "https://github.com/tlc-pack/web-data/raw/main/testdata/microTVM/data/keyword_spotting_int8_6.pyc.npy", + }, + "vww": { + "name": "Visual Wake Words", + "index": 2, + "url": "https://github.com/mlcommons/tiny/raw/bceb91c5ad2e2deb295547d81505721d3a87d578/benchmark/training/visual_wake_words/trained_models/vww_96_int8.tflite", + "sample": "https://github.com/tlc-pack/web-data/raw/main/testdata/microTVM/data/visual_wake_word_int8_1.npy", + }, + # Note: The reason we use quantized model with float32 I/O is + # that TVM does not handle the int8 I/O correctly and accuracy + # would drop signigicantly. Review Comment: nit: significantly -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
