krishnaraj36 commented on code in PR #13450: URL: https://github.com/apache/tvm/pull/13450#discussion_r1065377049
########## tests/python/contrib/test_clml/test_adreno_collage_targets.py: ########## @@ -0,0 +1,401 @@ +# 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. + +"""Compares Collage with various other baselines.""" + +import tvm +import logging +import tempfile +import os +import shutil +import numpy as np +from tvm.relay import testing +from tvm import rpc +from tvm.contrib import utils, ndk +from tvm.relay.build_module import bind_params_by_name + +# The following are necessary to force global functions or pattern tables to be registered +from tvm.relay.collage.collage import * +from tvm.relay.op.contrib import clml +import pytest + +logging.basicConfig(level=logging.INFO) + + +########### Configuration ########### + +### +### TVM Opencl AutoTvm log file name +### +TUNING_LOG = "" + +### +### If true, run all models +### +ALL_MODELS = False + +### +### If true, run all configurations +### +ALL_CONFIGS = False + +### +### How aggressively to look for candidates? +### +TVM_MAX_DEPTH = 8 +BYOC_MAX_DEPTH = 8 + +### +### AutoTVM tuning parameters. +### +AUTOTVM_NUM_TRIALS = 1024 +AUTOTVM_EARLY_STOPPING = 600 +TIMEOUT = 10 +MEASURE_NUMBER = tvm.relay.collage.MEASURE_NUMBER +MEASURE_REPEAT = tvm.relay.collage.MEASURE_REPEAT +WARMUP_MIN_REPEAT_MS = tvm.relay.collage.WARMUP_MIN_REPEAT_MS + +## +## RPC Build configuration +## +HOST = tvm.target.Target("llvm -mtriple=arm64-linux-android") +OPENCL = tvm.target.Target("opencl", HOST) +RPC_TRACKER_HOST = os.getenv("TVM_TRACKER_HOST", "localhost") +RPC_TRACKER_PORT = int(os.getenv("TVM_TRACKER_PORT", 9090)) +RPC_KEY = os.getenv("RPC_DEVICE_KEY", "android") +NDK_CROSS_COMPILER = os.getenv("TVM_NDK_CC", "aarch64-linux-android-g++") + +########### Runtime ########### + +# Code to run a model. The actual call to 'run' is appended at compile time. +# We invoke the model as a sub-process so that we can wrap profiling tools around it. +runner_template = f""" Review Comment: I had followed same test script used for Nvidia test case.(tests/python/relay/collage/demo_collage_partitioner.py) Since here we are not doing any profiling for adreno target, so we can have single function instead runner template. I have added the changes for that. -- 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]
