Skip to content

Commit 5af7700

Browse files
author
yifan_shen3
committed
address review comments: 1. add arg help info; 2. add mutable buffer partition log
1 parent 1735a20 commit 5af7700

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

backends/apple/coreml/partition/coreml_partitioner.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ def partition(self, exported_program: ExportedProgram) -> PartitionResult:
9292

9393
tag_constant_data(exported_program)
9494
if self.take_over_mutable_buffer:
95+
logger.info(
96+
"Core ML partitioner will take over torch mutable buffer as Core ML state, "
97+
"so if your model contains mutable buffer, "
98+
"then you will need MacOS15+/iOS18+ to execute. "
99+
"If you want your mutable buffer model to be compatible with older OS, "
100+
"then please set `take_over_mutable_buffer=False`"
101+
)
95102
tag_mutated_buffer(exported_program)
96103

97104
return PartitionResult(

examples/models/llama2/export_llama_lib.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,11 @@ def build_args_parser() -> argparse.ArgumentParser:
281281
parser.add_argument("-V", "--vulkan", action="store_true")
282282
parser.add_argument("--mps", action="store_true")
283283
parser.add_argument("--coreml", action="store_true")
284-
parser.add_argument("--coreml-enable-state", action="store_true")
284+
parser.add_argument(
285+
"--coreml-enable-state",
286+
action="store_true",
287+
help="This option is only for coreml, and is only supported for MacOS15+/iOS18+",
288+
)
285289
parser.add_argument(
286290
"--qnn",
287291
action="store_true",

0 commit comments

Comments
 (0)