Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
Reenable autotvm silencer; fix e2e_auto_tir.py; fix lint.
Browse files Browse the repository at this point in the history
Co-authored-by: YuchenJin <[email protected]>
  • Loading branch information
sunggg and YuchenJin committed Oct 18, 2022
1 parent 2963787 commit c6d6a06
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
19 changes: 11 additions & 8 deletions apps/relax_examples/e2e_auto_tir.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,21 @@ def main():
relax_mod = apply_opt_before_tuning(relay_mod, params, target=ARGS.target)
assert isinstance(relax_mod, tvm.IRModule)

executable = ms.tune_relax(
db = ms.relax_integration.tune_relax(
mod=relax_mod,
target=ARGS.target,
config=ms.TuneConfig(
strategy="evolutionary",
num_trials_per_iter=64,
max_trials_per_task=ARGS.num_trials,
max_trials_global=ARGS.num_trials,
),
params=params,
num_trials_per_iter=64,
max_trials_per_task=ARGS.num_trials,
max_trials_global=ARGS.num_trials,
runner=get_runner(),
work_dir=ARGS.work_dir,
num_threads=os.cpu_count(),
)
executable = ms.relax_integration.compile_relax(
db,
mod=relax_mod,
target=ARGS.target,
params=params,
)

for input_name, input_shape in input_info.items():
Expand Down
3 changes: 2 additions & 1 deletion python/tvm/relax/testing/relay_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from tvm.relay.backend.te_compiler import select_implementation
from tvm.runtime import NDArray
from tvm.target import Target
from tvm.meta_schedule.relay_integration import _autotvm_silencer


def from_relay(
Expand Down Expand Up @@ -196,7 +197,7 @@ def visit_func(node):

# Since optimization passes and OpStrategy are highly context-dependent,
# we match the exact same context with `extract_task_from_relay()` env
with tvm.transform.PassContext(
with _autotvm_silencer(), tvm.transform.PassContext(
opt_level=opt_level,
config=pass_config,
disabled_pass=disabled_pass,
Expand Down
3 changes: 0 additions & 3 deletions python/tvm/relax/transform/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
import numpy as np
import tvm.ir
from tvm.runtime import NDArray
from tvm.target import Target
from tvm.meta_schedule.database import PyDatabase

from . import _ffi_api


Expand Down

0 comments on commit c6d6a06

Please sign in to comment.