Skip to content

Commit 3822ff1

Browse files
Michael Gschwindfacebook-github-bot
authored andcommitted
fp32 as default data type because fp16 not fully supported (#2597)
Summary: fp32 as default data type because fp16 not fully supported Reviewed By: JacobSzwejbka Differential Revision: D55258223
1 parent 14e31f0 commit 3822ff1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

examples/models/llama2/export_llama_lib.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ def build_args_parser() -> argparse.ArgumentParser:
290290
ckpt_dir = f"{Path(__file__).absolute().parent.as_posix()}"
291291
parser = argparse.ArgumentParser()
292292
parser.add_argument("-o", "--output-dir", default=".", help="output directory")
293-
parser.add_argument(
294-
"-q", "--quantized_ckpt", default=None, help="quantized checkpoint file"
295-
)
293+
# parser.add_argument(
294+
# "-q", "--quantized_ckpt", default=None, help="quantized checkpoint file"
295+
# )
296296
parser.add_argument(
297297
"-E",
298298
"--embedding-quantize",
@@ -396,8 +396,10 @@ def build_args_parser() -> argparse.ArgumentParser:
396396
parser.add_argument(
397397
"-d",
398398
"--dtype-override",
399-
default=None,
400-
help="Override the dtype of the model (default is the checkpoint dtype). Options: fp16, fp32",
399+
default="fp32",
400+
type=str,
401+
choices=["fp32"],
402+
help="Override the dtype of the model (default is the checkpoint dtype). Options: fp32",
401403
)
402404

403405
parser.add_argument(
@@ -495,7 +497,7 @@ def _prepare_for_llama_export(modelname: str, args) -> LlamaEdgeManager:
495497

496498
# source transforms
497499
transforms = []
498-
if args.quantized_ckpt or args.quantization_mode:
500+
if args.quantization_mode:
499501
modelname = f"{modelname}_q"
500502
transforms.append(
501503
partial(

0 commit comments

Comments
 (0)