Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions backends/aoti/aoti_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from executorch.exir._warnings import experimental
from executorch.exir.backend.backend_details import ExportedProgram, PreprocessResult
from executorch.exir.backend.compile_spec_schema import CompileSpec
from executorch.exir.graph_module import contains_any_op
from torch._inductor.codegen.cpp_wrapper_cpu import CppWrapperCpu
from torch.export.passes import move_to_device_pass

Expand Down Expand Up @@ -248,8 +249,12 @@ def preprocess(
else:
custom_pass(device_edge_program.graph_module)

# Run decompositions if any
if decomposition_table:
# ``run_decompositions`` retraces the complete ExportedProgram even
# when none of the table's operators occur in the graph. Large CUDA
# models make that no-op expensive, so only run it when it can apply.
if contains_any_op(
device_edge_program.graph_module, decomposition_table.keys()
):
device_edge_program = device_edge_program.run_decompositions(
decomposition_table
)
Expand Down
1 change: 0 additions & 1 deletion backends/cuda/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ fbcode_target(
srcs = [
"passes/__init__.py",
"passes/move_cond_predicate_to_cpu.py",
"passes/replace_int64_floordiv.py",
],
visibility = [
"//executorch/backends/cuda/...",
Expand Down
5 changes: 1 addition & 4 deletions backends/cuda/cuda_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
from executorch.backends.cuda.passes.move_cond_predicate_to_cpu import (
MoveCondPredicateToCpuPass,
)
from executorch.backends.cuda.passes.replace_int64_floordiv import (
ReplaceInt64FloorDivWithFloatPass,
)
from executorch.backends.cuda.triton.replacement_pass import (
ReplaceEdgeOpWithTritonOpPass,
)
Expand Down Expand Up @@ -568,7 +565,7 @@ def get_custom_passes(cls, compile_specs: List[CompileSpec]) -> List[typing.Any]
f"Invalid triton_kernel_mode: {mode}. Expected 'ON' or 'OFF'."
)
triton_kernel_mode = mode
passes = [MoveCondPredicateToCpuPass(), ReplaceInt64FloorDivWithFloatPass()]
passes = [MoveCondPredicateToCpuPass()]
if triton_kernel_mode == "ON":
passes.append(ReplaceEdgeOpWithTritonOpPass())
return passes
Expand Down
152 changes: 0 additions & 152 deletions backends/cuda/passes/replace_int64_floordiv.py

This file was deleted.

Loading
Loading