leandron commented on a change in pull request #6279:
URL: https://github.com/apache/incubator-tvm/pull/6279#discussion_r475585124
##########
File path: tests/python/contrib/test_arm_compute_lib/infrastructure.py
##########
@@ -25,15 +26,56 @@
from tvm.contrib import graph_runtime
from tvm.relay.op.contrib import arm_compute_lib
from tvm.contrib import util
+from tvm.autotvm.measure import request_remote
class Device:
- """Adjust the following settings to connect to and use a remote device for
tests."""
- use_remote = False
- target = "llvm -mtriple=aarch64-linux-gnu -mattr=+neon"
- # Enable cross compilation when connecting a remote device from a non-arm
platform.
- cross_compile = None
- # cross_compile = "aarch64-linux-gnu-g++"
+ """
+ Configuration for Arm Compute Library tests.
+
+ Check tests/python/contrib/arm_compute_lib/ for the presence of an
test_config.json file.
+ This file can be used to override the default configuration here which
will attempt to run the Arm
+ Compute Library runtime tests locally if the runtime is available.
Changing the configuration
+ will allow these runtime tests to be offloaded to a remote Arm device via
a tracker for example.
+
+ Notes
+ -----
+ The test configuration will be loaded once when the the class is
created. If the configuration
+ changes between tests, any changes will not be picked up.
+
+ Parameters
+ ----------
+ device : RPCSession
+ Allows tests to connect to and use remote device.
+
+ Attributes
+ ----------
+ connection_type : str
+ Details the type of RPC connection to use. Options:
+ local - Use the local device,
+ tracker - Connect to a tracker to request a remote device,
+ remote - Connect to a remote device directly.
+ host : str
+ Specify IP address or hostname of remote target.
+ port : int
+ Specify port number of remote target.
+ target : str
+ The compilation target.
+ device_key : str
+ The device key of the remote target. Use when connecting to a remote
device via a tracker.
+ cross_compile : str
+ Specify path to cross compiler to use when connecting a remote device
from a non-arm platform.
+ """
+ _location = os.path.realpath(os.path.join(os.getcwd(),
os.path.dirname(__file__)))
+ with open(os.path.join(_location, "test_config.json"), mode="r") as config:
+ _test_config = json.load(config)
+
+ connection_type = _test_config["connection_type"]
+ host = _test_config["host"]
+ port = _test_config["port"]
+ target = _test_config["target"]
+ device_key = _test_config.get("device_key") or ""
+ cross_compile = _test_config.get("cross_compile") or ""
Review comment:
I was thinking about something along the lines:
```
Device.load("some_file.json") # populates the class
```
----------------------------------------------------------------
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:
[email protected]