Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
7cd89a6
feat: add Kimi K3 B300 EFA AgentX sweep
wzhao18 Oct 19, 2026
be199fc
fix: pin AWS libfabric source and document B300 sweep patches
wzhao18 Oct 19, 2026
17add7f
fix: prepare Mooncake build dependencies and cross-node DCP fallback
wzhao18 Oct 19, 2026
a9b8f30
fix: include Mooncake MessagePack development headers
wzhao18 Oct 19, 2026
6a35874
fix: use the Mooncake allocator build target
wzhao18 Oct 19, 2026
e3c8ef5
fix: avoid cross-node multicast in B300 aggregate decode
wzhao18 Oct 19, 2026
6f13a99
fix: provide Python command for Mooncake wheel packaging
wzhao18 Oct 19, 2026
064a205
fix: use NCCL for cross-node B300 aggregate collectives
wzhao18 Oct 19, 2026
bde7f84
fix: use the B300 runner CPU allocation policy
wzhao18 Oct 19, 2026
9715529
fix: make Mooncake wheel library paths relocatable
wzhao18 Oct 19, 2026
03586db
chore: sync B300 sweep with upstream main
wzhao18 Oct 19, 2026
e26a25b
fix: skip MNNVL custom allreduce probing across B300 nodes
wzhao18 Oct 19, 2026
2e66bdb
fix: allow portable Kimi K3 model paths across B300 nodes
wzhao18 Oct 19, 2026
ee970fb
fix: collapse mixed-page EFA host buffers before registration
wzhao18 Oct 19, 2026
97530fb
chore: sync B300 sweep with upstream main
wzhao18 Oct 19, 2026
ca54dea
fix: exclude B300 node with reproducible Slurm launch failure
wzhao18 Oct 19, 2026
a29d4c5
chore: sync B300 sweep with upstream main
wzhao18 Oct 19, 2026
519cdf7
fix(kimik3-b300): keep EFA-registered KV off CUDA VMM; no requeue; ve…
wzhao18 Oct 20, 2026
915861e
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 20, 2026
06580d6
fix(kimik3-b300): keep cross-node TP16 NCCL buffers off CUDA VMM; no …
wzhao18 Oct 20, 2026
465d9aa
fix(b300-dsxe): refuse and exclude nodes whose EFA devices failed reg…
wzhao18 Oct 20, 2026
bfbb5a9
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 20, 2026
31af465
fix(kimik3-b300): route same-node EFA transfers through the NIC
wzhao18 Oct 20, 2026
aa0d514
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 20, 2026
8ba89f7
Revert "fix(kimik3-b300): route same-node EFA transfers through the NIC"
wzhao18 Oct 20, 2026
1e23f43
fix(kimik3-b300): register Mooncake GPU buffers only on PCIe-local EF…
wzhao18 Oct 20, 2026
34fceb1
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 20, 2026
8110949
chore: restore perf-changelog to main plus this PR's entry
wzhao18 Oct 20, 2026
2d5a18c
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 20, 2026
c8e53e2
chore: end perf-changelog with a newline
wzhao18 Oct 20, 2026
7a33f2e
fix(kimik3-b300): restore NCCL cuMem on the TP16 aggregate point
wzhao18 Oct 20, 2026
76b08ca
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 20, 2026
35a1981
chore: trigger non-canary sweep
wzhao18 Oct 20, 2026
02bfe77
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 20, 2026
e421cb1
fix(b300-dsxe): exclude node 05 until its page cache is dropped
wzhao18 Oct 20, 2026
075e50a
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 20, 2026
4412e54
chore(kimik3-b300): run the sweep without evals
wzhao18 Oct 20, 2026
66b0ad1
Disable B300 Kimi K3 aggregated c1/c2/c4 runs for future sweeps
wzhao18 Oct 20, 2026
5a386a6
Fix Kimi K3 B300 Mooncake EFA NIC indexing with MC_MS_FILTERS
wzhao18 Oct 21, 2026
25daed5
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 21, 2026
b14e1ee
Fix Kimi K3 B300 EFA prefill hang
wzhao18 Oct 22, 2026
e41c768
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 22, 2026
b935282
Kimi K3 B300 EFA: disable custom allreduce, drop changes that did not…
wzhao18 Oct 22, 2026
aa27cd1
Merge branch 'main' of https://github.com/SemiAnalysisAI/InferenceX i…
wzhao18 Oct 22, 2026
504eb5e
Kimi K3 B300 EFA: disable async scheduling instead of custom allreduce
wzhao18 Oct 22, 2026
b40249a
Kimi K3 B300 EFA: drop async-scheduling workaround; turn off prefill …
wzhao18 Oct 22, 2026
00990ea
Merge branch 'main' of https://github.com/SemiAnalysisAI/InferenceX i…
wzhao18 Oct 22, 2026
eb928ae
Kimi K3 B300 EFA: run prefill in eager mode; restore prefill KV events
wzhao18 Oct 25, 2026
658c124
Merge remote-tracking branch 'origin/main' into wzhao/kimi-k3-b300-ef…
wzhao18 Oct 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/vllm/envs.py b/vllm/envs.py
--- a/vllm/envs.py
+++ b/vllm/envs.py
@@ -1659,3 +1659,7 @@
+ # The fused Kimi K3 latent MoE tail requires NVLink multicast.
+ "VLLM_ENABLE_K3_LATENT_MOE_TAIL_FUSION": lambda: bool(
+ int(os.getenv("VLLM_ENABLE_K3_LATENT_MOE_TAIL_FUSION", "1"))
+ ),
# Use the SM100 BF16 GEMM-AR kernel for eligible Kimi-K3 row-parallel
# attention projections. All TP ranks must belong to one NVLink domain.
"VLLM_KIMI_K3_GEMM_AR": lambda: bool(int(os.getenv("VLLM_KIMI_K3_GEMM_AR", "1"))),
diff --git a/vllm/models/kimi_k3/nvidia/latent_moe_runner.py b/vllm/models/kimi_k3/nvidia/latent_moe_runner.py
--- a/vllm/models/kimi_k3/nvidia/latent_moe_runner.py
+++ b/vllm/models/kimi_k3/nvidia/latent_moe_runner.py
@@ -75,4 +75,5 @@
self.enable_k3_latent_moe_tail_fusion = (
- current_platform.is_cuda()
+ envs.VLLM_ENABLE_K3_LATENT_MOE_TAIL_FUSION
+ and current_platform.is_cuda()
and current_platform.is_device_capability_family(100)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#!/usr/bin/env bash
set -eo pipefail

source /infmax-workspace/benchmarks/check_env.sh
check_env_vars KIMI_EFA_BUILD_CACHE LD_LIBRARY_PATH

export DEBIAN_FRONTEND=noninteractive
# The NVIDIA CUDA apt mirror is intermittently mid-sync (index size mismatch);
# retry instead of failing the whole worker setup.
for attempt in 1 2 3 4 5; do
apt-get update -qq && break
[ "$attempt" = 5 ] && exit 1
sleep $((attempt * 15))
done
apt-get install -y -qq --no-install-recommends \
autoconf automake build-essential ca-certificates curl git libboost-filesystem-dev \
libboost-system-dev libcurl4-openssl-dev libgflags-dev libgoogle-glog-dev \
libhwloc15 libibverbs-dev libjsoncpp-dev libmsgpack-dev libnuma-dev libprotobuf-dev libssl-dev \
libtool libxxhash-dev libyaml-cpp-dev libzstd-dev numactl patchelf pkg-config \
protobuf-compiler python-is-python3 cuda-nvml-dev-13-0

vllm_site_packages=$(python3 -c 'import importlib.util; from pathlib import Path; print(Path(importlib.util.find_spec("vllm").origin).parent.parent)')
tail_patch="$(dirname "${BASH_SOURCE[0]}")/kimi-k3-latent-tail-opt-out.patch"
if ! git -C "$vllm_site_packages" apply --reverse --check "$tail_patch" 2>/dev/null; then
git -C "$vllm_site_packages" apply "$tail_patch"
fi

task_dir=$(mktemp -d /tmp/kimi-k3-efa.XXXXXX)
curl -fsSL --retry 3 --retry-all-errors \
https://efa-installer.amazonaws.com/aws-efa-installer-1.50.0.tar.gz \
-o "$task_dir/efa.tar.gz"
printf '%s %s\n' \
fa6dff8593d866866c13cb4640d9059835cd4efa427971f100ab40c97bef2841 \
"$task_dir/efa.tar.gz" | sha256sum -c -
tar -xzf "$task_dir/efa.tar.gz" -C "$task_dir"
(
cd "$task_dir/aws-efa-installer"
./efa_installer.sh -y --skip-kmod --skip-limit-conf --no-verify --skip-mpi
)

cache="$KIMI_EFA_BUILD_CACHE/c3fa13ec-e83bf01a-collapse-hs-lb-v1"
mkdir -p "$cache"
exec 9>"$cache/build.lock"
flock 9
if [ ! -f "$cache/ready" ]; then
git clone https://github.com/aws/libfabric.git "$task_dir/libfabric"
git -C "$task_dir/libfabric" checkout --detach e83bf01a834a1a7c776d93efcaee3f8f28ff2705
git -C "$task_dir/libfabric" apply \
"$(dirname "${BASH_SOURCE[0]}")/libfabric-efa-vmm.patch"
(
cd "$task_dir/libfabric"
export PKG_CONFIG_PATH=/opt/amazon/efa/lib/pkgconfig
export CPPFLAGS=-I/opt/amazon/efa/include
export LDFLAGS=-L/opt/amazon/efa/lib
./autogen.sh
./configure --prefix=/opt/amazon/efa --with-cuda=/usr/local/cuda \
--enable-cuda-dlopen --enable-efa=yes --disable-static
make -j12
make DESTDIR="$task_dir/fabric-install" install
)
tar -czf "$cache/libfabric.tar.gz" -C "$task_dir/fabric-install" opt/amazon/efa
tar -xzf "$cache/libfabric.tar.gz" -C /
ldconfig

python3 -m pip install --no-cache-dir \
'cmake==4.4.4' 'build==1.6.1' 'auditwheel==6.8.2' \
'wheel==0.48.0' 'setuptools==84.0.0' numpy 'pybind11==3.1.0'
git clone https://github.com/kvcache-ai/Mooncake.git "$task_dir/Mooncake"
git -C "$task_dir/Mooncake" checkout --detach c3fa13ecaf1038df933dcb784ff8ffe026381100
git -C "$task_dir/Mooncake" apply \
"$(dirname "${BASH_SOURCE[0]}")/mooncake-efa-collapse-host-chunks.patch"
# Upstream #4704: do not hold the endpoint lock across the handshake RPC;
# bilateral active setup deadlocks both peers otherwise.
git -C "$task_dir/Mooncake" apply \
"$(dirname "${BASH_SOURCE[0]}")/mooncake-efa-handshake-lock.patch"
# Loopback copies on a private non-blocking stream instead of a synchronous
# legacy-stream cudaMemcpy that can deadlock against concurrent collectives.
git -C "$task_dir/Mooncake" apply \
"$(dirname "${BASH_SOURCE[0]}")/mooncake-efa-loopback-stream.patch"
git -C "$task_dir/Mooncake" submodule update --init --recursive
(
cd "$task_dir/Mooncake"
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON '-DCMAKE_INSTALL_RPATH=$ORIGIN' \
-DCMAKE_PREFIX_PATH=/opt/amazon/efa \
-DPython3_EXECUTABLE="$(command -v python3)" \
-DUSE_EFA=ON -DUSE_CUDA=ON -DUSE_ETCD=OFF \
-DWITH_STORE_RUST=OFF -DWITH_EP=OFF -DBUILD_UNIT_TESTS=OFF \
-DBUILD_BENCHMARK=OFF -DBUILD_EXAMPLES=ON
cmake --build build --parallel 12 --target \
engine store mooncake_master mooncake_client transfer_engine_bench build_nvlink_allocator
sed -i 's/^version = .*/version = "0.3.13.post1+gc3fa13ec.collapse1.hs1.lb1"/' \
mooncake-wheel/pyproject.toml
Comment on lines +68 to +93

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 (optional) Maintainers who bump the master config's Mooncake version get results labelled with the new version while the old wheel still runs. The script never reads the caller's version. kimik3-b300-efa-setup.sh is missing from INSTALLERS (infx/srt_slurm/workload.py:80), so KV_OFFLOAD_BACKEND_VERSION is never bound. The script hard-codes 0.3.13.post1+gc3fa13ec at lines 70 and 94. Fix: register the script in INSTALLERS as ("kv-offload-backend", "mooncake"), require KV_OFFLOAD_BACKEND_VERSION via check_env_vars, and use it for the wheel version, the cache key and the final assert.

Why this was flagged

Both new master entries in nvidia-master.yaml declare kv-offload-backend: {name: mooncake, version: 0.3.13.post1+gc3fa13ec}. _bind_components (infx/srt_slurm/workload.py:256-263) checks and binds that version only for scripts listed in INSTALLERS (workload.py:80-86). That list has vllm-mooncake.sh and kimik3-b300-mooncake.sh but not the new script. The new script does its own sed to version = "0.3.13.post1+gc3fa13ec" (line 70), pins checkout c3fa13ec... (line 57) and asserts the same literal (line 94). So the master version is only a label. If it changes, nothing installs the new version and nothing fails, so results are recorded under a backend version that did not run. The existing vllm-mooncake.sh takes its version from the caller through check_env_vars KV_OFFLOAD_BACKEND_VERSION. AGENTS.md says configuration must flow from the caller, and this script breaks that rule.

Verification: nit. Trigger: someone changes the disagg master entry's kv-offload-backend.version without also editing the script. INSTALLERS (infx/srt_slurm/workload.py:80-86) omits kimik3-b300-efa-setup.sh, so KV_OFFLOAD_BACKEND_VERSION is never bound. The script hard-codes the version in its sed (line 70) and final assert (line 94), so the old c3fa13ec wheel still runs and nothing would fail.

mkdir -p "$task_dir/wheels"
EFA_CU13_BUILD=1 OUTPUT_DIR="$task_dir/wheels" bash scripts/build_wheel.sh
)
cp "$task_dir/wheels/"*.whl "$cache/"
touch "$cache/ready"
fi
tar -xzf "$cache/libfabric.tar.gz" -C /
ldconfig

python3 -m pip uninstall -y \
mooncake-transfer-engine mooncake-transfer-engine-cuda13 mooncake-transfer-engine-efa-cuda13
python3 -m pip install --no-deps "$cache/"*.whl
flock -u 9

# Dynamo's source install pulls aiconfigurator-core, a placeholder sdist that
# downloads its real wheel from pypi.nvidia.com at install time and fails
# intermittently on these nodes. Install the same wheel first, verified against
# its published SHA256, so the Dynamo install finds the requirement satisfied.
aic_wheel=aiconfigurator_core-0.11.0.dev20260728-cp310-abi3-manylinux_2_28_x86_64.whl
aic_sha256=cfd724c6cce142ffc3df150785614245b8a9e0fb70cacb071b4ab58f01bd19c7
aic_dir="$KIMI_EFA_BUILD_CACHE/wheels"
mkdir -p "$aic_dir"
for attempt in 1 2 3 4 5; do
if printf '%s %s\n' "$aic_sha256" "$aic_dir/$aic_wheel" | sha256sum -c --status - 2>/dev/null; then
break
fi
curl -fsSL --retry 3 --retry-all-errors \
"https://pypi.nvidia.com/aiconfigurator-core/$aic_wheel" -o "$task_dir/$aic_wheel" || true
if printf '%s %s\n' "$aic_sha256" "$task_dir/$aic_wheel" | sha256sum -c --status -; then
mv -f "$task_dir/$aic_wheel" "$aic_dir/$aic_wheel.tmp.$$"
mv -f "$aic_dir/$aic_wheel.tmp.$$" "$aic_dir/$aic_wheel"
else
echo "aiconfigurator-core wheel failed SHA256 check (attempt $attempt)" >&2
Comment on lines +121 to +126

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Every B300 Kimi K3 job now runs native code from a cache that other cluster users may be able to swap out. Nothing checks that code before it runs. Lines 100-105 untar $cache/libfabric.tar.gz into / and pip-install $cache/*.whl whenever ready exists. This PR also adds the hf-hub-cache agentic mount on b300-dsxe, so each launch chmods that cache root to 0o777 without a sticky bit. Fix: verify the cached tarball and wheel before using them, as the aiconfigurator wheel already is (for example, pinned SHA256s or a manifest written by the build), or keep the cache outside the world-writable mount.

Why this was flagged

The condition is that another account on the cluster can traverse the runner's home. runners.yaml:579-580 adds agentic-volume-mounts: hf-hub-cache: /hf_hub_cache for b300-dsxe. _lane_volumes (infx/launch/drivers/srt/config.py:216) marks agentic mounts world-writable, and lane_mounts calls _create_dir, which runs path.chmod(0o777) on the expanded ~/.cache/huggingface/hub at every agentic multinode launch. Without a sticky bit, another user can rename inferencex/ in that directory and plant inferencex/kimi-k3-efa/c3fa13ec-e83bf01a-collapse-hs-lb-v1/ with a ready marker. The setup script then skips the build at line 66, extracts the planted tarball into / as container root (line 121) and pip-installs the planted wheel (line 126). On the base branch, b300-dsxe made no world-writable agentic mount and no job installed binaries from a shared cache. The aiconfigurator wheel in the same script is SHA256-checked (lines 137-151); the libfabric tarball and the Mooncake wheel are not.

Verification: It triggers when another account on the b300-dsxe cluster can traverse the runner's home down to ~/.cache/huggingface/hub. lane_mounts (config.py:229) then calls _create_dir(host, world_writable=True), which runs path.chmod(0o777) (config.py:202) with no sticky bit. Nothing verifies the tarball or the wheel.

sleep $((attempt * 10))
fi
done
printf '%s %s\n' "$aic_sha256" "$aic_dir/$aic_wheel" | sha256sum -c -
python3 -m pip install --no-deps "$aic_dir/$aic_wheel"
Comment on lines +112 to +131

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 (optional) Aggregate B300 Kimi K3 jobs can now fail at setup because of an aiconfigurator-core download they never use. That recipe sets dynamo: install: false. The download-and-verify loop at lines 101-116 runs unconditionally, and after five failed attempts line 115 exits the script under set -eo pipefail. Fix: run this block only for jobs that install Dynamo from source, using an input the recipe passes in. For example, the disagg recipe could export a flag that the script checks with check_env_vars, so the agg recipe and the mooncake-master preamble skip it.

Why this was flagged

agg-megakernel-variants.yaml sets dynamo: install: false and setup_script: kimik3-b300-efa-setup.sh. Every agg worker therefore runs the whole script, including the aiconfigurator-core block at lines 93-116. The script's own comment (lines 93-96) says this block only exists so Dynamo's source install finds the requirement already satisfied. Agg jobs have no Dynamo source install. When pypi.nvidia.com is down or serves a bad file for all five attempts, line 115 sha256sum -c - fails and set -eo pipefail stops the script, so the agg serving container never starts. The PR description reports exactly this: two 2P3D workers got a wheel that failed its SHA256 check. The mooncake-master service preamble (disagg-variants.yaml:46) also runs it without needing it. On the base branch these jobs do not exist, but the new agg points pick up a failure mode that has nothing to do with what they run.

Verification: nit. Trigger: an agg job runs while the shared wheel cache has no valid aiconfigurator-core wheel, and pypi.nvidia.com fails on all five attempts. agg-megakernel-variants.yaml:9-10 sets dynamo: install: false. In kimik3-b300-efa-setup.sh, line 115 fails under set -eo pipefail and the agg job fails setup. Line 102 checks the shared cache first. These agg configs are new in this PR.


/opt/amazon/efa/bin/fi_info --version
/opt/amazon/efa/bin/fi_info -p efa -t FI_EP_RDM
python3 - <<'PY'
import ctypes
import importlib.metadata
from mooncake.store import MooncakeDistributedStore

fabric = ctypes.CDLL("libfabric.so.1")
fabric.fi_version.restype = ctypes.c_uint32
assert fabric.fi_version() == (2 << 16 | 6)
assert importlib.metadata.version("mooncake-transfer-engine-efa-cuda13") == "0.3.13.post1+gc3fa13ec.collapse1.hs1.lb1"
print("EFA libfabric 2.6 and THP-enabled Mooncake Store are available")
PY
Loading
Loading