[NPU] [DOC] Add Ascend NPU (A3) recipe to the Kimi-K3 cookbook (#35508)

This commit is contained in:
amote-i
2026-08-23 21:21:27 +08:00
committed by GitHub
parent 886e37a649
commit 9b1b06b8e6
5 changed files with 331 additions and 71 deletions
+36 -6
View File
@@ -9,7 +9,7 @@
// hardware optional — per-model GPUs the shared HARDWARE_CATALOG lacks:
// {id, label, vram, vendor}[] merged into the catalog at render
// (so a model-specific GPU never needs an engine-catalog edit);
// vendor picks the selector group: blackwell | hopper | amd.
// vendor picks the selector group: blackwell | hopper | amd | npu.
// `multiNodeDockerFlags: string[]` (either source) adds
// `docker run` flags the platform's fabric needs
// groupHardware optional — set false to show one flat hardware row
@@ -133,6 +133,11 @@ export const Deployment = ({ config, benchmarks }) => {
{ id: "mi350x", label: "MI350X", vram: "288GB" },
{ id: "mi355x", label: "MI355X", vram: "288GB" },
],
// Atlas 800I A3 (910C): 1 card = 2 dies, so --tp-size is 2× the card
// count (32 cards -> --tp-size 64).
npu: [
{ id: "a3", label: "Atlas 800I A3", vram: "64GB/die" },
],
};
// ==== 2. Style helper (dark-mode-aware) ====
@@ -737,7 +742,7 @@ export const Deployment = ({ config, benchmarks }) => {
// Insert the multi-node trio after the last parallelism flag,
// falling back to right after --model-path.
const PARALLELISM_ANCHORS = new Set([
"--enable-dp-attention", "--dp", "--tp-size", "--tp",
"--enable-dp-attention", "--dp-size", "--dp", "--tp-size", "--tp",
"--sp-degree", "--ulysses-degree", "--ring-degree",
]);
let i = flags.reduce(
@@ -800,6 +805,25 @@ export const Deployment = ({ config, benchmarks }) => {
" --cap-add=SYS_PTRACE --security-opt seccomp=unconfined",
" --shm-size 32g",
]
: vendorOf(sel.hw) === "npu"
? [
// NPU: --privileged grants the davinci devices (16 dies on an
// 8-card Atlas 800I A3 node); the host CANN driver/firmware/state
// must be mounted in.
"docker run --privileged --shm-size=16g",
" --device=/dev/davinci0 --device=/dev/davinci1 --device=/dev/davinci2 --device=/dev/davinci3",
" --device=/dev/davinci4 --device=/dev/davinci5 --device=/dev/davinci6 --device=/dev/davinci7",
" --device=/dev/davinci8 --device=/dev/davinci9 --device=/dev/davinci10 --device=/dev/davinci11",
" --device=/dev/davinci12 --device=/dev/davinci13 --device=/dev/davinci14 --device=/dev/davinci15",
" --device=/dev/davinci_manager",
" --device=/dev/hisi_hdc",
" -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",
" -v /etc/ascend_install.info:/etc/ascend_install.info",
" -v /var/queue_schedule:/var/queue_schedule",
" -v ~/.cache/:/root/.cache/",
]
: [
"docker run --gpus all",
" --shm-size 32g",
@@ -811,7 +835,9 @@ export const Deployment = ({ config, benchmarks }) => {
// just maps the serve port.
hostNetwork ? " --network host" : ` -p ${servePort}:${servePort}`,
...(multinode ? fabricFlagsOf(sel.hw).map((f) => " " + f) : []),
" -v ~/.cache/huggingface:/root/.cache/huggingface",
// The NPU device block already mounts ~/.cache/.
...(vendorOf(sel.hw) === "npu"
? [] : [" -v ~/.cache/huggingface:/root/.cache/huggingface"]),
...(config.dockerMounts || []).map((mount) => ` -v ${mount}`),
// HF token only for gated checkpoints — configs that declare an HF_TOKEN placeholder.
...(config.placeholders && config.placeholders.HF_TOKEN
@@ -1348,10 +1374,12 @@ export const Deployment = ({ config, benchmarks }) => {
const builderMeta = (cell && cell.builder) || {};
const verifyStatus = cellVerifyStatus(cell, sel);
// Pin the calculator-computed ratio into the rendered command (before the
// host/port tail); cells themselves stay ratio-free.
// host/port tail); cells themselves stay ratio-free. Cells sizing the pool
// with --max-mamba-cache-size opt out.
const cellWithRatio = (() => {
if (!cell || !mambaRatio) return cell;
if (cell.flags.some((f) => f.startsWith("--mamba-full-memory-ratio"))) return cell;
if (cell.flags.some((f) =>
f.startsWith("--mamba-full-memory-ratio") || f.startsWith("--max-mamba-cache-size"))) return cell;
const flags = [...cell.flags];
const line = `--mamba-full-memory-ratio ${mambaRatio}`;
const i = flags.findIndex((f) => f.startsWith("--host"));
@@ -1638,7 +1666,9 @@ export const Deployment = ({ config, benchmarks }) => {
}}
title={
disabled
? item.disableReason || "Not supported for current selection"
? (typeof item.disableReason === "function"
? item.disableReason(sel)
: item.disableReason) || "Not supported for current selection"
: ""
}
onClick={(e) => {