Skip to content

Commit

Permalink
[Fix] Remove redundant "remove_all_unused" in IPC memory lowering (#1…
Browse files Browse the repository at this point in the history
…6771)

This commit removes the redundant invocation of `remove_all_unused`
function in the GPU IPC memory allocation lowering pass. This is
because the pass only mutates one call at a time, and thus will
not introduce new unused bindings.
  • Loading branch information
MasterJH5574 authored Mar 23, 2024
1 parent 1223989 commit 134f8fd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
2 changes: 0 additions & 2 deletions python/tvm/relax/transform/ipc_allreduce_rewrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import tvm
from tvm import relax
from tvm.ir.module import IRModule
from tvm.relax.analysis import remove_all_unused
from tvm.relax.expr import Expr, Var
from tvm.relax.expr_functor import PyExprMutator, PyExprVisitor, mutator, visitor

Expand Down Expand Up @@ -138,7 +137,6 @@ def transform(self) -> IRModule:
for g_var, func in self.mod.functions_items():
if isinstance(func, relax.Function):
updated_func = self.visit_expr(func)
updated_func = remove_all_unused(updated_func)
self.builder_.update_func(g_var, updated_func)
return self.builder_.get()

Expand Down
2 changes: 0 additions & 2 deletions python/tvm/relax/transform/lower_gpu_ipc_alloc_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import tvm
from tvm import relax
from tvm.ir.module import IRModule
from tvm.relax.analysis import remove_all_unused
from tvm.relax.expr import Expr
from tvm.relax.expr_functor import PyExprMutator, mutator

Expand Down Expand Up @@ -49,7 +48,6 @@ def transform(self) -> IRModule:
for g_var, func in self.mod.functions_items():
if isinstance(func, relax.Function):
updated_func = self.visit_expr(func)
updated_func = remove_all_unused(updated_func)
self.builder_.update_func(g_var, updated_func)
return self.builder_.get()

Expand Down

0 comments on commit 134f8fd

Please sign in to comment.