GithubHelp home page GithubHelp logo

chatglm可不可以8bit量化 about jittorllms HOT 3 OPEN

jittor avatar jittor commented on June 15, 2024
chatglm可不可以8bit量化

from jittorllms.

Comments (3)

IlysvlVEizbr avatar IlysvlVEizbr commented on June 15, 2024 2

我不是jittor或chatglm的开发人员,目前做过一些尝试,最终还是没法用,复现步骤如下:
使用chatglm提供的int8量化模型,然后直接把pytorch替换成jittor版本的torch,直接跑会报个错:
jittor.nn.Linear类收到了额外的device参数
到python3.xx/dist-packages/jittor/nn.py里面Linear类的__init__函数中,加一个device=None参数即可抑制错误
然后再跑,不报错了,但是输出的逻辑全乱,倒不是乱码,只是毫无意义。

蹲一个官方解决方案

from jittorllms.

AIxyz avatar AIxyz commented on June 15, 2024 1

使用如下命令倒是能限制它推理时的显存占用不超过5G,运行内存占用不超过12G,但一开始加载fp16格式的chatglm模型时它要把运行内存全打满,很容易就被kill

export JT_SAVE_MEM=1
export cpu_mem_limit=12000000000
export device_mem_limit=5000000000

from jittorllms.

mzzsfy avatar mzzsfy commented on June 15, 2024

同样的问题

from jittorllms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.