Kimi-K2.6

Kimi-K2.6

Kimi-K2.6은 Moonshot AI가 개발한 오픈소스 네이티브 멀티모달 에이전트 모델이에요. 이 문서는 Ascend NPU에서 SGLang으로 Kimi-K2.6을 배포하는 방법을 안내합니다.

출처: 문서

본문

소개 (Introduction)

Kimi-K2.6은 Moonshot AI가 개발한 오픈소스 네이티브 멀티모달 에이전트 모델로, Kimi-K2-Base 위에 약 15조 개의 혼합 시각·텍스트 토큰으로 지속 사전학습(continual pretraining)을 통해 만들어졌어요. Multi-head Latent Attention(MLA)과 MoE 아키텍처를 갖춘 Mixture-of-Experts(MoE) 모델로, 총 1T 파라미터에 활성 파라미터 32B를 갖추고 있습니다. 이 모델은 고급 에이전트 기능과 시각·언어 이해를 매끄럽게 통합하며, instant 모드와 thinking 모드, 그리고 대화형·에이전트 패러다임을 모두 지원합니다.

이 문서는 SGLang을 사용하여 Ascend NPU에서 Kimi-K2.6을 배포하는 방법을 보여줘요. 단일 노드 PD mixed 모드, 다중 노드 PD mixed 모드, 다중 노드 PD disaggregation 모드, 기능 구성, 성능 최적화를 포함합니다.

이 문서는 SGLang v0.5.16을 기준으로 검증·작성되었어요. 현재 모델(Kimi-K2.6)은 이 버전에서 완전히 지원됩니다. 최신 기능(예: speculative decoding, multimodal)을 사용하려면 v0.5.16 이상 버전을 권장합니다.

지원 기능 (Supported features)

기능 (Feature) 사용 예시 (Example usage)
Tensor Parallelism --tp-size 16
Data Parallelism --dp-size 16
Expert Parallelism --ep-size 16 \
--moe-a2a-backend deepep \
--deepep-mode auto
PD Disaggregation --disaggregation-mode prefill \
--disaggregation-transfer-backend ascend
Quantization --quantization modelslim
Chunked Prefill 디바이스 메모리에 따라 자동 설정, 또는 명시적 값 설정;
--chunked-prefill-size -1로 비활성화; 예: --chunked-prefill-size 32768
NPU Graph 기본 활성화됨; --disable-cuda-graph로 비활성화;
범위는 --cuda-graph-bs-decode 또는 --cuda-graph-max-bs-decode로 제어; 예: --cuda-graph-bs-decode 1 2 4 8 12 16 24 32 48 64 96 120
Speculative Decoding --speculative-algorithm EAGLE3 \
--speculative-draft-model-path /path/to/draft-model-weights \
--speculative-num-steps 4 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 5 \
--speculative-draft-model-quantization unquant
Overlap Schedule export SGLANG_ENABLE_OVERLAP_PLAN_STREAM=1
DP LM Head --enable-dp-lm-head
MLAPO export SGLANG_NPU_USE_MLAPO=1
Multistream MoE export SGLANG_NPU_USE_MULTI_STREAM=1

Example usage 열의 값은 설명을 위한 예시일 뿐이에요. 하드웨어, 배포 모드, 워크로드에 맞게 조정하세요. 파라미터 세부 사항은 기능 설명을, 각 배포 시나리오의 권장 구성은 모범 사례를 참고하세요.

기능 간 호환성과 충돌 정보는 기능 호환성 (Feature Compatibility)을 참고하세요.

사전 요구사항 (Prerequisites)

환경 (Environment)

이 튜토리얼을 따르기 전에 아래 문서에서 환경 설정을 완료하세요:

  • Ascend NPU 퀵스타트 — 가장 빠르게 시작하는 방법이에요. 공식 컨테이너 이미지 실행, SGLang 서버 시작, 테스트 요청 전송을 안내합니다. Ascend에서 SGLang이 처음이라면 추천해요.
  • NPU 지원 SGLang 설치 — 전체 설치 가이드예요. 컴포넌트 버전 매핑(CANN, TorchNPU, Triton, kernels 등), 소스 또는 Dockerfile에서 빌드, 권장 시스템 설정(CPU 전원 구성, NUMA, swap)을 다룹니다. 공식 이미지 대신 설치하거나 커스터마이즈해야 할 때 사용하세요.

모델 가중치 (Model weights)

모델 가중치를 다운로드하기 전에 모델 크기를 확인해서 충분한 디스크 공간을 확보하세요. 다중 노드 배포 시에는 모든 노드가 접근 가능한 공유 디렉터리에 가중치를 다운로드하세요.

자원 사용량을 줄이고 처리량을 높이려면 W4A8 변형 배포를 권장해요. W4A8(535.91GB)은 16 × 64GB 디바이스 메모리(--tp-size 16)에 배포할 수 있어요. 이는 A3 시리즈 전체 1노드(8장 카드, 16개 die) 또는 A2 시리즈 2노드에 해당합니다.

이는 최소 권장 구성이에요. 최적화된 구성은 모범 사례를 확인하세요. 추가 카드나 노드가 필요할 수 있어요.

하드웨어 사양(카드당 die당 메모리, 사이즈, A2 시리즈와 A3 시리즈의 차이)은 Ascend NPU 참조 — 하드웨어를 확인하세요.

설치 (Installation)

NPU 런타임 환경에 필요한 종속성은 Docker 이미지에 통합되어 온라인 플랫폼에 업로드되어 있어서, 바로 pull할 수 있어요.

**안정 릴리스(stable releases)**와 **데일리 빌드(daily builds)**를 모두 사용할 수 있어요. 아래 명령은 안정 릴리스 태그 기준이에요. 자세한 내용은 Docker 이미지 버전을 참고하세요.

Ascend A3 시리즈:

docker pull quay.io/ascend/sglang:cann9.0.0-a3-v0.5.16

docker run -itd --shm-size=16g --name ${NAME} \
--privileged=true --net=host \
-v /var/queue_schedule:/var/queue_schedule \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-v /usr/local/sbin:/usr/local/sbin \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
-v /usr/local/Ascend/firmware:/usr/local/Ascend/firmware \
--device=/dev/davinci0:/dev/davinci0  \
--device=/dev/davinci1:/dev/davinci1  \
--device=/dev/davinci2:/dev/davinci2  \
--device=/dev/davinci3:/dev/davinci3  \
--device=/dev/davinci4:/dev/davinci4  \
--device=/dev/davinci5:/dev/davinci5  \
--device=/dev/davinci6:/dev/davinci6  \
--device=/dev/davinci7:/dev/davinci7  \
--device=/dev/davinci8:/dev/davinci8  \
--device=/dev/davinci9:/dev/davinci9  \
--device=/dev/davinci10:/dev/davinci10  \
--device=/dev/davinci11:/dev/davinci11  \
--device=/dev/davinci12:/dev/davinci12  \
--device=/dev/davinci13:/dev/davinci13  \
--device=/dev/davinci14:/dev/davinci14  \
--device=/dev/davinci15:/dev/davinci15  \
--device=/dev/davinci_manager:/dev/davinci_manager \
--device=/dev/hisi_hdc:/dev/hisi_hdc \
--entrypoint=bash \
quay.io/ascend/sglang:cann9.0.0-a3-v0.5.16

Ascend A2 시리즈:

docker pull quay.io/ascend/sglang:cann9.0.0-910b-v0.5.16

docker run -itd --shm-size=16g --name ${NAME} \
--privileged=true --net=host \
-v /var/queue_schedule:/var/queue_schedule \
-v /etc/ascend_install.info:/etc/ascend_install.info \
-v /usr/local/sbin:/usr/local/sbin \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
-v /usr/local/Ascend/firmware:/usr/local/Ascend/firmware \
--device=/dev/davinci0:/dev/davinci0  \
--device=/dev/davinci1:/dev/davinci1  \
--device=/dev/davinci2:/dev/davinci2  \
--device=/dev/davinci3:/dev/davinci3  \
--device=/dev/davinci4:/dev/davinci4  \
--device=/dev/davinci5:/dev/davinci5  \
--device=/dev/davinci6:/dev/davinci6  \
--device=/dev/davinci7:/dev/davinci7  \
--device=/dev/davinci_manager:/dev/davinci_manager \
--device=/dev/hisi_hdc:/dev/hisi_hdc \
--entrypoint=bash \
quay.io/ascend/sglang:cann9.0.0-910b-v0.5.16
  • 모델 가중치가 이미 공유 디렉터리에 다운로드되어 있다면 -v로 모델 경로를 컨테이너에 마운트하세요. 예: -v /path/to/models:/models.
  • ${NAME}을 자신의 컨테이너 이름으로 바꾸거나, --name을 제거해서 기본 이름을 사용하세요.

온라인 서비스 배포 (Online service deployment)

단일 노드 온라인 배포 (Single-node online deployment)

단일 노드 배포는 같은 노드 안에서 prefill과 decode를 모두 수행합니다(PD mixed 모드). 하드웨어 자원이 제한된 시나리오에 적합해요. 이 시나리오는 이미 모범 사례에서 다루고 있답니다. 완전하고 최적화된 배포 명령과 벤치마크 데이터는 Kimi-K2.6 모범 사례 — PD Mixed On A3 Series을 참고하세요.

다중 노드 온라인 배포 (Multi-node online deployment)

다중 노드 배포는 텐서 병렬 처리를 사용해 모델을 여러 Ascend A3 시리즈 노드에 분산하면서 prefill과 decode를 같은 노드에 유지합니다(PD mixed 모드). 단일 노드로는 제공할 수 없는 더 많은 디바이스 메모리가 필요한 시나리오에 적합해요. 이 시나리오는 이미 모범 사례에서 다루고 있답니다. 완전하고 최적화된 배포 명령과 벤치마크 데이터는 Kimi-K2.6 모범 사례 — Multi-node On A3 Series을 참고하세요.

다중 노드 PD disaggregation 배포 (Multi-node PD disaggregation deployment)

PD disaggregation은 prefill과 decode 단계를 별도 노드로 분리해서 간섭을 줄이고, 높은 동시성 시나리오에서 처리량을 개선해요. 이 시나리오는 이미 모범 사례에서 다루고 있답니다.

기능 검증 (Functional verification)

서비스가 시작된 후 prompt를 보내서 모델을 호출할 수 있어요:

# ============================================================
# Before running, update the following variables:
#   HOST: the server host address (e.g., localhost)
#   PORT: the server port number (e.g., 6689)
# ============================================================

curl http://${HOST}:${PORT}/generate \
    -H "Content-Type: application/json" \
    -d '{
        "text": "What is the capital of France?",
        "sampling_params": {
            "max_new_tokens": 64,
            "temperature": 0
        }
    }'

기대 결과: "Paris"를 포함한 생성 텍스트가 들어있는 HTTP 200 응답이에요.

멀티모달 요청(텍스트 + 이미지):

# ============================================================
# Before running, update the following variables:
#   HOST: the server host address (e.g., localhost)
#   PORT: the server port number (e.g., 6689)
# ============================================================

curl http://${HOST}:${PORT}/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "Kimi-K2.6-w4a8",
        "messages": [\
            {\
                "role": "user",\
                "content": [\
                    {"type": "image_url", "image_url": {"url": "https://raw.githubusercontent.com/sgl-project/sglang/main/examples/assets/example_image.png"}},\
                    {"type": "text", "text": "Describe this image."}\
                ]\
            }\
        ]
    }'

기대 결과: 이미지를 설명하는 내용이 들어있는 HTTP 200 응답이에요.

서버가 로그에 The server is fired up and ready to roll!를 출력하면 요청을 받을 준비가 된 거예요. 더 많은 테스트 예시(Health Check, Generate, Chat Completions, 포트 사용 안내)는 서비스 테스트를 참고하세요.

정확도 평가 (Accuracy evaluation)

정확도 평가 방법과 데이터셋은 Ascend NPU에서 정확도 평가를 참고하세요.

성능 (Performance)

성능 데이터와 벤치마크 명령은 Ascend NPU에서 성능 테스트를 참고하세요.

모범 사례 (Best practices)

모범 사례 구성 참조 (Best practice configuration reference)

배포 스크립트와 벤치마크 명령이 포함된 완전한 최적 구성은 Kimi-K2.6 모범 사례 페이지를 참고하세요.

성능 튜닝 (Performance tuning)

지원되는 기능의 전체 목록은 지원 기능을, 자세한 최적화 안내는 Ascend NPU 최적화를 참고하세요.

FAQ

일반적인 환경, 설치, 파라미터 문제는 Ascend NPU FAQ를 참고하세요.

더 알아보기 (Learn more)