Can we reuse the .log file on windows which is generated after autotune on ubuntu


#1

can we reuse the .log file on windows which is generated after autotune on ubuntu, so that we don’t need to do the autotune again on windows?


#2

Theoretically you can as long as the device architecture is the same.
cc: @kevinthesun


#3

when I tried to reuse the .log after auto-tune from Ubuntu on Windows, an error happened:
Traceback (most recent call last):

File “so_check_mmnet_input_384.py”, line 286, in
lib.export_library(libpath)

File “C:\Users\yl2304\tvm\python\tvm\module.py”, line 144, in export_library
fcompile(file_name, files, **kwargs)

File “C:\Users\yl2304\tvm\python\tvm\contrib\cc.py”, line 50, in create_shared
_windows_shared(output, objects, options)

File “C:\Users\yl2304\tvm\python\tvm\contrib\cc.py”, line 188, in _windows_shared
raise RuntimeError(“Can not find the LLVM linker for Windows (lld-link.exe).”

RuntimeError: Can not find the LLVM linker for Windows (lld-link.exe).Make sure it’s installed and the installation directory is in the %PATH% environment variable. Prebuilt binaries can be found at: https://llvm.org/For building the linker on your own see: https://lld.llvm.org/#build

does it means that I need to download the pre-built LLVM in order to generate .dll when lib.export_library(libpath)?

or do I need to build llvm from source including the LLD in order to generate .dll for windows?
Thanks a lot! cc: @kevinthesun


#4

after I install the pre-built llvm, it successfully generated the .dll file and results are good but the problem is the speed is very slow on Windows about 139ms/frame comapared 40ms /frame on Ubuntu.

PS: this result came from reusing .log from auto-tune on Ubuntu

cc: @kevinthesun
image matting


#5

That’s an interesting issue. Could you run AutoTVM on Windows and see how large the gap is?


#6

one reason for the gap between Ubuntu and Windows, I think, may be caused by LLVM build. On Ubuntu, .log was generated by autu-tune by using two cpu cores and the LLVM was pre-built with OpenOmp, but on Windows, the llvm was built from source which I didn’t add the OpenOmp.

@kevinthesun

Thanks a lot!


#7

You can try to compile on ubuntu and export library. Then load library on windows.


#8

thanks a lot!

I tried to generate the .dll by lib.export_library("…/deploy.dll") on Ubuntu and then tried to loaded the lib by
loaded_lib = tvm.module.load(libpath) on Windows, but the error occurred, C:\Users\yl2304\tvm_data\deploy.dll,没有被指定在Windows上运行,或者它包含错误,请尝试使用原始安装介质重新安装程序

Traceback (most recent call last):

File “so_check_mmnet_input_384.py”, line 297, in
loaded_lib = tvm.module.load(libpath)

File “C:\Users\yl2304\tvm\python\tvm\module.py”, line 260, in load
return _LoadFromFile(path, fmt)

File “C:\Users\yl2304\tvm\python\tvm_ffi_ctypes\function.py”, line 210, in call
raise get_last_ffi_error()

tvm.ffi.base.TVMError: [12:54:57] C:\Users\yl2304\tvm_temp\src\runtime\dso_module.cc:96: Check failed: lib_handle != nullptr: Failed to load dynamic shared library …/deploy.dll


#9

when I tried to autotune the network on Windows, it’s weird that the phython script was hung on without any response

op_name:% conv2d
debug: [test_on_x86.py]
[Task 1/48] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (0/240) | 0.00 s

and I run the tutorial/autotvm/tune_relay_x86.py, it ended abnormally :

[Task 1/12] Current/Best: 0.00/ 0.00 GFLOPS | Progress: (0/400) | 0.00 sTraceback (most recent call last):

File “tune_relay_x86.py”, line 218, in
tune_and_evaluate(tuning_option)

File “tune_relay_x86.py”, line 191, in tune_and_evaluate
tune_kernels(tasks, **tuning_opt)

File “tune_relay_x86.py”, line 166, in tune_kernels
autotvm.callback.log_to_file(log_filename)])

File “C:\Users\yl2304\tvm\python\tvm\autotvm\tuner\tuner.py”, line 108, in tune
measure_batch = create_measure_batch(self.task, measure_option)

File “C:\Users\yl2304\tvm\python\tvm\autotvm\measure\measure.py”, line 252, in create_measure_batch
attach_objects = runner.set_task(task)

File “C:\Users\yl2304\tvm\python\tvm\autotvm\measure\measure_methods.py”, line 336, in set_task
tracker_addr=(tracker.host, tracker.port))

File “C:\Users\yl2304\tvm\python\tvm\rpc\server.py”, line 369, in init
self.proc = subprocess.Popen(cmd, preexec_fn=os.setsid)

AttributeError: module ‘os’ has no attribute ‘setsid’

cc @comaniac