Intel Gpu support initialization (#4340)
This commit is contained in:
parent
317e2c857e
commit
778a010df8
14 changed files with 106 additions and 42 deletions
|
@ -1,5 +1,6 @@
|
|||
from pathlib import Path
|
||||
|
||||
from accelerate import is_xpu_available
|
||||
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
||||
|
||||
import modules.shared as shared
|
||||
|
@ -41,7 +42,7 @@ def load_quantized(model_name):
|
|||
# Define the params for AutoGPTQForCausalLM.from_quantized
|
||||
params = {
|
||||
'model_basename': pt_path.stem,
|
||||
'device': "cuda:0" if not shared.args.cpu else "cpu",
|
||||
'device': "xpu:0" if is_xpu_available() else "cuda:0" if not shared.args.cpu else "cpu",
|
||||
'use_triton': shared.args.triton,
|
||||
'inject_fused_attention': not shared.args.no_inject_fused_attention,
|
||||
'inject_fused_mlp': not shared.args.no_inject_fused_mlp,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue