Views
No views yet

pip install lmdeploy1git-lfs install
2git clone https://huggingface.co/lmdeploy/internlm-chat-7b-w4turbomind.deploy, and then you can interact with the AI assistant in the terminal1
2## Convert the model's layout and store it in the default path, ./workspace.
3python3 -m lmdeploy.serve.turbomind.deploy \
4 --model-name internlm \
5 --model-path ./internlm-chat-7b-w4 \
6 --model-format awq \
7 --group-size 128
8
9## inference
10python3 -m lmdeploy.turbomind.chat ./workspacepython3 -m lmdeploy.serve.turbomind ./workspace --server_name {ip_addr} ----server_port {port}http://{ip_addr}:{port} in your browser and interact with the model| model | llm-awq | mlc-llm | turbomind |
|---|---|---|---|
| Llama 2 7B | 112.9 | 159.4 | 206.4 |
| Llama 2 13B | N/A | 90.7 | 115.8 |
1python benchmark/profile_generation.py \
2 ./workspace \
3 --concurrency 1 --input_seqlen 1 --output_seqlen 5121python3 -m lmdeploy.lite.apis.calibrate \
2 --model $HF_MODEL \
3 --calib_dataset 'c4' \ # Calibration dataset, supports c4, ptb, wikitext2, pileval
4 --calib_samples 128 \ # Number of samples in the calibration set, if memory is insufficient, you can appropriately reduce this
5 --calib_seqlen 2048 \ # Length of a single piece of text, if memory is insufficient, you can appropriately reduce this
6 --work_dir $WORK_DIR \ # Folder storing Pytorch format quantization statistics parameters and post-quantization weight1python3 -m lmdeploy.lite.apis.auto_awq \
2 --model $HF_MODEL \
3 --w_bits 4 \ # Bit number for weight quantization
4 --w_sym False \ # Whether to use symmetric quantization for weights
5 --w_group_size 128 \ # Group size for weight quantization statistics
6 --work_dir $WORK_DIR \ # Directory saving quantization parameters from Step 1$WORK_DIR. Then you can proceed with model inference according to the instructions in the "4-Bit Weight Model Inference" section.