Stage1st

标题: AMD GPU 直接跑 CUDA的ZLUDA宣布开源(更新winzluda sd使用方式) [打印本页]

作者: zxc786    时间: 2024-2-16 02:09
标题: AMD GPU 直接跑 CUDA的ZLUDA宣布开源(更新winzluda sd使用方式)
本帖最后由 zxc786 于 2024-2-18 17:53 编辑

https://blog.gslin.org/archives/2024/02/13/11655/%E8%AE%93-intelamd-gpu-%E7%9B%B4%E6%8E%A5%E8%B7%91-cuda-%E7%A8%8B%E5%BC%8F%E7%9A%84-zluda/
先前提過「在 Intel 內顯上面直接跑 CUDA 程式的 ZLUDA」,結果後來事情大翻轉,AMD 跑去贊助專案,變成支援 AMD GPU 了:「AMD Quietly Funded A Drop-In CUDA Implementation Built On ROCm: It's Now Open-Source」,專案在 GitHubvosen/ZLUDA 這邊,而這包支援 AMD GPU 的 commit log 則是在 1b9ba2b2333746c5e2b05a2bf24fa6ec3828dcdf 這包巨大的 commit:
Nobody expects the Red Team
Too many changes to list, but broadly:
* Remove Intel GPU support from the compiler
* Add AMD GPU support to the compiler
* Remove Intel GPU host code
* Add AMD GPU host code
* More device instructions. From 40 to 68
* More host functions. From 48 to 184
* Add proof of concept implementation of OptiX framework
* Add minimal support of cuDNN, cuBLAS, cuSPARSE, cuFFT, NCCL, NVML
* Improve ZLUDA launcher for Windows
其中的轉折以及後續的故事其實還蠻不知道怎麼說的... 作者一開始在 Intel 上班,弄一弄 Intel 覺得這沒前景,然後 AMD 接觸後贊助這個專案,到後面也覺得沒前景,於是依照後來跟 AMD 的合約,如果 AMD 覺得沒前景,可以 open source 出來:
Why is this project suddenly back after 3 years? What happened to Intel GPU support?
In 2021 I was contacted by Intel about the development od ZLUDA. I was an Intel employee at the time. While we were building a case for ZLUDA internally, I was asked for a far-reaching discretion: not to advertise the fact that Intel was evaluating ZLUDA and definitely not to make any commits to the public ZLUDA repo. After some deliberation, Intel decided that there is no business case for running CUDA applications on Intel GPUs.
Shortly thereafter I got in contact with AMD and in early 2022 I have left Intel and signed a ZLUDA development contract with AMD. Once again I was asked for a far-reaching discretion: not to advertise the fact that AMD is evaluating ZLUDA and definitely not to make any commits to the public ZLUDA repo. After two years of development and some deliberation, AMD decided that there is no business case for running CUDA applications on AMD GPUs.
One of the terms of my contract with AMD was that if AMD did not find it fit for further development, I could release it. Which brings us to today.
這個其實還蠻好理解的,CUDA 畢竟是 Nvidia 家的 ecosystem,除非你反超越後自己定義一堆自家專屬的功能 (像是當年 MicrosoftIE 上的玩法),不然只是幫人抬轎。
Phoronix 在 open source 前幾天先拿到軟體進行測試,而他這幾天測試的結果給了「頗不賴」的評價:
Andrzej Janik reached out and provided access to the new ZLUDA implementation for AMD ROCm to allow me to test it out and benchmark it in advance of today's planned public announcement. I've been testing it out for a few days and it's been a positive experience: CUDA-enabled software indeed running atop ROCm and without any changes. Even proprietary renderers and the like working with this "CUDA on Radeon" implementation.
另外為了避免測試時有些測試軟體會回傳到伺服器造成資訊外洩,ZLUDA 在這邊故意設定為 Graphics Device,而在這次 open source 公開後會改回正式的名稱:
In my screenshots and for the past two years of development the exposed device name for Radeon GPUs via CUDA has just been "Graphics Device" rather than the actual AMD Radeon graphics adapter with ROCm. The reason for this has been due to CUDA benchmarks auto-reporting results and other software that may have automated telemetry, to avoid leaking the fact of Radeon GPU use under CUDA, it's been set to the generic "Graphics Device" string. I'm told as part of today's open-sourcing of this ZLUDA on Radeon code that the change will be in place to expose the actual Radeon graphics card string rather than the generic "Graphics Device" concealer.
作者的測試看起來在不同的測試項目下差異頗大,但如果依照作者的計算方式,整體效能跟 OpenCL 版本差不多:
Phoronix 那邊則是做了與 Nvidia 比較的測試... 這邊拿的是同樣都有支援 Nvidia 與 AMD 家的卡的 Blender 測試,然後跑出來的結果讓人傻眼,透過 ZLUDA 轉譯出來的速度比原生支援的速度還快,這 optimization 看起來又有得討論了:(這是 BMW27 的測試,在 Classroom 的測試也發現一樣的情況)
但即使如此,CUDA over AMD GPU 應該還是不會起來,官方會儘量讓各 framework 原生支援,而大多數的開發者都是在 framework 上面開發,很少會自己從頭幹...

---------------------
【【Stable diffusion】windows下A卡AI绘画终于有救了?据测windows/zluda效率堪比linux/rocm。】
https://www.bilibili.com/video/B ... 6e2af1f245c5c17b664

AMD YES!Stable diffusionA卡可以满血WINDOWS上跑了。
------
【【Stable diffusion】AMD显卡windows下使用Zluda运行SD简易教程】
https://www.bilibili.com/video/BV1MW421N7gP/?share_source=copy_web&vd_source=919509e8ee7f16e2af1f245c5c17b664
做了个简单教程。




作者: sunbeach    时间: 2024-2-16 02:29
没前景可能是因为现在都没人学cuda了?
作者: 呀~~~呀嘿!    时间: 2024-2-16 07:22
ZLUDA这个怎么读,塞尔达?

论坛助手,iPhone
作者: citrus    时间: 2024-2-16 11:41
ゼルダ,没毛病
作者: 骆宾王    时间: 2024-2-16 12:42
呀~~~呀嘿! 发表于 2024-2-16 07:22
ZLUDA这个怎么读,塞尔达?

论坛助手,iPhone

祖鲁达!
作者: QShen    时间: 2024-2-16 14:27
现在各个框架基本都原生支持rocm了,后面优化肯定也都基于原生版本优化。这个确实实用价值不大了,即使现在一些场景性能优于原生rocm版本
作者: zxc786    时间: 2024-2-16 18:58
Reddit有人试了下sd.next用zluda跑,1024x1024 大约3s。
作者: 红焖菠菜    时间: 2024-2-16 20:32
amd能不能出个48g显存的消费级显卡给皮衣黄上点压力啊。
这几天玩本地ai对话深感24g显存不够用

—— 来自 samsung SM-S9180, Android 14上的 S1Next-鹅版 v2.5.4
作者: 麦迪是条狗    时间: 2024-2-16 22:00
a卡翻身了?
作者: geeky_kappa    时间: 2024-2-16 22:05
麦迪是条狗 发表于 2024-2-16 22:00
a卡翻身了?

A卡特色软件一泡污,闭源不如开源
作者: zxc786    时间: 2024-2-16 22:06
本帖最后由 zxc786 于 2024-2-16 22:08 编辑
麦迪是条狗 发表于 2024-2-16 22:00
a卡翻身了?

不知道,暂时还没看到测试,但确实支持了,在win下跑SD效率几乎和同等级N卡差不多了。
https://github.com/vladmandic/au ... 3071bf1d0e3cc558eea
https://github.com/vladmandic/automatic/wiki/ZLUDA



作者: omnitoken    时间: 2024-2-16 22:13
笑死, 这还是个rust项目

buff叠满了这是
作者: 粉色猛男    时间: 2024-2-17 00:33
什么,我A卡终于能玩AI了吗
作者: zxc786    时间: 2024-2-17 01:05
本帖最后由 zxc786 于 2024-2-17 01:34 编辑
粉色猛男 发表于 2024-2-17 00:33
什么,我A卡终于能玩AI了吗

https://discord.com/invite/sd-ne ... 1101998836328697867
看了下DISCORD的讨论,速度和LINUX/ROCM差不多吧,但有大佬晒出来效率比linux/rocm和olive还高,7900xtx sd1.5 512x512能跑出29.99it/s,好像比4080还高了,但他们用的是SD.NEXT本身效率会要高一点。
似乎对显卡有限制,太老的卡不太好用,有人用老卡就和dml效率差不多。
等大佬们出懒人包了,a卡windows应该能玩了。
(, 下载次数: 11)




作者: 布拉德莱恩    时间: 2024-2-17 05:28
这让ROCm情何以堪
作者: zxc786    时间: 2024-2-17 14:22
布拉德莱恩 发表于 2024-2-17 05:28
这让ROCm情何以堪

(, 下载次数: 11)
甚至表示是rocm的三倍

作者: 赞卡机    时间: 2024-2-17 16:08
那现在有什么好价的A矿吗
作者: zxc786    时间: 2024-2-17 16:19
赞卡机 发表于 2024-2-17 16:08
那现在有什么好价的A矿吗

仅限RDNA2/RNDA3,A矿很少。
作者: 7776169    时间: 2024-2-17 16:20
本帖最后由 7776169 于 2024-2-17 16:23 编辑

如果是跟N卡一样的消耗,而且可以用FP8的话
买个12G的我看就够一般人玩了
当然你也可以6950XT?
草,看了眼6950XT才16G显存阿
不如去买7900XT?
好歹20G

作者: zxc786    时间: 2024-2-17 16:35
7776169 发表于 2024-2-17 16:20
如果是跟N卡一样的消耗,而且可以用FP8的话
买个12G的我看就够一般人玩了
当然你也可以6950XT?

6950XT不如7900xT,7900XT丐版也就5000了。
作者: 7776169    时间: 2024-2-17 16:42
zxc786 发表于 2024-2-17 16:35
6950XT不如7900xT,7900XT丐版也就5000了。

主要少了4G显存
这就有点(((

作者: Jumbohard    时间: 2024-2-17 17:29
那么 集显能用吗(

—— 来自 S1Fun
作者: defer    时间: 2024-2-17 17:34
7776169 发表于 2024-2-17 16:20
如果是跟N卡一样的消耗,而且可以用FP8的话
买个12G的我看就够一般人玩了
当然你也可以6950XT?

最划算的是6800无印

论坛助手,iPhone
作者: sunbeach    时间: 2024-2-17 19:41
Jumbohard 发表于 2024-2-17 17:29
那么 集显能用吗(

—— 来自 S1Fun

主要吃带宽 集显跑不如cpu
作者: zxc786    时间: 2024-2-17 21:07
我已经跑通了,没有LINUX/rocm三倍。效率跟LINUX/rocm 差不多,7900XT 16IT/s


作者: cyp909    时间: 2024-2-17 21:15
zxc786 发表于 2024-2-17 21:07
我已经跑通了,没有LINUX/rocm三倍。效率跟LINUX/rocm 差不多,7900XT 16IT/s

...

等整合包了,不知道我的68xt能不能打的过我的3060l

—— 来自 vivo V2307A, Android 14上的 S1Next-鹅版 v2.5.4
作者: 7776169    时间: 2024-2-18 10:43
zxc786 发表于 2024-2-17 21:07
我已经跑通了,没有LINUX/rocm三倍。效率跟LINUX/rocm 差不多,7900XT 16IT/s

...

可以像n卡那样用那些插件以及fp8吗?

—— 来自 OnePlus GM1900, Android 10上的 S1Next-鹅版 v2.5.2-play
作者: patema    时间: 2024-2-18 13:24
因为i在推ipex,A在推rocm吧,转cuda与自己战略相冲了吧。但是确实利好a卡画图党,毕竟三家只有A是刚需linux环境的
作者: zxc786    时间: 2024-2-18 17:52
【【Stable diffusion】AMD显卡windows下使用Zluda运行SD简易教程】
https://www.bilibili.com/video/B ... 6e2af1f245c5c17b664
做了个简单教程。
作者: citrus    时间: 2024-2-18 18:48
前几天试着给我的AMD显卡笔记本折腾ML环境,结果发现巨硬自己的PyTorch on DirectML都不维护了,一升级就崩,崩了还没法安装回旧版本
作者: ambivalence    时间: 2024-2-19 10:24
能跑llm吗?
作者: foreversmiles    时间: 2024-2-19 10:50
我的7900XTX又有用武之地了?
作者: projectplan    时间: 2024-2-19 22:58
果然还是生态最重要
作者: jcyxxx    时间: 2024-2-20 06:33
6900xt现在能跑多少?之前整合包4-4.8左右

—— 来自 vivo V2185A, Android 13上的 S1Next-鹅版 v2.5.4
作者: 7776169    时间: 2024-2-23 16:05
秋叶的整合包更新了
大家有a卡可以试试

—— 来自 OnePlus GM1900, Android 10上的 S1Next-鹅版 v2.5.2-play




欢迎光临 Stage1st (https://bbs.saraba1st.com/2b/) Powered by Discuz! X3.4