GithubHelp home page GithubHelp logo

Comments (5)

lwmlyy avatar lwmlyy commented on August 28, 2024
  1. 使用transformers 4.38.1 不需要merges.txt,你可以再试下,我这边测试的是7b模型,理论上所以模型的tokenizer应该是一样的
  2. 是的,qwen-hf格式的模型emb实际维度与tokenizer.vocab_size不一致导致此问题,需要在运行设置EXTRA_VOCAB_SIZE,可参考https://github.com/alibaba/Pai-Megatron-Patch/blob/main/examples/qwen1.5/run_finetune_megatron_qwen_withGA.sh 第二行,每个模型的EXTRA_VOCAB_SIZE设置为qwen-hf中config.json中的vocab_size减去tokenizer.vocab_size。
  3. 我这边验证了开启pp时可以正常跑,确认下运行环境、gpu卡数设置(tp*pp)

from pai-megatron-patch.

smartparrot avatar smartparrot commented on August 28, 2024

extra-vocab-size是啥意思,为什么是293呀?152064-151643=421

from pai-megatron-patch.

yanyc428 avatar yanyc428 commented on August 28, 2024

我这边也出现了第一个问题,transformers版本是4.38.1,测试的7b模型

from pai-megatron-patch.

xikaluo avatar xikaluo commented on August 28, 2024
  1. 使用transformers 4.38.1 不需要merges.txt,你可以再试下,我这边测试的是7b模型,理论上所以模型的tokenizer应该是一样的
  2. 是的,qwen-hf格式的模型emb实际维度与tokenizer.vocab_size不一致导致此问题,需要在运行设置EXTRA_VOCAB_SIZE,可参考https://github.com/alibaba/Pai-Megatron-Patch/blob/main/examples/qwen1.5/run_finetune_megatron_qwen_withGA.sh 第二行
  3. 我这边验证了开启pp时可以正常跑,确认下运行环境、gpu卡数设置(tp*pp)
  1. 刚才又测试了一下,在transformers 4.38.1或4.38.2的情况下,不带merges.txt时还是会报错,但是如果把 https://github.com/alibaba/Pai-Megatron-Patch/blob/main/megatron_patch/tokenizer/__init__.py#L96 这一行的use_fast注释掉就不会出错了
  2. 之前没有想到可以通过EXTRA_VOCAB_SIZE来设置,不过比较神奇的是,qwen-1.5-的7B和14B模型,vocab_size是不一样的,EXTRA_VOCAB_SIZE=293只适合于7B模型。所以理论上可能用读取参数的方式来做会比较稳妥?
  3. 拉了一个nvidia的官方docker镜像之后可以正常运行了,估计是我之前某些地方没有配置好吧

from pai-megatron-patch.

xikaluo avatar xikaluo commented on August 28, 2024

extra-vocab-size是啥意思,为什么是293呀?152064-151643=421

看我上面的回复,7B和14B的vocab_size不一样,293是7B的

from pai-megatron-patch.

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.