Views
No views yet
1uv venv --python 3.12
2
3# use patched sglang from git
4uv pip install "git+https://github.com/nytopop/sglang.git@qwen-30b-a3b#subdirectory=python[all]" --find-links https://flashinfer.ai/whl/cu124/torch2.5/flashinfer-python
5
6# run
7uv run python -m sglang.launch_server --model-path nytopop/Qwen3-30B-A3B.w8a8 --quantization w8a8_int8 --reasoning-parser qwen31from transformers import AutoModelForCausalLM
2from llmcompressor import oneshot
3from llmcompressor.modifiers.quantization import QuantizationModifier
4from llmcompressor.transformers.compression.helpers import calculate_offload_device_map
5
6model_id = "Qwen/Qwen3-30B-A3B"
7model_out = model_id.split("/")[1] + ".w8a8"
8
9device_map = calculate_offload_device_map(
10 model_id, reserve_for_hessians=False, num_gpus=1, torch_dtype="bfloat16"
11)
12
13for k, v in device_map.items():
14 if v == 'disk':
15 device_map[k] = 'cpu'
16
17model = AutoModelForCausalLM.from_pretrained(
18 model_id,
19 device_map=device_map,
20 torch_dtype="bfloat16",
21)
22
23recipe = QuantizationModifier(targets="Linear", scheme="W8A8", ignore=["lm_head", "re:.*mlp.gate$"])
24
25oneshot(model=model, recipe=recipe, output_dir=model_out)