75afcd766e0e45fdb8bd3007b3114257f11a7ec4,tutorials/auto_scheduler/tune_conv2d_layer_cuda.py,,,#,70

Before Change


// print the equivalent python schedule API, and build the binary again.

// Load the measuremnt record for the best schedule
inp, res = auto_scheduler.load_best(log_file, task.workload_key)

// Print equivalent python schedule API. This can be used for debugging and
// learning the behavior of the auto-scheduler.
print("Equivalent python schedule:")
print(task.compute_dag.print_python_code_from_state(inp.state))

// Rebuild the binary. This shows how you can apply the best schedule from a
// log file without reruning the search again.
sch, args = task.compute_dag.apply_steps_from_state(inp.state)
func = tvm.build(sch, args, target)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// A more complicated example is to resume the search.
// In this case, we need to create the search policy and cost model by ourselves
// and resume the status of search policy and cost model with the log file.
// In the example below we resume the status and do more 5 trials.

cost_model = auto_scheduler.XGBModel()
cost_model.update_from_file(log_file)
search_policy = auto_scheduler.SketchPolicy(
    task, cost_model, init_search_callbacks=[auto_scheduler.PreloadMeasuredStates(log_file)]
)
measure_ctx = auto_scheduler.LocalRPCMeasureContext(min_repeat_ms=300)
tune_option = auto_scheduler.TuningOptions(
    num_measure_trials=5,
    runner=measure_ctx.runner,
    measure_callbacks=[auto_scheduler.RecordToFile(log_file)],
)
sch, args = auto_scheduler.auto_schedule(task, search_policy, tuning_options=tune_option)

// Kill the measurement process
del measure_ctx

After Change


print(task.print_best(log_file, print_mode="schedule"))

print("CUDA source code:")
print(task.print_best(log_file, print_mode="cuda"))

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// A more complicated example is to resume the search.
// In this case, we need to create the search policy and cost model by ourselves
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: apache/incubator-tvm
Commit Name: 75afcd766e0e45fdb8bd3007b3114257f11a7ec4
Time: 2020-12-04
Author: lianminzheng@gmail.com
File Name: tutorials/auto_scheduler/tune_conv2d_layer_cuda.py
Class Name:
Method Name:


Project Name: apache/incubator-tvm
Commit Name: 75afcd766e0e45fdb8bd3007b3114257f11a7ec4
Time: 2020-12-04
Author: lianminzheng@gmail.com
File Name: tutorials/auto_scheduler/tune_conv2d_layer_cuda.py
Class Name:
Method Name:


Project Name: apache/incubator-tvm
Commit Name: 75afcd766e0e45fdb8bd3007b3114257f11a7ec4
Time: 2020-12-04
Author: lianminzheng@gmail.com
File Name: tests/python/unittest/test_auto_scheduler_search_policy.py
Class Name:
Method Name: search_common


Project Name: apache/incubator-tvm
Commit Name: 75afcd766e0e45fdb8bd3007b3114257f11a7ec4
Time: 2020-12-04
Author: lianminzheng@gmail.com
File Name: tutorials/auto_scheduler/tune_matmul_x86.py
Class Name:
Method Name: