InternLM / lmdeploy

LMDeploy is a toolkit for compressing, deploying, and serving LLMs.
https://lmdeploy.readthedocs.io/en/latest/
Apache License 2.0
3.18k stars 284 forks source link

[Bug] 量化模型时无输出 #1735

Open NB-Group opened 3 weeks ago

NB-Group commented 3 weeks ago

Checklist

Describe the bug

D:\AI_model>lmdeploy lite auto_awq ./internlm2-chat-20b --work-dir internlm2-chat-20b-4bit

D:\AI_model>

在运行量化命令后,无任何输出,并且应默认创建的文件夹workspace也没有创建

Reproduction

lmdeploy lite auto_awq ./internlm2-chat-20b --work-dir internlm2-chat-20b-4bit

Environment

sys.platform: win32
Python: 3.8.16 (default, Mar  2 2023, 03:18:16) [MSC v.1916 64 bit (AMD64)]
CUDA available: True
MUSA available: False
numpy_random_seed: 2147483648
GPU 0: NVIDIA GeForce RTX 3090
CUDA_HOME: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4
NVCC: Cuda compilation tools, release 12.4, V12.4.131
MSVC: 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.35.32217.1 版
GCC: n/a
PyTorch: 2.2.2+cu121
PyTorch compiling details: PyTorch built with:
  - C++ Version: 201703
  - MSVC 192930151
  - Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v3.3.2 (Git Hash 2dc95a2ad0841e29db8b22fbccaf3e5da7992b01)
  - OpenMP 2019
  - LAPACK is enabled (usually provided by MKL)
  - CPU capability usage: AVX512
  - CUDA Runtime 12.1
  - NVCC architecture flags: -gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_90,code=sm_90
  - CuDNN 8.8.1  (built against CUDA 12.0)
  - Magma 2.5.4
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=12.1, CUDNN_VERSION=8.8.1, CXX_COMPILER=C:/actions-runner/_work/pytorch/pytorch/builder/windows/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /Zc:__cplusplus /bigobj /FS /utf-8 -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE /wd4624 /wd4068 /wd4067 /wd4267 /wd4661 /wd4717 /wd4244 /wd4804 /wd4273, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=2.2.2, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, USE_ROCM=OFF, USE_ROCM_KERNEL_ASSERT=OFF,

TorchVision: 0.17.2+cpu
LMDeploy: 0.4.2+
transformers: 4.37.0
gradio: 3.41.0
fastapi: 0.111.0
pydantic: Not Found
triton: Not Found

Error traceback

No response

irexyc commented 3 weeks ago

我windows机器的显卡显存没有那么大, 用了1.8b的小模型试了下是正常的,你可以试试这个模型是否正常

image

我在服务器上面量化internlm2-chat-20b,显存峰值15G,内存峰值40G,会不会是资源不足引起的?不过感觉多少得打印点东西,获取你可以自己先定位一下代码跑到哪里挂的。

NB-Group commented 3 weeks ago

24G显存,16G物理内存+35G虚拟内存,应该是够的吧

NB-Group commented 3 weeks ago

我测试了一下,1.5B的模型可以量化,虽然在最后报错:ConnectionError: Couldn't reach 'ptb_text_only' on the Hub (ConnectionError)

那么应该是资源不足引起的了,所以有没有量化好的interlm2-20b-chat

irexyc commented 3 weeks ago

https://huggingface.co/internlm/internlm2-chat-20b-4bits