comfyanonymous / ComfyUI

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface.
https://www.comfy.org/
GNU General Public License v3.0
56.07k stars 5.93k forks source link

fix intel ARC "aten::_upsample_bicubic2d_aa.out" & Flux to cpu #4154

Open cunkai opened 3 months ago

cunkai commented 3 months ago

Expected Behavior

Error occurred when executing IPAdapter:

Could not run 'aten::_upsample_bicubic2d_aa.out' with arguments from the 'XPU' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'aten::_upsample_bicubic2d_aa.out' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradHIP, AutogradXLA, AutogradMPS, AutogradIPU, AutogradXPU, AutogradHPU, AutogradVE, AutogradLazy, AutogradMTIA, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, AutogradMeta, AutogradNestedTensor, Tracer, AutocastCPU, AutocastXPU, AutocastCUDA, FuncTorchBatched, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

Actual Behavior

If you are using an Intel graphics card with ClipVision, switch to CPU mode. ARC graphics cards do not support bicubic, which will cause an error and prevent iPadAdapter from being used. I don’t understand Python, but after randomly changing it to CPU mode, everything runs smoothly.

1

2 ]()

修复

建议如果是intel显卡使用ClipVision就切换到CPU模式,ARC显卡不支持bicubic,会报错,导致ipadapter无法使用。我不懂python但是瞎改成cpu后,一切运行正常。

Steps to Reproduce

1

Debug Logs

1

Other

fix

sanhedasheng commented 3 months ago

I can't find the code "if model.load_device " in model_management.py , can tell the detail of where to modify this code?

Nuullll commented 1 month ago

FYI. I filed an issue for IPEX: https://github.com/intel/intel-extension-for-pytorch/issues/705