Skip to content

Commit

Permalink
ALways export in fp32 base dtype on CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
volcacius committed Jul 17, 2023
1 parent a4881df commit 5fe532f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/brevitas_examples/llm/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,8 @@ def main():

if args.export_target:
print(f"Export to {args.export_target}")
# Currently we always export on CPU with a float32 container to avoid float16 CPU errors
model = model.cpu().to(dtype=torch.float32)
model_export(model, calibration_loader[0], args)


Expand Down

0 comments on commit 5fe532f

Please sign in to comment.