Skip to content

Commit 98692bf

Browse files
committed
Warn if wrong type is given for Llama export for XNNPACK
Followup to #7775
1 parent a3455d9 commit 98692bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/models/llama/export_llama_lib.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,12 @@ def _validate_args(args):
674674
"If you need this feature, please file an issue."
675675
)
676676

677+
if args.xnnpack:
678+
if args.dtype_override not in [DType.fp32, DType.fp16]:
679+
raise ValueError(
680+
f"XNNPACK supports either fp32 or fp16 dtypes only for now. Given {args.dtype_override}."
681+
)
682+
677683

678684
def _export_llama(args) -> LLMEdgeManager: # noqa: C901
679685
_validate_args(args)

0 commit comments

Comments
 (0)