Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions docs/operations/install-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ flag, the profile's value applies.
| `--save-cpu` | vLLM's shared-memory reader window (container variable `SPARKRING_SHM_BUSY_LOOP_S`) | a switch: readers poll 2 ms after a read instead of one second |
| `--row-owned-prefill` | Eager prefill with replicated Engram projection and decode-only CUDA graphs | experimental [DeepSeek V4.1-Flash-1017 on a four-Spark SIRCL path](../../integrations/vllm/ds41_row_shard/README.md#install-on-a-four-spark-sircl-path), via `sparkring install` |
| `--chain-all-gather` | Direct-link all-gather on a SIRCL chain | with `--row-owned-prefill` and no matching TP tuning table |
| `--expert-parallel` | Expert parallelism at the tensor width: `--enable-expert-parallel` with `--all2all-backend allgather_reducescatter`, vLLM's own weight loader, and the container variable `SIRCL_B12X_EP_MOE=1`. With `--row-owned-prefill` it also sets the libsircl link geometry measured on that deployment (1 MiB slot and pieces, 64 KiB one-shot ceiling) | experimental DeepSeek V4.1-Flash-1017 on `--transport libsircl`, via `sparkring install`, alone or with `--row-owned-prefill` ([record](../../performance/records/deepseek-v41-flash/row-owned-tp4-ep4-libsircl-20261121.md)) |
| `--reasoning-effort LEVEL` | the model's default effort level, in `--default-chat-template-kwargs` on Node A | one of the model's [levels](#thinking) |
| `--thinking off` | the model's default thinking, in `--default-chat-template-kwargs` on Node A | thinking stays off unless a request turns it on |
| `--api-port N` | `--port` | the TCP port of the model's API, 1024 to 65535 ([API endpoint](#api-endpoint)) |
Expand Down
31 changes: 24 additions & 7 deletions integrations/vllm/ds41_row_shard/ds41_row_shard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,30 @@ def patch_attention(module) -> None:
)


def _ep_moe_deferral_allowed() -> bool:
return os.environ.get("SIRCL_B12X_EP_MOE", "").strip().lower() in (
"1",
"true",
"on",
"yes",
)


# -- MoE deferral at TP8 -----------------------------------------------------
def _validate_moe_deferral(runner: Any) -> None:
"""GLM's ``validate_moe_deferral`` with TP8 admitted beside TP2 and TP4."""
"""GLM's ``validate_moe_deferral`` with TP8 and TP+EP (no all2all) admitted."""
config = runner.moe_config
parallel = config.moe_parallel_config
tp_only_ok = config.tp_size in SUPPORTED_WORLDS and config.ep_size == 1
tp_ep_ok = (
_ep_moe_deferral_allowed()
and config.ep_size in SUPPORTED_WORLDS
and config.tp_size * config.ep_size in SUPPORTED_WORLDS
and not parallel.use_all2all_kernels
)
if (
config.tp_size not in SUPPORTED_WORLDS
not (tp_only_ok or tp_ep_ok)
or config.dp_size != 1
or config.ep_size != 1
or config.pcp_size != 1
or config.is_sequence_parallel
or config.skip_final_all_reduce
Expand Down Expand Up @@ -284,13 +299,14 @@ def _static_error(model, world: int) -> str | None:
if (
get_pp_group().world_size != 1
or parallel.data_parallel_size != 1
or parallel.enable_expert_parallel
or (parallel.enable_expert_parallel and not _ep_moe_deferral_allowed())
or getattr(parallel, "enable_eplb", False)
or model.use_sequence_parallel
or model.use_mega_moe
):
raise RowShardRefused(
"row ownership requires PP1, DP1, no expert parallelism, "
"row ownership requires PP1, DP1, no expert parallelism "
"(unless SIRCL_B12X_EP_MOE=1 without all2all), "
"no sequence parallelism and no mega-MoE"
)
layers = owned_layers(
Expand All @@ -317,8 +333,9 @@ def _static_error(model, world: int) -> str | None:
if ffn.use_mega_moe:
raise RowShardRefused(f"layer {index} uses mega-MoE")
_validate_moe_deferral(ffn.experts)
if ffn.experts.moe_config.tp_size != world:
raise RowShardRefused(f"layer {index} MoE TP size differs")
moe_cfg = ffn.experts.moe_config
if moe_cfg.tp_size * moe_cfg.ep_size != world:
raise RowShardRefused(f"layer {index} MoE TP*EP size differs")
engram = getattr(layer, "engram", None)
if engram is not None:
kind = type(engram.wkv).__name__
Expand Down
Loading
Loading