Skip to content

Commit

Permalink
fp32 as default data type because fp16 not fully supported (#2597)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2597

fp32 as default data type because fp16 not fully supported

Reviewed By: JacobSzwejbka

Differential Revision: D55258223

fbshipit-source-id: fee91743aa05f1c2e38d451c2bc146b2f7a31ff0
  • Loading branch information
mikekgfb authored and facebook-github-bot committed Mar 23, 2024
1 parent c071565 commit 126f918
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions examples/models/llama2/export_llama_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ def build_args_parser() -> argparse.ArgumentParser:
ckpt_dir = f"{Path(__file__).absolute().parent.as_posix()}"
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--output-dir", default=".", help="output directory")
parser.add_argument(
"-q", "--quantized_ckpt", default=None, help="quantized checkpoint file"
)
# parser.add_argument(
# "-q", "--quantized_ckpt", default=None, help="quantized checkpoint file"
# )
parser.add_argument(
"-E",
"--embedding-quantize",
Expand Down Expand Up @@ -396,8 +396,10 @@ def build_args_parser() -> argparse.ArgumentParser:
parser.add_argument(
"-d",
"--dtype-override",
default=None,
help="Override the dtype of the model (default is the checkpoint dtype). Options: fp16, fp32",
default="fp32",
type=str,
choices=["fp32"],
help="Override the dtype of the model (default is the checkpoint dtype). Options: fp32",
)

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

# source transforms
transforms = []
if args.quantized_ckpt or args.quantization_mode:
if args.quantization_mode:
modelname = f"{modelname}_q"
transforms.append(
partial(
Expand Down

0 comments on commit 126f918

Please sign in to comment.