[GH-ISSUE #93] NAN issue using FP16 to load the model #84

Open
opened 2026-10-26 21:07:36 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @zitgit on GitHub (Oct 25, 2024).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V2/issues/93

when I changed the torch_dtype of the loading function from torch.bfloat16 to torch.float16,
which is
model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True, device_map="sequential", torch_dtype=torch.float16,
The inference wont work. Activation will contain Nan. Is this a known issue?
env: A100*8; transformers Version: 4.44.0

Originally created by @zitgit on GitHub (Oct 25, 2024). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V2/issues/93 when I changed the torch_dtype of the loading function from torch.bfloat16 to torch.float16, which is model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True, device_map="sequential", torch_dtype=torch.float16, The inference wont work. Activation will contain Nan. Is this a known issue? env: A100*8; transformers Version: 4.44.0
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-V2#84
No description provided.