MOSS
MOSS copied to clipboard
推荐使用 AutoGPTQ 或 AutoGPTQ-triton 进行模型量化和推理
我在 issues 中看到很多同学在使用量化版本的模型推理时遇到问题,在这里想自吹自擂地推荐一下自己的新项目,希望能够对大家有所帮助。
AutoGPTQ 是一个简单易用的模型量化和推理工具包,提供类 Hugging Face transformers
风格的函数接口并与其 TextGenerationPipeline
完全兼容。目前支持四大主流开源 GPT 模型家族的量化和推理,并能够通过少数几行代码的编写,快速拓展到其他 GPT 模型的量化及推理应用。此外,项目中还提供了多个预定义的任务类型,能够方便使用者快速评估模型在下游具体任务上的表现。
AutoGPTQ-triton 是 GPTQ-for-LLaMa 项目所有者在 AutoGPTQ 的基础上拓展的 triton 推理版本。
对于拥有能够使用 triton 的操作系统的同学,推荐使用 AutoGPTQ-triton 以获得更快的推理体验,而如果无法使用 triton 的话,AutoGPTQ 也能够让你快速上手完成模型的量化和推理应用。
最新版本的 AutoGPTQ 已经支持 MOSS 模型的量化,今晚我会把量化后的模型权重上传至 huggingface hub
赞
最新版本的 AutoGPTQ 已经支持 MOSS 模型的量化,今晚我会把量化后的模型权重上传至 huggingface hub
链接给一个,谢谢
我在pip里无法安装triton,麻烦您看一下如何安装这个依赖 系统是EulerOS 2.0 (SP8), CANN-6.0.1
我在pip里无法安装triton,麻烦您看一下如何安装这个依赖 系统是EulerOS 2.0 (SP8), CANN-6.0.1
你好,请问有详细的报错信息吗?
最新版本的 AutoGPTQ 已经支持 MOSS 模型的量化,今晚我会把量化后的模型权重上传至 huggingface hub
链接给一个,谢谢
理论上官方的量化版本模型能够直接在 auto-gptq 上使用
我在pip里无法安装triton,麻烦您看一下如何安装这个依赖 系统是EulerOS 2.0 (SP8), CANN-6.0.1
你好,请问有详细的报错信息吗?
Looking in indexes: http://100.125.0.87:32021/repository/pypi/simple, https://pypi.ngc.nvidia.com/ ERROR: Could not find a version that satisfies the requirement triton (from versions: none) ERROR: No matching distribution found for triton
我在pip里无法安装triton,麻烦您看一下如何安装这个依赖 系统是EulerOS 2.0 (SP8), CANN-6.0.1
你好,请问有详细的报错信息吗?
Looking in indexes: http://100.125.0.87:32021/repository/pypi/simple, https://pypi.ngc.nvidia.com/ ERROR: Could not find a version that satisfies the requirement triton (from versions: none) ERROR: No matching distribution found for triton
应该是镜像源的问题吧,试试使用 pip install auto-gptq[triton] -i https://pypi.org/simple
或 pip install triton -i https://pypi.org/simple
我在pip里无法安装triton,麻烦您看一下如何安装这个依赖 系统是EulerOS 2.0 (SP8), CANN-6.0.1
你好,请问有详细的报错信息吗?
Looking in indexes: http://100.125.0.87:32021/repository/pypi/simple, https://pypi.ngc.nvidia.com/ ERROR: Could not find a version that satisfies the requirement triton (from versions: none) ERROR: No matching distribution found for triton
应该是镜像源的问题吧,试试使用
pip install auto-gptq[triton] -i https://pypi.org/simple
或pip install triton -i https://pypi.org/simple
triton用https://pypi.org/simple这个镜像源确实安装不了,找不到版本,云平台和我自己的电脑都试过了,auto-gptq[triton]pip安装了,前面都正常,后面出现 '''INFO: pip is looking at multiple versions of auto-gptq[triton] to determine which version is compatible with other requirements. This could take a while. ERROR: Could not find a version that satisfies the requirement triton>=2.0.0 (from auto-gptq[triton]) (from versions: none) ERROR: No matching distribution found for triton>=2.0.0'''这个问题。我想用int4的moss,差这个triton一直无法安装上
我这边上面两个命令都可以正常安装依赖,会不会是你 pip 版本的问题,先执行一下 pip3 install --upgrade pip
升级 pip
最新版本的 AutoGPTQ 已经支持 MOSS 模型的量化,今晚我会把量化后的模型权重上传至 huggingface hub
链接给一个,谢谢
理论上官方的量化版本模型能够直接在 auto-gptq 上使用
官方 repo 的量化版本提示找不到 quantize_config.json
│ C:\Users\daniel\Downloads\oobabooga_windows\installer_files\env\lib\site-packages\auto_gptq\mode │
│ ling\_base.py:53 in from_pretrained │
│ │
│ 50 │ │
│ 51 │ @classmethod │
│ 52 │ def from_pretrained(cls, save_dir: str): │
│ ❱ 53 │ │ with open(join(save_dir, "quantize_config.json"), "r", encoding="utf-8") as f: │
│ 54 │ │ │ return cls(**json.load(f)) │
│ 55 │ │
│ 56 │ def to_dict(self): │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
FileNotFoundError: [Errno 2] No such file or directory:
'models\\fnlp_moss-moon-003-sft-plugin-int4\\quantize_config.json'
有两种方式解决:
- 手动添加一个 quantize_config.json 到模型存放的目录下
- (如果直接使用 auto_gptq 的话)实例化一个 BaseQuantizeConfig 对象并传给
.from_quantized
的quantize_config
参数
我如何取得 config 數據? Repo 裏頭有嗎