cconvey commented on code in PR #11490: URL: https://github.com/apache/tvm/pull/11490#discussion_r883751896
########## tests/python/contrib/test_hexagon/benchmark_elemwise_add.py: ########## @@ -0,0 +1,468 @@ +# 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 +import os.path +import sys +import pytest +import numpy as np +import logging +import tempfile + +import tvm.testing +import tvm.script +from tvm.script import tir as T +from tvm import te +from tvm.contrib.hexagon.build import HexagonLauncherRPC +from .benchmark_util import BenchmarksTable + +RPC_SERVER_PORT = 7070 + +# This is a fixed detail of the v68 architecture. +HVX_VECTOR_BYTES = 128 + +# NOTE on server ports: +# These tests use different port numbers for the RPC server (7070 + ...). +# The reason is that an RPC session cannot be gracefully closed without +# triggering TIME_WAIT state on the server socket. This prevents another +# server to bind to the same port until the wait time elapses. + +_BT = BenchmarksTable() + +_CSV_COLUMN_ORDER = [ + # Identifies which TE-compute / TIRScript is used as the basis for the + # benchmarked primfunc. Only needs to be meaningful to humans. + "basic_kernel", + # The tensors 'element type + "dtype", + # When applicable, indicates the particular variation of schedules + # apply by the Python code. Decoding this may require looking at this + # script's source code. + "sched_type", + # The memory location of the tensors used during the execution of + # the primfunc. We currently assume just one location. + # This will likely need to be generalized as we add more sophisticated + # primfuncs. + "mem_scope", + # For primfuncs that treat tensor buffers as collections of 1D vectors, + # this is the number of vectors in each tensor. + # This will likely need to be generalized as we add more sophisticated + # primfuncs. + "num_vectors_per_tensor", + # Reserved columns defined by the BenchmarksTable class. + "row_status", + "timings_min_usecs", + "timings_max_usecs", + "timings_median_usecs", + "timings_mean_usecs", + "timings_stddev_usecs", + # For benchmarks that produce files on the host file system, this indicates + # their location. Useful for post-mortem investigation of benchmark results. + "host_files_dir", + # Miscellaneous comments about the benchmark. + "comments", +] Review Comment: I don't think we know (yet) if a single version of this list will be appropriate for all of the benchmarks we're planning to develop. I suggest we leave this as-is until we see a pattern develop. -- 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]
