Support ascend npu
closed https://github.com/comfyanonymous/ComfyUI/issues/5420. This PR was validated on Atlas 800T A2.
We need to install the Ascend Toolkit first.
Then run:
# setvers
source /usr/local/Ascend/ascend-toolkit/set_env.sh
# intsall dependencies
pip install -r requirements.txt
# run
python main.py
We use the default workflow and get the following results:
Collaborators
@YukMingLaw @starmountain1997
Related PR: https://github.com/comfyanonymous/ComfyUI/pull/5273
PTAL : ) @comfyanonymous
@comfyanonymous PTAL
I believe this PR already covered https://github.com/comfyanonymous/ComfyUI/pull/3449 and https://github.com/comfyanonymous/ComfyUI/pull/5273 .
@statelesshz I think you can also add the co-auth in this PR by append coauther:
Co-authored-by: YukMingLaw <[email protected]>
Co-authored-by: starmountain1997 <[email protected]>
Closes: https://github.com/comfyanonymous/ComfyUI/pull/3449
Closes: https://github.com/comfyanonymous/ComfyUI/pull/5273
Closes: https://github.com/comfyanonymous/ComfyUI/issues/5420
According to https://github.com/comfyanonymous/ComfyUI/issues/5420#issuecomment-2445688567 from @comfyanonymous
If someone can confirm that this PR works I will merge it.
We validated the PR on Ascend NPU, it works. Would you mind merging this? Thanks!
@comfyanonymous
I have merged the latest codes to this commit, and have tested it on NPU (Atlas 300T A2), the result showed it worked well.
Would you mind merging this? The test logs and images are shown below:
(comfyui) xxx:~/github/ComfyUI$ python main.py
Total VRAM 62432 MB, total RAM 1547363 MB
pytorch version: 2.4.0
Set vram state to: NORMAL_VRAM
Device: npu
Using pytorch cross attention
[Prompt Server] web root: /home/sss/github/ComfyUI/web
...
Starting server
To see the GUI go to: http://127.0.0.1:8188
got prompt
model weight dtype torch.float16, manual cast: None
model_type EPS
Using pytorch attention in VAE
Using pytorch attention in VAE
Requested to load SDXLClipModel
loaded completely 9.5367431640625e+25 1560.802734375 True
Requested to load SDXL
loaded completely 9.5367431640625e+25 4897.0483474731445 True
5%|███████▋ | 1/20 [00:07<02:13, 7.00s/it]100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [01:42<00:00, 5.11s/it]
Requested to load AutoencoderKL
loaded completely 9.5367431640625e+25 159.55708122253418 True
Prompt executed in 128.64 seconds
merge this ! please !
Rebase my commits to master HEAD to resolve merge conflicts.
Hey @comfyanonymous @ltdrdata Is this PR still under review? Let me know if there is anything else I need to do.
From the feedback from the community, many users expect to use ComfyUI on Ascend NPU. Since https://github.com/comfyanonymous/ComfyUI/pull/3449 and https://github.com/comfyanonymous/ComfyUI/pull/5273 are no longer active, I submitted this PR and hope it can be merged as soon as possible. Thanks