Skip to content

Commit 02b2179

Browse files
authored
handle device settings for ET export (#732)
* handle device settings for ET export * tab/spc
1 parent a196ca8 commit 02b2179

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

export.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,12 @@ def main(args):
4848
output_pte_path = args.output_pte_path
4949
output_dso_path = args.output_dso_path
5050

51-
if output_dso_path and "mps" in builder_args.device:
51+
if output_pte_path and builder_args.device != "cpu":
52+
print(
53+
f"Warning! ExecuTorch export target is controlled by export recipe, not device setting. Ignoring device={builder_args.device} setting."
54+
)
55+
builder_args.device = "cpu"
56+
elif "mps" in builder_args.device:
5257
print("Warning! Device MPS not supported for export. Exporting for device CPU.")
5358
builder_args.device = "cpu"
5459

0 commit comments

Comments
 (0)