Skip to content

Commit

Permalink
Remove to_server (#854)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: facebookincubator/AITemplate#854

Reviewed By: ydwu4

Differential Revision: D47810737

fbshipit-source-id: 3128cfd206b9e3b9de05de0c09dab74a5e05f5e0
  • Loading branch information
angelayi authored and facebook-github-bot committed Jul 27, 2023
1 parent d55bac7 commit b1a389c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 25 deletions.
2 changes: 0 additions & 2 deletions exir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
CaptureConfig,
EdgeCompileConfig,
ExecutorchBackendConfig,
ServerCompileConfig,
)
from executorch.exir.emit import emit_program, EmitterOutput
from executorch.exir.program import (
Expand Down Expand Up @@ -44,7 +43,6 @@
"MultiMethodExecutorchProgram",
"CaptureConfig",
"EdgeCompileConfig",
"ServerCompileConfig",
"ExecutorchBackendConfig",
"Value",
"serialize_to_flatbuffer",
Expand Down
2 changes: 0 additions & 2 deletions exir/capture/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
CaptureConfig,
EdgeCompileConfig,
ExecutorchBackendConfig,
ServerCompileConfig,
)
from executorch.exir.capture._unlift import unlift_exported_program_lifted_states

Expand All @@ -14,7 +13,6 @@
"capture_multiple",
"CaptureConfig",
"EdgeCompileConfig",
"ServerCompileConfig",
"ExecutorchBackendConfig",
"unlift_exported_program_lifted_states",
]
6 changes: 0 additions & 6 deletions exir/capture/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ class EdgeCompileConfig:
_use_edge_ops: bool = False


@compatibility(is_backward_compatible=False)
@dataclass
class ServerCompileConfig:
passes: List[PassType] = field(default_factory=list)


@compatibility(is_backward_compatible=False)
@dataclass
class ExecutorchBackendConfig:
Expand Down
16 changes: 1 addition & 15 deletions exir/program/_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

import torch
import torch._export
from executorch.exir.capture._config import (
EdgeCompileConfig,
ExecutorchBackendConfig,
ServerCompileConfig,
)
from executorch.exir.capture._config import EdgeCompileConfig, ExecutorchBackendConfig
from executorch.exir.emit import emit_program, EmitterOutput
from executorch.exir.error import ExportError
from executorch.exir.pass_manager import PassManager, PassType
Expand Down Expand Up @@ -66,16 +62,6 @@ def to_edge(
def dump(self) -> None:
print(self.exported_program.graph_module.graph)

def _to_server(
self, config: Optional[ServerCompileConfig] = None
) -> torch.nn.Module:
config = config or ServerCompileConfig()
res = PassManager(config.passes)(self.exported_program.graph_module)
assert res is not None
# TODO ServerDialectGraphModule
# return graph_module now.
return res.graph_module

def to_executorch(
self,
config: Optional[ExecutorchBackendConfig] = None,
Expand Down

0 comments on commit b1a389c

Please sign in to comment.