V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
CatCode
V2EX  ›  机器学习

7B 大模型不量化, 16G 显存就差那么一点儿,难道消费级显卡只有 90 系能跑?

  •  
  •   CatCode · 61 天前 · 1077 次点击
    这是一个创建于 61 天前的主题,其中的信息可能已经有所发展或是发生改变。

    目前挺多开源/开放大模型的,7B 这个级别的也不少。现在主流的模型用的是 bf16 的数据类型。

    理论上是几乎刚刚放下。但显存里总得放点儿别的东西;权重的各部分之间也不是那么整整齐齐,总要浪费一些空间。

    16G 显存的显卡,就愣是放不下 7B 模型了。

    4070TiS 、4080 、4080S 都是 16G 。再往上就得 4090D 和 4090 了(算上上代还有 3090 )。

    不是说 int8 量化的不好,就是单纯吐槽 7B bf16 正好卡在这个位置,真是膈应啊。

    6 条回复    2024-03-05 16:55:47 +08:00
    Orenoid
        1
    Orenoid  
       61 天前
    我的显卡是 4070 ,显存 12 GB ,用 ollama 跑 qwen 7b 和 mistral 7b 感觉都挺流畅的呀,qwen 14b 也勉强能跑,如果 ollama 默认拉取的就是已经量化了的模型,那就不清楚了
    liprais
        2
    liprais  
       61 天前
    你买 A100 老黄就把你当人了
    臭打游戏的一边凉快去
    CatCode
        3
    CatCode  
    OP
       60 天前
    @Orenoid 应该是量化过的。
    7000000000 个 bf16 值,紧密排列,就要 13 GiBytes 空间。浮点数数组用通用压缩算法并不好压缩。
    159526aa
        4
    159526aa  
       60 天前
    跑个量化 14b 不比你无量化 7b 强多了
    shm7
        5
    shm7  
       60 天前
    1. 是不是不考虑输入输出长度了,现在都是 16K 了。
    2. 7B 你也叫大模型了,拿这些老/消费卡不行也是正常的吧。
    basncy
        6
    basncy  
       53 天前
    OutOfMemoryError: CUDA out of memory. Tried to allocate 1.08 GiB. GPU 0 has a total capacty of 14.75 GiB of which 1.06 MiB is free. Process 2290 has 13.72 GiB memory in use. Of the allocated memory 10.38 GiB is allocated by PyTorch, and 3.20 GiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1353 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 17:33 · PVG 01:33 · LAX 10:33 · JFK 13:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.