-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed bnns tests to support RPC tracker and integrate them into CI #9
base: main
Are you sure you want to change the base?
Conversation
X64_X86 = 0 | ||
ARM64 = 1 | ||
|
||
connection_type = ConnectionType("local") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to instance field
@@ -180,13 +212,15 @@ def build_and_run( | |||
return out | |||
|
|||
|
|||
def update_lib(lib, device, cross_compile): | |||
def update_lib(lib, device, cross_compile, lib_export_type): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may remove cross_compile args for our cases.
lib.export_library(lib_path, cc=cross_compile) | ||
if lib_export_type == Device.LibExportType.ARM64: | ||
lib.export_library(lib_path, xcode.create_dylib, arch="arm64", sdk="iphoneos") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this branch into details of Device object.
The first way is:
lib.export_library(lib_path, _device.fcompile, _device.fcompile_kwargs)
The second way:
lib.export_library(lib_path, _device.fcompile)
***
def my_create_dylib(output, objects, *kwargs):
xcode.create_dylib(output, objects, arch="arm64", sdk="phones", **kwargs)
_device.fcompile = my_create_dylib
"""Skip test if it requires the BNNS codegen and it's not present.""" | ||
if not tvm.get_global_func("relay.ext.bnns", True): | ||
print("Skip because BNNS codegen is not available.") | ||
def have_device_and_tracker_variables(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to move this check into Device class object. Like a Device.is_tracker_compatible()
cls.device_key = os.environ[Device.EnvironmentVariables.TVM_REMOTE_DEVICE_KEY.value] | ||
|
||
cls.target = "llvm -mtriple=arm64-apple-darwin" | ||
cls.lib_export_type = Device.LibExportType.ARM64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move lib_export_type, target and connection_type to instance field.
Initialisation of all other move to constructor of class object.
return [Device.ConnectionType.LOCAL, Device.ConnectionType.TRACKER] | ||
|
||
|
||
def skip_complexity_test(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be formulated as special decorator
Last run of CI with these changes: https://github.com/OctoML-NN-team/ci-scripts/runs/2609378094?check_suite_focus=true