mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-08 05:29:29 +00:00
Merge pull request #1409 from rnwang04/fix_fp16
revert using FP16 in XPU
This commit is contained in:
commit
f96aab3c85
1 changed files with 3 additions and 2 deletions
|
@ -79,8 +79,9 @@ def local_chat(
|
|||
if mode == 'long_context':
|
||||
assert config.architectures[0] == "LlamaForCausalLM", "only LlamaForCausalLM support long_context mode"
|
||||
torch.set_default_dtype(torch.float16)
|
||||
elif xpu_fp16_model(config):
|
||||
torch.set_default_dtype(torch.float16)
|
||||
# elif xpu_fp16_model(config):
|
||||
# # using FP16 may cause accuracy issues, triggering core dumped during runtime
|
||||
# torch.set_default_dtype(torch.float16)
|
||||
else:
|
||||
torch.set_default_dtype(config.torch_dtype)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue