Qwen3 8B
문서 상태
소유: LLMOps · 기준: vLLM HyperAccel 0.0.5 · 최종 확인: 2026-10-15
개요
Qwen/Qwen3-8B를 vLLM HyperAccel로 실행합니다.
Qwen3-8B는 LPU에서 가장 넓게 검증된 모델입니다. 야간 생성 테스트, 16,384 토큰 전체 컨텍스트 서빙,
4K / 8K / 16K 장문 컨텍스트, 2 · 4 LPU PP, 2 LPU DP를 LPU에서 검증합니다.
준비
설치를 마친 환경에서 시작합니다. 모델은 처음 실행할 때 Hugging Face에서 내려받습니다.
온라인 서빙
1. 서버 실행
| vllm serve Qwen/Qwen3-8B \
--max-model-len 16384 \
--dtype bfloat16 \
--no-enable-prefix-caching \
--no-async-scheduling
|
하드웨어 서빙 테스트가 쓰는 구성입니다. 로그에 Application startup complete.가 나오면 준비된 것입니다.
가중치 로드와 모델 컴파일이 먼저 끝나야 하므로 처음 시작은 시간이 걸립니다.
2. cURL로 요청
새 터미널에서 요청합니다.
| curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen/Qwen3-8B",
"messages": [{"role": "user", "content": "프랑스의 수도는 어디인가요?"}],
"max_tokens": 64,
"temperature": 0,
"chat_template_kwargs": {"enable_thinking": false}
}'
|
응답은 표준 OpenAI chat.completion 객체입니다. 생성한 문장은 choices[0].message.content에, 토큰 수는
usage에 들어 있습니다. enable_thinking은 Qwen3 채팅 템플릿의 사고 모드 스위치입니다.
3. OpenAI Python SDK로 요청
1
2
3
4
5
6
7
8
9
10
11
12 | from openai import OpenAI
client = OpenAI(api_key="EMPTY", base_url="http://localhost:8000/v1")
chat_completion = client.chat.completions.create(
model="Qwen/Qwen3-8B",
messages=[{"role": "user", "content": "LPU가 무엇인지 한 문장으로 설명해 주세요."}],
max_tokens=64,
temperature=0.7,
top_p=0.8,
)
print(chat_completion.choices[0].message.content)
|
오프라인 추론
1
2
3
4
5
6
7
8
9
10
11
12 | from vllm import LLM, SamplingParams
llm = LLM(model="Qwen/Qwen3-8B", max_model_len=4096, enable_prefix_caching=False, async_scheduling=False)
prompts = [
"The capital of France is",
"The largest planet in the solar system is",
]
outputs = llm.generate(prompts, SamplingParams(temperature=0, max_tokens=16))
for output in outputs:
print(output.prompt, "->", output.outputs[0].text)
|
generate에 넘긴 프롬프트는 한 번에 묶여 처리됩니다.
LPU 두 장으로 실행
LPU마다 복제본을 하나씩 두고 서버 하나로 묶습니다(DP).
| vllm serve Qwen/Qwen3-8B --max-model-len 16384 --data-parallel-size 2 --no-enable-prefix-caching --no-async-scheduling
|
모델 하나를 두 LPU에 나눕니다(PP).
| vllm serve Qwen/Qwen3-8B --max-model-len 16384 --pipeline-parallel-size 2 --no-enable-prefix-caching --no-async-scheduling
|
자세한 내용은 여러 LPU 사용하기에 있습니다.
참고
- dtype — LPU는
bfloat16으로 계산합니다.
- 컨텍스트 — 최대 16,384 토큰.
--max-model-len을 작게 잡을수록 요청당 KV 캐시가 줄어 동시 요청이
늘어납니다. 컨텍스트와 KV 캐시를 참고합니다.
- 샘플링 — greedy와
temperature / top_k / top_p는 LPU에서 실행합니다.
LPU 샘플링을 참고합니다.
다음