Skip to content

make the graph comilation based on xnnpack compile config #2452

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
6 changes: 5 additions & 1 deletion backends/xnnpack/partition/graphs/bilinear_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import executorch.exir as exir
import torch

from executorch.backends.xnnpack.utils.configs import get_xnnpack_edge_compile_config


@lru_cache(maxsize=None)
def _get_bilinear_2d_graphs():
Expand Down Expand Up @@ -37,7 +39,9 @@ def forward(self, x):
for config in capture_configs:
edge = exir.capture(
bilinear2d(align_corners), sample_inputs, config
).to_edge()
).to_edge(
config=get_xnnpack_edge_compile_config(),
)
_bilinear2d_graphs[edge.exported_program.graph_module] = align_corners
return _bilinear2d_graphs

Expand Down
4 changes: 3 additions & 1 deletion backends/xnnpack/partition/graphs/sdpa.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from typing import List, Optional

import torch
from executorch.backends.xnnpack.utils.configs import get_xnnpack_edge_compile_config
from executorch.exir import to_edge
from torch import Tensor
from torch.export import export
Expand Down Expand Up @@ -75,7 +76,8 @@ def forward(
v,
mask,
),
)
),
compile_config=get_xnnpack_edge_compile_config(),
)
gm = edge.exported_program().graph_module
graphs.append(gm)
Expand Down