Giter VIP home page Giter VIP logo

Comments (7)

ywancit avatar ywancit commented on July 30, 2024

我是可以正常用原始模型,但是8bit量化报和你一样的错,https://github.com/baichuan-inc/Baichuan2/issues/48#issue-1885592066。
有解决方案了可以互相通知一下。

from baichuan2.

bihui9968 avatar bihui9968 commented on July 30, 2024

遇到了同样的问题,有解决方案了吗

from baichuan2.

ChiQiuHong avatar ChiQiuHong commented on July 30, 2024

@pagyyuan @ywancit @bihui9968
model = AutoModelForCausalLM.from_pretrained(quant8_saved_dir, load_in_8bit=True, device_map="auto", trust_remote_code=True)
问题应该出自device_map="auto"这里,我的机器内存和GPU显存都较小,因此它会将模型分别加载到cpu和cuda里,接下来保存的时候,就没有把全部权重都保存下来(保存下来的'pytorch_model'只有8GB左右,这并不是一个正常的大小)。
我将把模型全部加载到cpu里:device_map="cpu",保存下来的’pytorch_model‘大小有13.9GB,推理正常没有报错。

from baichuan2.

pagyyuan avatar pagyyuan commented on July 30, 2024

@ChiQiuHong 我将device_map由"auto"改为"cpu"后会报新的错误:ValueError: If passing a string for device_map, please choose 'auto', 'balanced', 'balanced_low_0' or 'sequential'.

from baichuan2.

pagyyuan avatar pagyyuan commented on July 30, 2024

我将报错的地方打印出来:有一个tensor是这样的:tensor([[nan, nan, nan, ..., nan, nan, nan]], device='cuda:0',
dtype=torch.float16)

from baichuan2.

baolixiong avatar baolixiong commented on July 30, 2024

请问解决了吗

from baichuan2.

qiu404 avatar qiu404 commented on July 30, 2024

#291 可以看下这个能不能解你的问题

from baichuan2.

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.