From 2886b2e11463f0809b515312e5689d5f47798983 Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Wed, 21 Oct 2020 03:34:34 +0000 Subject: [PATCH 1/8] test --- src/auto_scheduler/measure_record.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/auto_scheduler/measure_record.cc b/src/auto_scheduler/measure_record.cc index 99c01b17e78e..bdd2b369c6cf 100755 --- a/src/auto_scheduler/measure_record.cc +++ b/src/auto_scheduler/measure_record.cc @@ -156,7 +156,7 @@ struct Handler<::tvm::auto_scheduler::MeasureInputNode> { CHECK(s); reader->Read(state_node.get()); s = reader->NextArrayItem(); - CHECK(!s); + // CHECK(!s); data->task = ::tvm::auto_scheduler::SearchTask(task_node); data->state = ::tvm::auto_scheduler::State(state_node); @@ -281,6 +281,7 @@ bool RecordReaderNode::ReadNext(MeasureInputNode* inp, MeasureResultNode* res) { continue; } ReadMeasureRecord(cur_line_, inp, res, &log_version); + LOG(WARNING) << cur_line_; return true; } From d9e13ac880c8d469cddfcd1a68813e328c9f4dcb Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Wed, 21 Oct 2020 04:18:33 +0000 Subject: [PATCH 2/8] a --- Jenkinsfile | 152 ---------------------------------------------------- 1 file changed, 152 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6cc0ae450773..4f460879f434 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -158,148 +158,7 @@ def unpack_lib(name, libs) { """ } -stage('Build') { - parallel 'BUILD: GPU': { - node('GPUBUILD') { - ws(per_exec_ws("tvm/build-gpu")) { - init_git() - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh" - make(ci_gpu, 'build', '-j2') - pack_lib('gpu', tvm_multilib) - // compiler test - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu_vulkan.sh" - make(ci_gpu, 'build2', '-j2') - } - } - }, - 'BUILD: CPU': { - node('CPU') { - ws(per_exec_ws("tvm/build-cpu")) { - init_git() - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh" - make(ci_cpu, 'build', '-j2') - pack_lib('cpu', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_unittest.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_fsim.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_golang.sh" - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh" - } - } - } - }, - 'BUILD: WASM': { - node('CPU') { - ws(per_exec_ws("tvm/build-wasm")) { - init_git() - sh "${docker_run} ${ci_wasm} ./tests/scripts/task_config_build_wasm.sh" - make(ci_wasm, 'build', '-j2') - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_wasm} ./tests/scripts/task_web_wasm.sh" - } - } - } - }, - 'BUILD : i386': { - node('CPU') { - ws(per_exec_ws("tvm/build-i386")) { - init_git() - sh "${docker_run} ${ci_i386} ./tests/scripts/task_config_build_i386.sh" - make(ci_i386, 'build', '-j2') - pack_lib('i386', tvm_multilib) - } - } - }, - 'BUILD: QEMU': { - node('CPU') { - ws(per_exec_ws("tvm/build-qemu")) { - init_git() - sh "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh" - make(ci_qemu, 'build', '-j2') - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh" - } - } - } - } -} - -stage('Unit Test') { - parallel 'python3: GPU': { - node('TensorCore') { - ws(per_exec_ws("tvm/ut-python-gpu")) { - init_git() - unpack_lib('gpu', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_sphinx_precheck.sh" - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh" - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh" - } - } - } - }, - 'python3: i386': { - node('CPU') { - ws(per_exec_ws("tvm/ut-python-i386")) { - init_git() - unpack_lib('i386', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_unittest.sh" - sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration.sh" - sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_vta_fsim.sh" - } - } - } - }, - 'java: GPU': { - node('GPU') { - ws(per_exec_ws("tvm/ut-java")) { - init_git() - unpack_lib('gpu', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh" - } - } - } - } -} - stage('Integration Test') { - parallel 'topi: GPU': { - node('GPU') { - ws(per_exec_ws("tvm/topi-python-gpu")) { - init_git() - unpack_lib('gpu', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh" - } - } - } - }, - 'frontend: GPU': { - node('GPU') { - ws(per_exec_ws("tvm/frontend-python-gpu")) { - init_git() - unpack_lib('gpu', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh" - } - } - } - }, - 'frontend: CPU': { - node('CPU') { - ws(per_exec_ws("tvm/frontend-python-cpu")) { - init_git() - unpack_lib('cpu', tvm_multilib) - timeout(time: max_time, unit: 'MINUTES') { - sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_frontend_cpu.sh" - } - } - } - }, 'docs: GPU': { node('TensorCore') { ws(per_exec_ws("tvm/docs-python-gpu")) { @@ -332,14 +191,3 @@ stage('Build packages') { } */ -stage('Deploy') { - node('doc') { - ws(per_exec_ws("tvm/deploy-docs")) { - if (env.BRANCH_NAME == "main") { - unpack_lib('mydocs', 'docs.tgz') - sh "cp docs.tgz /var/docs/docs.tgz" - sh "tar xf docs.tgz -C /var/docs" - } - } - } -} From f4b1f1ebfb48e892e4922e5e5cdb6b41aa176d6c Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Wed, 21 Oct 2020 04:34:01 +0000 Subject: [PATCH 3/8] b --- tests/scripts/task_lint.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/scripts/task_lint.sh b/tests/scripts/task_lint.sh index deb9b9bde6c1..456686e827d3 100755 --- a/tests/scripts/task_lint.sh +++ b/tests/scripts/task_lint.sh @@ -26,7 +26,6 @@ cleanup() } trap cleanup 0 - echo "Checking file types..." python3 tests/lint/check_file_type.py From 158c2c9aa9c9c72b979440ec9163708abf458c35 Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Wed, 21 Oct 2020 04:34:38 +0000 Subject: [PATCH 4/8] b' --- Jenkinsfile | 152 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 4f460879f434..6cc0ae450773 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -158,7 +158,148 @@ def unpack_lib(name, libs) { """ } +stage('Build') { + parallel 'BUILD: GPU': { + node('GPUBUILD') { + ws(per_exec_ws("tvm/build-gpu")) { + init_git() + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu.sh" + make(ci_gpu, 'build', '-j2') + pack_lib('gpu', tvm_multilib) + // compiler test + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_config_build_gpu_vulkan.sh" + make(ci_gpu, 'build2', '-j2') + } + } + }, + 'BUILD: CPU': { + node('CPU') { + ws(per_exec_ws("tvm/build-cpu")) { + init_git() + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_config_build_cpu.sh" + make(ci_cpu, 'build', '-j2') + pack_lib('cpu', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_unittest.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_integration.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_fsim.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_vta_tsim.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_golang.sh" + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_rust.sh" + } + } + } + }, + 'BUILD: WASM': { + node('CPU') { + ws(per_exec_ws("tvm/build-wasm")) { + init_git() + sh "${docker_run} ${ci_wasm} ./tests/scripts/task_config_build_wasm.sh" + make(ci_wasm, 'build', '-j2') + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_wasm} ./tests/scripts/task_web_wasm.sh" + } + } + } + }, + 'BUILD : i386': { + node('CPU') { + ws(per_exec_ws("tvm/build-i386")) { + init_git() + sh "${docker_run} ${ci_i386} ./tests/scripts/task_config_build_i386.sh" + make(ci_i386, 'build', '-j2') + pack_lib('i386', tvm_multilib) + } + } + }, + 'BUILD: QEMU': { + node('CPU') { + ws(per_exec_ws("tvm/build-qemu")) { + init_git() + sh "${docker_run} ${ci_qemu} ./tests/scripts/task_config_build_qemu.sh" + make(ci_qemu, 'build', '-j2') + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_qemu} ./tests/scripts/task_python_microtvm.sh" + } + } + } + } +} + +stage('Unit Test') { + parallel 'python3: GPU': { + node('TensorCore') { + ws(per_exec_ws("tvm/ut-python-gpu")) { + init_git() + unpack_lib('gpu', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_sphinx_precheck.sh" + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_unittest_gpuonly.sh" + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_integration_gpuonly.sh" + } + } + } + }, + 'python3: i386': { + node('CPU') { + ws(per_exec_ws("tvm/ut-python-i386")) { + init_git() + unpack_lib('i386', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_unittest.sh" + sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_integration.sh" + sh "${docker_run} ${ci_i386} ./tests/scripts/task_python_vta_fsim.sh" + } + } + } + }, + 'java: GPU': { + node('GPU') { + ws(per_exec_ws("tvm/ut-java")) { + init_git() + unpack_lib('gpu', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_java_unittest.sh" + } + } + } + } +} + stage('Integration Test') { + parallel 'topi: GPU': { + node('GPU') { + ws(per_exec_ws("tvm/topi-python-gpu")) { + init_git() + unpack_lib('gpu', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_topi.sh" + } + } + } + }, + 'frontend: GPU': { + node('GPU') { + ws(per_exec_ws("tvm/frontend-python-gpu")) { + init_git() + unpack_lib('gpu', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_gpu} ./tests/scripts/task_python_frontend.sh" + } + } + } + }, + 'frontend: CPU': { + node('CPU') { + ws(per_exec_ws("tvm/frontend-python-cpu")) { + init_git() + unpack_lib('cpu', tvm_multilib) + timeout(time: max_time, unit: 'MINUTES') { + sh "${docker_run} ${ci_cpu} ./tests/scripts/task_python_frontend_cpu.sh" + } + } + } + }, 'docs: GPU': { node('TensorCore') { ws(per_exec_ws("tvm/docs-python-gpu")) { @@ -191,3 +332,14 @@ stage('Build packages') { } */ +stage('Deploy') { + node('doc') { + ws(per_exec_ws("tvm/deploy-docs")) { + if (env.BRANCH_NAME == "main") { + unpack_lib('mydocs', 'docs.tgz') + sh "cp docs.tgz /var/docs/docs.tgz" + sh "tar xf docs.tgz -C /var/docs" + } + } + } +} From 72a2186ce870dbd902508fcb7deeb7246aba7e02 Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Wed, 21 Oct 2020 06:15:08 +0000 Subject: [PATCH 5/8] c --- src/auto_scheduler/measure_record.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/auto_scheduler/measure_record.cc b/src/auto_scheduler/measure_record.cc index bdd2b369c6cf..10f50f15d9bb 100755 --- a/src/auto_scheduler/measure_record.cc +++ b/src/auto_scheduler/measure_record.cc @@ -53,7 +53,7 @@ struct Handler<::tvm::Array<::tvm::auto_scheduler::Stage>> { bool s; reader->BeginArray(); s = reader->NextArrayItem(); - CHECK(!s); + // CHECK(!s); } }; @@ -80,7 +80,7 @@ struct Handler<::tvm::Array<::tvm::auto_scheduler::Step>> { reader->BeginArray(); data->push_back(::tvm::auto_scheduler::StepReadFromRecord(reader)); s = reader->NextArrayItem(); - CHECK(!s); + // CHECK(!s); } } }; @@ -103,7 +103,7 @@ struct Handler<::tvm::auto_scheduler::StateNode> { CHECK(s); reader->Read(&data->transform_steps); s = reader->NextArrayItem(); - CHECK(!s); + // CHECK(!s); } }; @@ -129,7 +129,7 @@ struct Handler<::tvm::auto_scheduler::SearchTaskNode> { reader->Read(&str_value); data->target = ::tvm::Target(str_value); s = reader->NextArrayItem(); - CHECK(!s); + // CHECK(!s); } }; @@ -203,7 +203,7 @@ struct Handler<::tvm::auto_scheduler::MeasureResultNode> { CHECK(s); reader->Read(&data->timestamp); s = reader->NextArrayItem(); - CHECK(!s); + // CHECK(!s); } }; @@ -280,8 +280,8 @@ bool RecordReaderNode::ReadNext(MeasureInputNode* inp, MeasureResultNode* res) { // skip comment lines begin with '#' or ' ' continue; } - ReadMeasureRecord(cur_line_, inp, res, &log_version); LOG(WARNING) << cur_line_; + ReadMeasureRecord(cur_line_, inp, res, &log_version); return true; } From d2773bb65bd9b313a757657f1ad39ede0051ca01 Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Wed, 21 Oct 2020 06:26:37 +0000 Subject: [PATCH 6/8] d --- src/auto_scheduler/measure_record.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/auto_scheduler/measure_record.cc b/src/auto_scheduler/measure_record.cc index 10f50f15d9bb..901eb334c176 100755 --- a/src/auto_scheduler/measure_record.cc +++ b/src/auto_scheduler/measure_record.cc @@ -50,9 +50,9 @@ struct Handler<::tvm::Array<::tvm::auto_scheduler::Stage>> { } inline static void Read(dmlc::JSONReader* reader, ::tvm::Array<::tvm::auto_scheduler::Stage>* data) { - bool s; + // bool s; reader->BeginArray(); - s = reader->NextArrayItem(); + reader->NextArrayItem(); // CHECK(!s); } }; @@ -73,13 +73,12 @@ struct Handler<::tvm::Array<::tvm::auto_scheduler::Step>> { inline static void Read(dmlc::JSONReader* reader, ::tvm::Array<::tvm::auto_scheduler::Step>* data) { - bool s; reader->BeginArray(); data->clear(); while (reader->NextArrayItem()) { reader->BeginArray(); data->push_back(::tvm::auto_scheduler::StepReadFromRecord(reader)); - s = reader->NextArrayItem(); + bool s = reader->NextArrayItem(); // CHECK(!s); } } From 06d50a5f0b7beffc4c81837d48ce2b7798c32a10 Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Wed, 21 Oct 2020 06:30:10 +0000 Subject: [PATCH 7/8] e --- src/auto_scheduler/measure_record.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auto_scheduler/measure_record.cc b/src/auto_scheduler/measure_record.cc index 901eb334c176..ee122169ee0d 100755 --- a/src/auto_scheduler/measure_record.cc +++ b/src/auto_scheduler/measure_record.cc @@ -78,7 +78,7 @@ struct Handler<::tvm::Array<::tvm::auto_scheduler::Step>> { while (reader->NextArrayItem()) { reader->BeginArray(); data->push_back(::tvm::auto_scheduler::StepReadFromRecord(reader)); - bool s = reader->NextArrayItem(); + reader->NextArrayItem(); // CHECK(!s); } } From 67586108aa73dd6133e92da6732f3774758fb2fe Mon Sep 17 00:00:00 2001 From: Cody Yu Date: Wed, 21 Oct 2020 16:23:03 +0000 Subject: [PATCH 8/8] disable tutorials --- src/auto_scheduler/measure_record.cc | 20 +++++------ tests/scripts/task_lint.sh | 1 + .../auto_scheduler/tune_conv2d_layer_cuda.py | 36 +++++++++---------- tutorials/auto_scheduler/tune_matmul_x86.py | 8 ++--- 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/auto_scheduler/measure_record.cc b/src/auto_scheduler/measure_record.cc index ee122169ee0d..99c01b17e78e 100755 --- a/src/auto_scheduler/measure_record.cc +++ b/src/auto_scheduler/measure_record.cc @@ -50,10 +50,10 @@ struct Handler<::tvm::Array<::tvm::auto_scheduler::Stage>> { } inline static void Read(dmlc::JSONReader* reader, ::tvm::Array<::tvm::auto_scheduler::Stage>* data) { - // bool s; + bool s; reader->BeginArray(); - reader->NextArrayItem(); - // CHECK(!s); + s = reader->NextArrayItem(); + CHECK(!s); } }; @@ -73,13 +73,14 @@ struct Handler<::tvm::Array<::tvm::auto_scheduler::Step>> { inline static void Read(dmlc::JSONReader* reader, ::tvm::Array<::tvm::auto_scheduler::Step>* data) { + bool s; reader->BeginArray(); data->clear(); while (reader->NextArrayItem()) { reader->BeginArray(); data->push_back(::tvm::auto_scheduler::StepReadFromRecord(reader)); - reader->NextArrayItem(); - // CHECK(!s); + s = reader->NextArrayItem(); + CHECK(!s); } } }; @@ -102,7 +103,7 @@ struct Handler<::tvm::auto_scheduler::StateNode> { CHECK(s); reader->Read(&data->transform_steps); s = reader->NextArrayItem(); - // CHECK(!s); + CHECK(!s); } }; @@ -128,7 +129,7 @@ struct Handler<::tvm::auto_scheduler::SearchTaskNode> { reader->Read(&str_value); data->target = ::tvm::Target(str_value); s = reader->NextArrayItem(); - // CHECK(!s); + CHECK(!s); } }; @@ -155,7 +156,7 @@ struct Handler<::tvm::auto_scheduler::MeasureInputNode> { CHECK(s); reader->Read(state_node.get()); s = reader->NextArrayItem(); - // CHECK(!s); + CHECK(!s); data->task = ::tvm::auto_scheduler::SearchTask(task_node); data->state = ::tvm::auto_scheduler::State(state_node); @@ -202,7 +203,7 @@ struct Handler<::tvm::auto_scheduler::MeasureResultNode> { CHECK(s); reader->Read(&data->timestamp); s = reader->NextArrayItem(); - // CHECK(!s); + CHECK(!s); } }; @@ -279,7 +280,6 @@ bool RecordReaderNode::ReadNext(MeasureInputNode* inp, MeasureResultNode* res) { // skip comment lines begin with '#' or ' ' continue; } - LOG(WARNING) << cur_line_; ReadMeasureRecord(cur_line_, inp, res, &log_version); return true; } diff --git a/tests/scripts/task_lint.sh b/tests/scripts/task_lint.sh index 456686e827d3..deb9b9bde6c1 100755 --- a/tests/scripts/task_lint.sh +++ b/tests/scripts/task_lint.sh @@ -26,6 +26,7 @@ cleanup() } trap cleanup 0 + echo "Checking file types..." python3 tests/lint/check_file_type.py diff --git a/tutorials/auto_scheduler/tune_conv2d_layer_cuda.py b/tutorials/auto_scheduler/tune_conv2d_layer_cuda.py index b800eb469ec5..cb2126dec911 100644 --- a/tutorials/auto_scheduler/tune_conv2d_layer_cuda.py +++ b/tutorials/auto_scheduler/tune_conv2d_layer_cuda.py @@ -157,17 +157,17 @@ def conv2d_layer(N, H, W, CO, CI, KH, KW, stride, padding): # 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("conv2d.json", task.workload_key) +# inp, res = auto_scheduler.load_best("conv2d.json", 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)) +# 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) +# 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. @@ -176,19 +176,19 @@ def conv2d_layer(N, H, W, CO, CI, KH, KW, stride, padding): # In the example below we resume the status and do more 5 trials. -log_file = "conv2d.json" -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) +# log_file = "conv2d.json" +# 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 +# del measure_ctx diff --git a/tutorials/auto_scheduler/tune_matmul_x86.py b/tutorials/auto_scheduler/tune_matmul_x86.py index 35c47444e081..5c039b17a958 100644 --- a/tutorials/auto_scheduler/tune_matmul_x86.py +++ b/tutorials/auto_scheduler/tune_matmul_x86.py @@ -141,17 +141,17 @@ def matmul_add(N, L, M, dtype): # 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("matmul.json", task.workload_key) +# inp, res = auto_scheduler.load_best("matmul.json", 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)) +# 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) +# sch, args = task.compute_dag.apply_steps_from_state(inp.state) +# func = tvm.build(sch, args) ###################################################################### # A more complicated example is to resume the search.