Skip to content

Commit ce0c2fb

Browse files
authored
Fixes per changes in mlc-ai/relax (#23)
This PR fixes the pass name that was changed from RemoveUnusedFunction to DeadCodeElimination. This PR also fixes two workloads in the MetaSchedule database that were corrupted because of one recent update of matmul legalization in mlc/relax.
1 parent fb2b4ac commit ce0c2fb

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def legalize_and_lift_params(
110110
)
111111

112112
mod = relax.pipeline.get_pipeline()(mod)
113-
mod = relax.transform.RemoveUnusedFunctions(entry_funcs)(mod)
113+
mod = relax.transform.DeadCodeElimination(entry_funcs)(mod)
114114
mod = relax.transform.LiftTransformParams()(mod)
115115
mod_transform, mod_deploy = utils.split_transform_deploy_mod(
116116
mod, model_names, entry_funcs
@@ -129,7 +129,7 @@ def build(mod: tvm.IRModule, args: Dict) -> None:
129129

130130
db = ms.database.create(work_dir=args.db_path)
131131
with args.target, db, tvm.transform.PassContext(opt_level=3):
132-
mod_deploy = relax.transform.MetaScheduleApplyDatabase()(mod)
132+
mod_deploy = relax.transform.MetaScheduleApplyDatabase(enable_warning=True)(mod)
133133

134134
debug_dump_script(mod_deploy, "mod_build_stage.py", args)
135135

log_db/database_workload.json

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

walkthrough.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@
674674
")\n",
675675
"\n",
676676
"# Clean up unused parts of the IRModule.\n",
677-
"mod = relax.transform.RemoveUnusedFunctions(entry_funcs)(mod)"
677+
"mod = relax.transform.DeadCodeElimination(entry_funcs)(mod)"
678678
]
679679
},
680680
{
@@ -1880,7 +1880,7 @@
18801880
"name": "python",
18811881
"nbconvert_exporter": "python",
18821882
"pygments_lexer": "ipython3",
1883-
"version": "3.8.16"
1883+
"version": "3.10.9"
18841884
}
18851885
},
18861886
"nbformat": 4,

web_stable_diffusion/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def split_transform_deploy_mod(
5757
else:
5858
mod_deploy[gv] = func
5959

60-
mod_transform = relax.transform.RemoveUnusedFunctions(transform_func_names)(
60+
mod_transform = relax.transform.DeadCodeElimination(transform_func_names)(
6161
mod_transform
6262
)
63-
mod_deploy = relax.transform.RemoveUnusedFunctions(mod_deploy_entry_func)(
63+
mod_deploy = relax.transform.DeadCodeElimination(mod_deploy_entry_func)(
6464
mod_deploy
6565
)
6666

0 commit comments

Comments
 (0)