tmp_log_file = log_filename + ".tmp" print(len(tasks), 'tasks') for i, tsk in enumerate(reversed(tasks)): prefix = "[Task %2d/%2d] " % (i + 1, len(tasks)) # create tuner if tuner == 'xgb' or tuner == 'xgb-rank': tuner_obj = XGBTuner(tsk, loss_type='rank') elif tuner == 'ga': tuner_obj = GATuner(tsk, pop_size=100) elif tuner == 'random': tuner_obj = RandomTuner(tsk) elif tuner == 'gridsearch': tuner_obj = GridSearchTuner(tsk) else: raise ValueError("Invalid tuner: " + tuner) if use_transfer_learning: if os.path.isfile(tmp_log_file): tuner_obj.load_history(autotvm.record.load_from_file(tmp_log_file)) # do tuning tuner_obj.tune(n_trial=min(n_trial, len(tsk.config_space)), early_stopping=early_stopping, measure_option=measure_option, callbacks=[ autotvm.callback.progress_bar(n_trial, prefix=prefix), autotvm.callback.log_to_file(tmp_log_file)])
Here are my codes. I’ve done auto-tuning with 13 out of 23 tasks, and then restarted it.
before I restart, the log is like:
[Task 1/23] Current/Best: 1077.78/1799.04 GFLOPS | Progress: (1160/2000) | 2628.82 s Done. [Task 2/23] Current/Best: 2632.91/3759.71 GFLOPS | Progress: (1080/2000) | 3420.68 s Done. [Task 3/23] Current/Best: 86.04/4981.69 GFLOPS | Progress: (1360/2000) | 4965.42 s Done. [Task 4/23] Current/Best: 6573.18/7858.29 GFLOPS | Progress: (840/2000) | 3622.84 s Done. [Task 5/23] Current/Best: 2926.18/3372.58 GFLOPS | Progress: (1160/2000) | 4330.86 s Done. [Task 6/23] Current/Best: 233.01/4516.10 GFLOPS | Progress: (1120/2000) | 4550.76 s Done. [Task 7/23] Current/Best: 7413.94/8618.58 GFLOPS | Progress: (1320/2000) | 6722.76 s Done. [Task 8/23] Current/Best: 947.91/6387.67 GFLOPS | Progress: (1240/2000) | 5181.29 s Done. [Task 9/23] Current/Best: 2199.75/5921.06 GFLOPS | Progress: (1120/2000) | 4584.77 s Done. [Task 10/23] Current/Best: 0.73/3877.09 GFLOPS | Progress: (2000/2000) | 8261.93 s Done. [Task 11/23] Current/Best: 630.80/3405.00 GFLOPS | Progress: (1680/2000) | 6506.84 s Done. [Task 12/23] Current/Best: 7196.21/9322.40 GFLOPS | Progress: (1160/2000) | 5283.66 s Done. [Task 13/23] Current/Best: 4453.55/5437.99 GFLOPS | Progress: (1160/2000) | 4695.83 s Done. [Task 14/23] Current/Best: 329.66/4925.87 GFLOPS | Progress: (1560/2000) | 6217.55 s
But after I restart, the job still begins with the 1st task,
[Task 1/23] Current/Best: 1075.06/1238.92 GFLOPS | Progress: (120/2000) | 278.33 s
Why should it not continue from the 14th task ?
Or do I have some misunderstanding with transfer learning?
Hoping for replies.