Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TE][BuildModule] Fix import in dump pass ir #5327

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions python/tvm/target/build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ def dump(*args, **kwargs):

def decorate_irpass(self):
"""decorate ir_pass and ScheduleOps"""
self._old_sgpass = schedule.ScheduleOps
schedule.ScheduleOps = self.decorate(schedule.ScheduleOps)
vset = vars(ir_pass)
self._old_sgpass = tvm.te.schedule.ScheduleOps
tvm.te.schedule.ScheduleOps = self.decorate(tvm.te.schedule.ScheduleOps)
vset = vars(tvm.tir.ir_pass)
k = v = 0
def recover():
vset[k] = v
for k, v in vset.items():
self._recover_list.append(recover)
vset[k] = self.decorate(v) if isinstance(v, Function) else v
vset[k] = self.decorate(v) if isinstance(v, tvm.runtime.PackedFunc) else v

def decorate_custompass(self, custom_pass):
"""decorate given list of custom passes, and return decorated passes"""
Expand All @@ -93,7 +93,7 @@ def exit(self):
# recover decorated functions
for f in self._recover_list:
f()
schedule.ScheduleOps = self._old_sgpass
tvm.te.schedule.ScheduleOps = self._old_sgpass
DumpIR.scope_level -= 1


Expand Down