[Docs] Tune DeepSeek-V4 HiCache for MI355X PD (#31452)
Signed-off-by: Duyi-Wang <duyi.wang@amd.com>
This commit is contained in:
@@ -52,11 +52,11 @@ docker run --gpus all \
|
|||||||
AMD uses the daily-updated `lmsysorg/sglang-rocm` images. You can find the latest images on [Docker Hub](https://hub.docker.com/r/lmsysorg/sglang-rocm/tags). We recommend the ROCm 7.2 version.
|
AMD uses the daily-updated `lmsysorg/sglang-rocm` images. You can find the latest images on [Docker Hub](https://hub.docker.com/r/lmsysorg/sglang-rocm/tags). We recommend the ROCm 7.2 version.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
- **MI355X** → `lmsysorg/sglang-rocm:v0.5.13.post1-rocm720-mi35x-20260623`
|
- **MI355X** → `lmsysorg/sglang-rocm:v0.5.14-rocm720-mi35x-20260710`
|
||||||
- **MI300X** → `lmsysorg/sglang-rocm:v0.5.13.post1-rocm720-mi30x-20260623`
|
- **MI300X** → `lmsysorg/sglang-rocm:v0.5.13.post1-rocm720-mi30x-20260623`
|
||||||
|
|
||||||
```bash Command
|
```bash Command
|
||||||
docker pull lmsysorg/sglang-rocm:v0.5.13.post1-rocm720-mi35x-20260623
|
docker pull lmsysorg/sglang-rocm:v0.5.14-rocm720-mi35x-20260710
|
||||||
|
|
||||||
docker run \
|
docker run \
|
||||||
--device=/dev/kfd --device=/dev/dri \
|
--device=/dev/kfd --device=/dev/dri \
|
||||||
@@ -66,7 +66,7 @@ docker run \
|
|||||||
-p 30000:30000 \
|
-p 30000:30000 \
|
||||||
-v ~/.cache/huggingface:/root/.cache/huggingface \
|
-v ~/.cache/huggingface:/root/.cache/huggingface \
|
||||||
--env "HF_TOKEN=<your-hf-token>" \
|
--env "HF_TOKEN=<your-hf-token>" \
|
||||||
lmsysorg/sglang-rocm:v0.5.13.post1-rocm720-mi35x-20260623 \
|
lmsysorg/sglang-rocm:v0.5.14-rocm720-mi35x-20260710 \
|
||||||
sglang serve <use args below>
|
sglang serve <use args below>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1015,8 +1015,16 @@ export const Playground = ({ config }) => {
|
|||||||
]);
|
]);
|
||||||
if (value.enable) {
|
if (value.enable) {
|
||||||
const isAmd = sel && /^mi\d/.test(sel.hw);
|
const isAmd = sel && /^mi\d/.test(sel.hw);
|
||||||
const ratio = (isAmd && fc.amdIo && fc.amdIo.ratio) || 2;
|
const pdMode = h.findFlagArg(flags, "--disaggregation-mode") || "off";
|
||||||
const useAmdIo = isAmd && fc.amdIo;
|
const pdBackend = h.findFlagArg(flags, "--disaggregation-transfer-backend");
|
||||||
|
const roleOverride = (fc.roleOverrides || []).find((item) => {
|
||||||
|
if (!item || item.mode !== pdMode) return false;
|
||||||
|
if (item.transferBackend && item.transferBackend !== pdBackend) return false;
|
||||||
|
return !item.when || h.matchConstraint(sel, item.when);
|
||||||
|
});
|
||||||
|
const amdIo = roleOverride || (isAmd && fc.amdIo);
|
||||||
|
const ratio = (amdIo && amdIo.ratio) || 2;
|
||||||
|
const useAmdIo = isAmd && amdIo;
|
||||||
const adds = [
|
const adds = [
|
||||||
"--enable-hierarchical-cache",
|
"--enable-hierarchical-cache",
|
||||||
`--hicache-ratio ${ratio}`,
|
`--hicache-ratio ${ratio}`,
|
||||||
@@ -1028,19 +1036,21 @@ export const Playground = ({ config }) => {
|
|||||||
// for AMD ROCm overrides (e.g. page_first_direct + direct on MI355X).
|
// for AMD ROCm overrides (e.g. page_first_direct + direct on MI355X).
|
||||||
// Default (NVIDIA): page_first_direct + direct, ratio 2.
|
// Default (NVIDIA): page_first_direct + direct, ratio 2.
|
||||||
if (useAmdIo) {
|
if (useAmdIo) {
|
||||||
adds.push(`--hicache-mem-layout ${fc.amdIo.memLayout}`,
|
adds.push(`--hicache-mem-layout ${amdIo.memLayout}`,
|
||||||
`--hicache-io-backend ${fc.amdIo.ioBackend}`);
|
`--hicache-io-backend ${amdIo.ioBackend}`);
|
||||||
} else if (value.backend) {
|
} else if (value.backend) {
|
||||||
adds.push("--hicache-mem-layout page_first_direct",
|
adds.push("--hicache-mem-layout page_first_direct",
|
||||||
"--hicache-io-backend direct");
|
"--hicache-io-backend direct");
|
||||||
}
|
}
|
||||||
const writePolicy = (value.writePolicy && value.writePolicy !== "auto")
|
const writePolicy = (value.writePolicy && value.writePolicy !== "auto")
|
||||||
? value.writePolicy : "write_through";
|
? value.writePolicy : ((amdIo && amdIo.writePolicy) || "write_through");
|
||||||
adds.push(`--hicache-write-policy ${writePolicy}`);
|
adds.push(`--hicache-write-policy ${writePolicy}`);
|
||||||
// When amdStorageFileOnly is set, AMD emits storage flags only for "file".
|
// When amdStorageFileOnly is set, AMD emits storage flags only for "file".
|
||||||
if ((isAmd && fc.amdStorageFileOnly) ? value.backend === "file" : !!value.backend) {
|
if ((isAmd && fc.amdStorageFileOnly) ? value.backend === "file" : !!value.backend) {
|
||||||
adds.push(`--hicache-storage-backend ${value.backend}`,
|
adds.push(`--hicache-storage-backend ${value.backend}`,
|
||||||
"--hicache-storage-prefetch-policy wait_complete");
|
`--hicache-storage-prefetch-policy ${(amdIo && amdIo.prefetchPolicy) || "wait_complete"}`);
|
||||||
|
} else if (amdIo && amdIo.prefetchPolicy) {
|
||||||
|
adds.push(`--hicache-storage-prefetch-policy ${amdIo.prefetchPolicy}`);
|
||||||
}
|
}
|
||||||
flags = h.insertBeforeTail(flags, adds);
|
flags = h.insertBeforeTail(flags, adds);
|
||||||
}
|
}
|
||||||
@@ -1283,8 +1293,22 @@ export const Playground = ({ config }) => {
|
|||||||
? `# then front BOTH with the Router (SGLang Model Gateway) shown below.\n`
|
? `# then front BOTH with the Router (SGLang Model Gateway) shown below.\n`
|
||||||
+ `# Client traffic (cURL) targets the router (:${routerPort}), not this role server.`
|
+ `# Client traffic (cURL) targets the router (:${routerPort}), not this role server.`
|
||||||
: `# then front BOTH with a router; client traffic targets the router, not this role server.`;
|
: `# then front BOTH with a router; client traffic targets the router, not this role server.`;
|
||||||
|
const hicacheCfg = config.playgroundFeatures
|
||||||
|
&& config.playgroundFeatures.hicache;
|
||||||
|
const pdBackend = findFlagArg(f, "--disaggregation-transfer-backend");
|
||||||
|
const hicacheEnabled = f.some((x) => x === "--enable-hierarchical-cache");
|
||||||
|
const hicacheNotice = hicacheEnabled && hicacheCfg
|
||||||
|
? (hicacheCfg.notices || []).find((item) => {
|
||||||
|
if (!item || item.mode !== pdMode) return false;
|
||||||
|
if (item.transferBackend && item.transferBackend !== pdBackend) return false;
|
||||||
|
return !item.when || matchConstraint(sel, item.when);
|
||||||
|
})
|
||||||
|
: null;
|
||||||
|
const noticeLine = hicacheNotice && hicacheNotice.text
|
||||||
|
? `# Note: ${hicacheNotice.text}\n` : "";
|
||||||
const banner =
|
const banner =
|
||||||
`# === PD Disaggregation: ${pdMode.toUpperCase()} role ===\n` +
|
`# === PD Disaggregation: ${pdMode.toUpperCase()} role ===\n` +
|
||||||
|
noticeLine +
|
||||||
`# Runs the ${pdMode} server. Also run the ${sibling} role on its peer host,\n` +
|
`# Runs the ${pdMode} server. Also run the ${sibling} role on its peer host,\n` +
|
||||||
routerLine;
|
routerLine;
|
||||||
cmd = `${banner}\n${cmd}`;
|
cmd = `${banner}\n${cmd}`;
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ sgl-eval run aime25 \\
|
|||||||
// AMD daily-updated lmsysorg/sglang-rocm images. Bump the dated tag when you
|
// AMD daily-updated lmsysorg/sglang-rocm images. Bump the dated tag when you
|
||||||
// re-verify on a newer build.
|
// re-verify on a newer build.
|
||||||
mi300x: "lmsysorg/sglang-rocm:v0.5.13.post1-rocm720-mi30x-20260623",
|
mi300x: "lmsysorg/sglang-rocm:v0.5.13.post1-rocm720-mi30x-20260623",
|
||||||
mi355x: "lmsysorg/sglang-rocm:v0.5.14-rocm720-mi35x-20260708",
|
mi355x: "lmsysorg/sglang-rocm:v0.5.14-rocm720-mi35x-20260710",
|
||||||
},
|
},
|
||||||
|
|
||||||
// Pre-selects the issue template's `model` dropdown on "Submit verified cell".
|
// Pre-selects the issue template's `model` dropdown on "Submit verified cell".
|
||||||
@@ -325,6 +325,32 @@ sgl-eval run aime25 \\
|
|||||||
excludesHw: ["rtx6000"],
|
excludesHw: ["rtx6000"],
|
||||||
// AMD ROCm (MI300X/MI325X/MI350X/MI355X): page_first_direct + direct io.
|
// AMD ROCm (MI300X/MI325X/MI350X/MI355X): page_first_direct + direct io.
|
||||||
amdIo: { memLayout: "page_first_direct", ioBackend: "direct", ratio: 4 },
|
amdIo: { memLayout: "page_first_direct", ioBackend: "direct", ratio: 4 },
|
||||||
|
roleOverrides: [
|
||||||
|
{
|
||||||
|
when: {
|
||||||
|
hw: ["mi355x"], variant: ["pro"], quant: ["fp4"],
|
||||||
|
strategy: ["low-latency"], nodes: ["single"],
|
||||||
|
},
|
||||||
|
mode: "prefill",
|
||||||
|
transferBackend: "mori",
|
||||||
|
memLayout: "page_first",
|
||||||
|
ioBackend: "direct",
|
||||||
|
ratio: 5,
|
||||||
|
writePolicy: "write_through",
|
||||||
|
prefetchPolicy: "best_effort",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
notices: [
|
||||||
|
{
|
||||||
|
when: {
|
||||||
|
hw: ["mi355x"], variant: ["pro"], quant: ["fp4"],
|
||||||
|
strategy: ["low-latency"], nodes: ["single"],
|
||||||
|
},
|
||||||
|
mode: "decode",
|
||||||
|
transferBackend: "mori",
|
||||||
|
text: "HiCache is not recommended on the decode role with MORI.",
|
||||||
|
},
|
||||||
|
],
|
||||||
amdStorageFileOnly: true,
|
amdStorageFileOnly: true,
|
||||||
backends: [
|
backends: [
|
||||||
{ id: null, label: "Auto" },
|
{ id: null, label: "Auto" },
|
||||||
|
|||||||
Reference in New Issue
Block a user