I am trying to use AutoScheduler to tune a net of TOPI operators, but the tuning seems to fail to generate any sketches.
I have defined the net as follows:
@auto_scheduler.register_workload
def func():
IB = te.placeholder((768,), dtype='float32')
IB_2 = topi.power(IB, 2) # Square
IB_6 = 0.0010000000474974513 # Const
IB_4 = 0.9990000128746033 # Const
IB_2 = topi.multiply(IB_6, IB_2)
IB_5 = te.placeholder((768,), dtype='float32')
IB_4 = topi.multiply(IB_4, IB_5)
IB = topi.add(IB_4, IB_2)
IB_5 = 0.10000000149011612 # Const
IB_4 = 0.8999999761581421 # Const
IB_2 = 9.999999974752427e-07 # Const
IB_6 = topi.sqrt(IB)
IB_8 = te.placeholder((768,), dtype='float32')
IB_5 = topi.multiply(IB_5, IB_8)
IB_7 = te.placeholder((768,), dtype='float32')
IB_4 = topi.multiply(IB_4, IB_7)
IB_2 = topi.add(IB_6, IB_2)
IB_4 = topi.add(IB_4, IB_5)
IB_2 = topi.divide(IB_4, IB_2)
IB_3 = te.var(dtype='float32')
IB_2 = topi.multiply(IB_3, IB_2)
IB_1 = te.placeholder((768,), dtype='float32')
OB = topi.subtract(IB_1, IB_2)
return [IB_1,IB_7,IB_8,IB_5,IB , OB]
I am calling AutoScheduler like this:
target = tvm.target.Target('opencl')
task = auto_scheduler.SearchTask(func=func, target=target, hardware_params=hardware_params)
measure_ctx = auto_scheduler.LocalRPCMeasureContext(min_repeat_ms=300, timeout=600)
tune_option = auto_scheduler.TuningOptions(
num_measure_trials=trials,
measure_callbacks=[auto_scheduler.RecordToFile(logfile)],
verbose=1,
runner=measure_ctx.runner
)
task.tune(tune_option)
This is the tuner’s output
----------------------------------------------------------------------
------------------------------ [ Search ]
----------------------------------------------------------------------
Generate Sketches #s: 1
Sample Iter: 5 #Pop: 0 #Target: 50 fail_ct: 10240 Time elapsed: 22.54
#Target has been reduced to 25 due to too many failures or duplications
Sample Iter: 10 #Pop: 0 #Target: 25 fail_ct: 20480 Time elapsed: 42.35
#Target has been reduced to 12 due to too many failures or duplications
Sample Iter: 15 #Pop: 0 #Target: 12 fail_ct: 30720 Time elapsed: 62.17
#Target has been reduced to 6 due to too many failures or duplications
Sample Iter: 20 #Pop: 0 #Target: 6 fail_ct: 40960 Time elapsed: 81.98
#Target has been reduced to 3 due to too many failures or duplications
Sample Iter: 25 #Pop: 0 #Target: 3 fail_ct: 51200 Time elapsed: 101.80
#Target has been reduced to 1 due to too many failures or duplications
Sample Iter: 30 #Pop: 0 #Target: 1 fail_ct: 61440 Time elapsed: 121.61
Sample Iter: 35 #Pop: 0 #Target: 1 fail_ct: 71680 Time elapsed: 141.42
Sample Iter: 40 #Pop: 0 #Target: 1 fail_ct: 81920 Time elapsed: 161.23
Sample Iter: 45 #Pop: 0 #Target: 1 fail_ct: 92160 Time elapsed: 181.06
Sample Iter: 50 #Pop: 0 #Target: 1 fail_ct: 102400 Time elapsed: 200.87
Sample Iter: 55 #Pop: 0 #Target: 1 fail_ct: 112640 Time elapsed: 220.66
Sample Iter: 60 #Pop: 0 #Target: 1 fail_ct: 122880 Time elapsed: 240.46
Sample Iter: 65 #Pop: 0 #Target: 1 fail_ct: 133120 Time elapsed: 260.26
Sample Iter: 70 #Pop: 0 #Target: 1 fail_ct: 143360 Time elapsed: 280.07
Sample Iter: 75 #Pop: 0 #Target: 1 fail_ct: 153600 Time elapsed: 299.87
Sample Iter: 80 #Pop: 0 #Target: 1 fail_ct: 163840 Time elapsed: 319.67
Sample Iter: 85 #Pop: 0 #Target: 1 fail_ct: 174080 Time elapsed: 339.48
Sample Iter: 90 #Pop: 0 #Target: 1 fail_ct: 184320 Time elapsed: 359.29
Sample Iter: 95 #Pop: 0 #Target: 1 fail_ct: 194560 Time elapsed: 379.10
Sample Iter: 100 #Pop: 0 #Target: 1 fail_ct: 204800 Time elapsed: 398.90
...
Sample Iter: 3345 #Pop: 0 #Target: 1 fail_ct: 6850560 Time elapsed: 13263.46
Sample Iter: 3350 #Pop: 0 #Target: 1 fail_ct: 6860800 Time elapsed: 13283.27
Sample Iter: 3355 #Pop: 0 #Target: 1 fail_ct: 6871040 Time elapsed: 13303.08
As you can see it is still generating sketches after more than 3h. Is this expected and can I expect that this will be finished some time or is AutoScheduler not able to find anything for my specific net? I have used AutoScheduler for single operators without a problem.
Many thanks in advance!