mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-08 13:39:48 +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':
|
if mode == 'long_context':
|
||||||
assert config.architectures[0] == "LlamaForCausalLM", "only LlamaForCausalLM support long_context mode"
|
assert config.architectures[0] == "LlamaForCausalLM", "only LlamaForCausalLM support long_context mode"
|
||||||
torch.set_default_dtype(torch.float16)
|
torch.set_default_dtype(torch.float16)
|
||||||
elif xpu_fp16_model(config):
|
# elif xpu_fp16_model(config):
|
||||||
torch.set_default_dtype(torch.float16)
|
# # using FP16 may cause accuracy issues, triggering core dumped during runtime
|
||||||
|
# torch.set_default_dtype(torch.float16)
|
||||||
else:
|
else:
|
||||||
torch.set_default_dtype(config.torch_dtype)
|
torch.set_default_dtype(config.torch_dtype)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue