找回密码
 立即注册
查看: 6627|回复: 26

[软件] 本地部署deepseek蒸馏模型

[复制链接]
     
发表于 2025-1-30 22:11 | 显示全部楼层 |阅读模式
记录一下折腾过程。

原本规划是ollema+deepseek+chatbox/openui

一开始官网安装,然后发现amd只支持到6800,我是6700xt 12G。使用很卡,调用的cpu生成。在log里查找显卡代号为gfx1031

查资料 https://www.oneue.com/articles/2350.html
下载专用的ollema for amd https://github.com/likelovewant/ollama-for-amd/
和针对老显卡的库文件 https://github.com/likelovewant/ ... leases/tag/v0.6.1.2
打开 Ollama 安装目录,将压缩包中的 rocblas.dll 替换 C:\Users\更换为你的电脑用户名\AppData\Local\Programs\Ollama\lib\ollama\rocblas.dll
将压缩包中的 library 文件夹替换 C:\Users\更换为你的电脑用户名\AppData\Local\Programs\Ollama\lib\ollama\rocblas\library

安装后查看资源占用,开始吃显存了。生成也快了很多。

因为6700xt只有12gb,所以我选的是8b这个模型。

按照https://bbs.saraba1st.com/2b/for ... ;page=1#pid67309881 做了破限制。

我也不是太懂蒸馏,有人说这个本质还是Llama,生成能力确实比网页版差,傻傻的。
回复

使用道具 举报

     
发表于 2025-1-30 22:25 来自手机 | 显示全部楼层
怎么训练呢

—— 来自 OPPO PKB110, Android 15上的 S1Next-鹅版 v2.5.2
回复

使用道具 举报

     
发表于 2025-1-30 22:32 来自手机 | 显示全部楼层
8b本质就是llama对的
回复

使用道具 举报

     
发表于 2025-1-30 22:59 | 显示全部楼层
楚轩 发表于 2025-1-30 22:25
怎么训练呢

—— 来自 OPPO PKB110, Android 15上的 S1Next-鹅版 v2.5.2

个人环境不要想了,没硬件条件
回复

使用道具 举报

     
发表于 2025-1-31 00:16 来自手机 | 显示全部楼层
问一下本地部署,rx580还能拿来用吗_(:з」∠)_
回复

使用道具 举报

     
发表于 2025-1-31 00:23 | 显示全部楼层
肛之练筋士 发表于 2025-1-31 00:16
问一下本地部署,rx580还能拿来用吗_(:з」∠)_

小红书上见有人用过,8GB的。
回复

使用道具 举报

     
发表于 2025-1-31 00:53 | 显示全部楼层
不嫌慢可以纯CPU推理,只要内存够32B都可以跑,差不多一秒2、3个字
回复

使用道具 举报

     
发表于 2025-1-31 01:02 | 显示全部楼层
CPU offload功能好像可以同时进行CPU和GPU推理,设置好层数速度应该是最快的
回复

使用道具 举报

     
发表于 2025-1-31 08:14 来自手机 | 显示全部楼层
楼主GPU跟我一样,我发现显卡只支持到6800xt的时候挣扎了下,觉得卖了6700,置换为3080是最方便的做法。楼主这个方法过年回去后我也试试


—— 来自 鹅球 v3.3.96-alpha
回复

使用道具 举报

     
发表于 2025-1-31 10:31 | 显示全部楼层
我是6800xt,直接下载LMStudio下载模型就能用了,试了qwen 14b的模型,显存占用10GB的样子
回复

使用道具 举报

发表于 2025-1-31 12:16 来自手机 | 显示全部楼层
处男老司机 发表于 2025-1-31 00:53
不嫌慢可以纯CPU推理,只要内存够32B都可以跑,差不多一秒2、3个字

d4,128g内存,集显能跑么?
回复

使用道具 举报

发表于 2025-1-31 12:23 | 显示全部楼层
星空天神 发表于 2025-1-31 10:31
我是6800xt,直接下载LMStudio下载模型就能用了,试了qwen 14b的模型,显存占用10GB的样子 ...

我6650,没做任何特殊处理,用起来完全没问题,速度也可以接受,大概30-40token/s
回复

使用道具 举报

     
发表于 2025-1-31 12:31 | 显示全部楼层
jeokeo 发表于 2025-1-31 12:16
d4,128g内存,集显能跑么?

纯CPU推理不需要显卡,当然能跑
回复

使用道具 举报

     
发表于 2025-1-31 12:48 来自手机 | 显示全部楼层
ds这几天用下来,感觉是真的人工智能,比字节和阿里的聪明太多太多了,断崖式领先。
真的太强了,我没有用过gpt,所以不清楚有没有比gpt好。

—— 来自 HONOR PTP-AN60, Android 15上的 S1Next-鹅版 v2.5.4
回复

使用道具 举报

     
发表于 2025-1-31 13:17 | 显示全部楼层
有人在开发iPhone本地跑的了,虽然是1.5b的
回复

使用道具 举报

     
发表于 2025-1-31 13:23 来自手机 | 显示全部楼层
1.5b的刚出就有人用termux在手机上跑过了

—— 来自 鹅球 v3.3.96
回复

使用道具 举报

     
发表于 2025-1-31 14:12 | 显示全部楼层
DeepSeek R1 671B over 2 tok/sec *without* GPU on local gaming rig!
DeepSeek R1 671B 在本地游戏设备上 *无需* GPU 即可实现每秒超过 2 个令牌的处理速度!Discussion (self.LocalLLaMA)

submitted 12 hours ago by VoidAlchemyllama.cpp

Don't rush out and buy that 5090TI just yet (if you can even find one lol)!
先别急着出去买那款 5090TI(如果你能找到的话,哈哈)!

I just inferenced ~2.13 tok/sec with 2k context using a dynamic quant of the full R1 671B model (not a distill) after disabling my 3090TI GPU on a 96GB RAM gaming rig. The secret trick is to not load anything but kv cache into RAM and let llama.cpp use its default behavior to mmap() the model files off of a fast NVMe SSD. The rest of your system RAM acts as disk cache for the active weights.
我刚刚在一台 96GB 内存的游戏机上禁用了 3090TI GPU 后,使用动态量化的完整 R1 671B 模型(非蒸馏版)以约 2.13 tok/sec 的速度进行了推理,上下文长度为 2k。秘诀是只将 kv 缓存加载到 RAM 中,让 llama.cpp 使用其默认行为从快速的 NVMe SSD 上 mmap() 模型文件。系统其余的内存则作为活动权重的磁盘缓存。

Yesterday a bunch of folks got the dynamic quant flavors of unsloth/DeepSeek-R1-GGUF running on gaming rigs in another thread here. I myself got the DeepSeek-R1-UD-Q2_K_XL flavor going between 1~2 toks/sec and 2k~16k context on 96GB RAM + 24GB VRAM experimenting with context length and up to 8 concurrent slots inferencing for increased aggregate throuput.
昨天一群人在另一个帖子里让 unsloth/DeepSeek-R1-GGUF 的动态量化版本在游戏设备上运行起来了。我自己在 96GB 内存+24GB 显存的配置下,让 DeepSeek-R1-UD-Q2_K_XL 版本以 1~2 tokens/秒的速度运行,上下文长度在 2k~16k 之间,通过实验上下文长度和最多 8 个并发槽推理,以提高总体吞吐量。

After experimenting with various setups, the bottle neck is clearly my Gen 5 x4 NVMe SSD card as the CPU doesn't go over ~30%, the GPU was basically idle, and the power supply fan doesn't even come on. So while slow, it isn't heating up the room.
在尝试了各种设置后,瓶颈显然是我的第五代 x4 NVMe SSD 卡,因为 CPU 使用率不超过约 30%,GPU 基本处于空闲状态,电源风扇甚至没有启动。所以虽然速度慢,但它并没有让房间变热。

So instead of a $2k GPU what about $1.5k for 4x NVMe SSDs on an expansion card for 2TB "VRAM" giving theoretical max sequential read "memory" bandwidth of ~48GB/s? This less expensive setup would likely give better price/performance for big MoEs on home rigs. If you forgo a GPU, you could have 16 lanes of PCIe 5.0 all for NVMe drives on gamer class motherboards.
那么,与其花费 2000 美元购买 GPU,不如考虑以 1500 美元的价格在扩展卡上安装 4 块 NVMe SSD,提供 2TB 的“显存”,理论上最大连续读取“内存”带宽约为 48GB/s?这种成本较低的配置可能会为家用设备上的大型混合专家模型(MoE)提供更好的性价比。如果你放弃使用 GPU,在游戏级主板上,你可以将所有 16 条 PCIe 5.0 通道都用于 NVMe 驱动器。

If anyone has a fast read IOPs drive array, I'd love to hear what kind of speeds you can get. I gotta bug Wendell over at Level1Techs lol...
如果有人有高速读取 IOPs 的驱动器阵列,我很想听听你能达到什么样的速度。我得去烦一下 Level1Techs 的 Wendell 了,哈哈...

P.S. In my opinion this quantized R1 671B beats the pants off any of the distill model toys. While slow and limited in context, it is still likely the best thing available for home users for many applications.
附言:在我看来,这个量化版的 R1 671B 远超任何蒸馏模型玩具。尽管速度慢且上下文有限,但对于家庭用户的许多应用场景来说,它可能仍然是最佳选择。

Just need to figure out how to short circuit the <think>Blah blah</think> stuff by injecting a </think> into the assistant prompt to see if it gives decent results without all the yapping haha...
只需要弄清楚如何通过向助手提示中注入 </think> 来短路 <think>Blah blah</think> 的东西,看看在没有所有废话的情况下是否能给出不错的结果哈哈...
回复

使用道具 举报

     
发表于 2025-1-31 14:46 | 显示全部楼层
Benighted 发表于 2025-1-31 14:12
DeepSeek R1 671B over 2 tok/sec *without* GPU on local gaming rig!
DeepSeek R1 671B 在本地游戏设备上 ...

感觉64G内存+24G显存有望跑GGUF Q4
回复

使用道具 举报

     
发表于 2025-1-31 15:45 来自手机 | 显示全部楼层
卧槽,要是ssd也是可用级别的速度,那起飞了

—— 来自 鹅球 v3.3.96-alpha
回复

使用道具 举报

     
发表于 2025-1-31 15:55 | 显示全部楼层
璇瑢子R 发表于 2025-1-31 12:23
我6650,没做任何特殊处理,用起来完全没问题,速度也可以接受,大概30-40token/s ...

我看了一下默认用的vulkan
回复

使用道具 举报

     
发表于 2025-2-1 22:56 来自手机 | 显示全部楼层
借楼问点不相干的,chatbox吊用ds的api,有办法显示推理过程吗?

—— 来自 nubia NX721J, Android 14上的 S1Next-鹅版 v2.5.4
回复

使用道具 举报

     
发表于 2025-2-2 09:04 | 显示全部楼层
A卡用户用LMStudio最方便,把抱脸代理勾上即可搜索下载了,ROCM也可以直接安装
回复

使用道具 举报

     
发表于 2025-2-2 09:14 来自手机 | 显示全部楼层
花钱换显卡不如买个 64G 的 Mac Mini

—— 来自 Google Pixel 9 Pro, Android 15, 鹅球 v3.3.95-debug
回复

使用道具 举报

     
发表于 2025-2-2 10:14 来自手机 | 显示全部楼层
啥叫蒸馏模型啊
回复

使用道具 举报

     
发表于 2025-2-2 10:20 来自手机 | 显示全部楼层
page assist好用点,又小,就浏览器装个crx插件
回复

使用道具 举报

     
发表于 2025-2-2 10:26 来自手机 | 显示全部楼层
scg2017 发表于 2025-1-31 13:23
1.5b的刚出就有人用termux在手机上跑过了

—— 来自 鹅球 v3.3.96

安卓手机上跑用阿里的mnn好点
下载链接(无需翻墙):https://meta.alicdn.com/data/mnn/mnn_llm_app_debug_0_1.apk
项目原链(想看的话): https://github.com/alibaba/MNN
回复

使用道具 举报

     
发表于 2025-2-2 10:57 来自手机 | 显示全部楼层
在4060的笔记本上试用下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|上海互联网违法和不良信息举报中心|网上有害信息举报专区|962110 反电信诈骗|举报电话 021-62035905|Stage1st ( 沪ICP备13020230号-1|沪公网安备 31010702007642号 )

GMT+8, 2025-4-21 11:50 , Processed in 0.118847 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表