Views
No views yet
--override-generation-config "${SAMPLER_JSONCONFIG}" to override the sampler (which is a merge of generation_config.json and vLLM defaults)1# Model configuration (Mandatory)
2MODEL="mratsim/GLM-Steam-106B-A12B-v1-AWQ"
3MODELNAME="GLM-Steam-v1"
4GPU_UTIL=0.97
5
6# Sampling configuration (Optional, if departing from `generation_config.json`)
7# Values from the model card https://rentry.org/geechan#model-specific-presets
8SAMPLER_OVERRIDE='{"temperature": 1, "min_p": 0.01, "top_p": 1}'
9
10# Prevent vLLM from using 100% CPU when idle (Very Recommended)
11export VLLM_SLEEP_WHEN_IDLE=1
12
13# Prevent memory fragmentation
14export PYTORCH_ALLOC_CONF=expandable_segments:True,max_split_size_mb:512
15
16# Use FlashInfer backend (fastest, recommended, "instant" context reprocessing)
17# however needs to reduce context length to 120000 tokens and GPU_UTIL to 0.95
18# export VLLM_ATTENTION_BACKEND=FLASHINFER
19
20vllm serve "${MODEL}" \
21 --served-model-name "${MODELNAME}" \
22 --gpu-memory-utilization ${GPU_UTIL} \
23 --override-generation-config "${SAMPLER_OVERRIDE}"ℹ️ The FlashInfer backend may fail with an error similar toFailed to allocate memory for batch_prefill_tmp_v with size XYZ and alignment 16 in AlignedAllocator.A workaround is running a sed replacement command within vllm install to increase buffer spacesed -i 's/FLASHINFER_WORKSPACE_BUFFER_SIZE = 256 \* 1024 \* 1024/FLASHINFER_WORKSPACE_BUFFER_SIZE = 768 \* 1024 \* 1024/g' vllm/v1/attention/backends/flashinfer.pyThis will be fixed by PR https://github.com/vllm-project/vllm/pull/25344 or https://github.com/vllm-project/vllm/pull/28269
1default_stage:
2 default_modifiers:
3 AWQModifier:
4 config_groups:
5 group_0:
6 targets: ['re:.*mlp\.experts\.[0-9]+\.(down|gate|up)_proj$']
7 weights:
8 num_bits: 4
9 type: int
10 symmetric: true
11 group_size: 32
12 strategy: group
13 block_structure: null
14 dynamic: false
15 actorder: null
16 observer: mse
17 observer_kwargs: {}
18 input_activations: null
19 output_activations: null
20 format: null
21 targets: ['re:.*mlp\.experts\.[0-9]+\.(down|gate|up)_proj$']
22 ignore: []
23 mappings:
24 - smooth_layer: re:.*post_attention_layernorm$
25 balance_layers: ['re:.*gate_proj$', 're:.*up_proj$']
26 - smooth_layer: re:.*up_proj$
27 balance_layers: ['re:.*down_proj$']
28 duo_scaling: trueLayerNorm in Quantization. Kovaleva et al. (2021); Wei et al. (2022) find that outliers in the LayerNorm parameters of BERT (Devlin et al., 2019) cause difficulties in model compression. Given the importance of LayerNorm, all the quantization methods we discuss above leave LayerNorm unquantized.
Linear layer, meaning they might be skipped if using llmcompressor with a Linear target.k blocks have a significantly higher impact on model quality than for the same last k blocks.
In this case, we keep the first layer unquantized as "first_k_dense_replace": 1 in config.json