Code Monkey home page Code Monkey logo

Comments (5)

yuanzhoulvpi2017 avatar yuanzhoulvpi2017 commented on May 28, 2024

通常来说,使用lora训练chatglm2,确实只需要14g左右(在batchsize=1,文本长度也不太长的情况下(比如长度为512))。

但是也有例外,会导致你的显存不够,建议你检查一下下面内容:

  1. 你的数据batchsize多大,设置为1,如果可以跑通,然后不断的向上加。
  2. 文本长度多长?可以设置为512,1024,等,不断往上加。
  3. 检查代码,是不是因为代码的运行方式不对?是完全和我的代码保持一致么?(因为我的这个是模型并行,非常节约显存了)。
  4. 检查transformers和peft包的版本,更新到最新的版本试一试?
  5. gradient_checkpoint 打开试一试,也可以节约不少显存。
  6. 🚨 还有一种可能:因为我的代码是模型并行,在计算loss的时候,比较占用最后一张显卡的显存。不过这个你可能就比较难解决了,只能通过换用更大显存的显卡来解决。
  7. 还有很多低级错误,如:是不是别的人也在占用了一个显卡,确保每张卡的显存都是为10MB以下哦,这个情况通常发生在实验室里面。
  8. 一般int8之后,结合lora,单张3080ti都可以跑起来,但是有坑,不建议你使用chatglm自己的量化代码,而是使用transformers的量化方式。

基本上就这些,希望可以帮到你

from zero_nlp.

imjking avatar imjking commented on May 28, 2024

好的,我试试。谢谢

from zero_nlp.

imjking avatar imjking commented on May 28, 2024

已解决,transformers更新到最新版

from zero_nlp.

fengzehui0422 avatar fengzehui0422 commented on May 28, 2024

请问chatglm2-6b-lora训练可以设置多轮的epoch吗?我没找到在哪设置的

from zero_nlp.

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.