Skip to content

Fix handling constant inputs when delegating #3031

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
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
14 changes: 7 additions & 7 deletions exir/lowered_backend_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,17 +454,17 @@ def _get_new_signature( # noqa: C901
new_state_dict = {}
new_constants = {}

input_tensor_node_to_sig = {
input_spec.arg.name: input_spec
for input_spec in old_signature.input_specs
if isinstance(input_spec.arg, TensorArgument)
}
placeholder_nodes = [
node.name for node in original_program.graph.nodes if node.op == "placeholder"
]
assert len(placeholder_nodes) == len(old_signature.input_specs)
input_node_to_sig = dict(zip(placeholder_nodes, old_signature.input_specs))

for node in gm.graph.nodes:
is_tagged = tag is None or node.meta.get("delegation_tag", None) == tag
if node.op == "placeholder":

if node.name not in input_tensor_node_to_sig:
if node.name not in input_node_to_sig:
assert tag is not None
input_specs.append(
InputSpec(
Expand All @@ -475,7 +475,7 @@ def _get_new_signature( # noqa: C901
)
continue

orig_input_spec = input_tensor_node_to_sig[node.name]
orig_input_spec = input_node_to_sig[node.name]

if not isinstance(orig_input_spec.arg, TensorArgument):
input_specs.append(orig_input_spec)
Expand Down