Skip to content

fix the example backend #664

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

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion backends/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The folder structure incluces:
- example_partitioner
- example_backend
- examples_operators. Assuming all of them can run in the example backend.
- The OpBase defined in op_base.py is just the draft idea, it can be defined more comprehensively depending tosa operator definitions
- The OpBase defined in op_base.py is just the draft idea, it can be defined more comprehensively depending example operator definitions
- example_backend_delegate_passes. It includes passes that might be helpful in the backend. Right now there are two passes: merge_to_dim_pass.py and permute_memory_formats_pass.py. They are examples to show how to represent memory format permutation and how to represent operators with different memory format (like channel last)
- merge_to_dim_pass.py only handles one merging cases. More cases need to be covered but should be straitforward.

Expand Down
4 changes: 2 additions & 2 deletions backends/example/example_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@


@final
class TosaBackend(BackendDetails):
class ExampleBackend(BackendDetails):
@staticmethod
def preprocess(
edge_program: ExportedProgram,
compile_specs: List[CompileSpec],
) -> PreprocessResult:
print("entering the lowerable parts in TosaBackend.preprocess....")
print("entering the lowerable parts in ExampleBackend.preprocess....")

copy_edge_program = copy.deepcopy(edge_program)
copy_edge_program._transform(
Expand Down
4 changes: 2 additions & 2 deletions backends/example/example_partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Dict, final

import torch
from executorch.backends.example.example_backend import TosaBackend
from executorch.backends.example.example_backend import ExampleBackend
from executorch.backends.example.example_operators.ops import module_to_annotator
from executorch.exir.backend.canonical_partitioners.pattern_op_partitioner import (
generate_partitions_from_list_of_nodes,
Expand All @@ -32,7 +32,7 @@ class ExamplePartitioner(Partitioner):

def __init__(self) -> None:
self.patterns = module_to_annotator.keys()
self.delegation_spec = DelegationSpec(TosaBackend.__name__, [])
self.delegation_spec = DelegationSpec(ExampleBackend.__name__, [])

class DequantQuantOperatorSupport(OperatorSupportBase):
def is_node_supported(self, _submodules, node: torch.fx.Node) -> bool:
Expand Down