[AutoTVM] can not build dynamic and system-lib from the best history record simultaneously


#1

After tuning, I tried to build system-lib (the object file) and the dynamic shared object file from the best history record, the library (either dynamic or system-lib) generated from the 1st build_config can run correctly, but the library from 2nd build_config will give wrong results (also runs much faster than expected, like from ~8ms to ~2ms).

Is there a way to reset/clear the autotvm build cache?

with autotvm.apply_history_best(log_file):
    print("Compile...")
    with relay.build_config(opt_level=3):
        graph, lib, params = relay.build_module.build(
            net, target=target_host + ' --system-lib', params=params)
        lib.save(args.model + "-deploy.o")
        graph, lib, params = relay.build_module.build(
            net, target=target_host, params=params)

#2

Can you try the following code and see if it fixes the issue?

with autotvm.apply_history_best(log_file):
    print("Compile...")
    with relay.build_config(opt_level=3):
        graph, lib, params = relay.build_module.build(
            net, target=target_host + ' --system-lib', params=params)
        lib.save(args.model + "-deploy.o")
with autotvm.apply_history_best(log_file):
    with relay.build_config(opt_level=3):
        graph, lib, params = relay.build_module.build(
            net, target=target_host, params=params)

#3

@haichen Thanks for replying, I tried this before, it did not work.