Skip to content
Open
25 changes: 25 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2621,3 +2621,28 @@ def test_revision_resolved_when_weights_match_model(mock_resolve):
assert isinstance(config.revision, ResolvedRevision)
assert config.revision.resolved == REVISION
mock_resolve.assert_any_call(model, None, config.hf_token)


@pytest.mark.skip_global_cleanup
@patch("vllm.config.model.get_config")
@patch("vllm.config.model.resolve_revision", return_value=ResolvedRevision(REVISION))
def test_microbatching_all2all_backend_validation(mock_resolve, mock_get_config):
from transformers import PretrainedConfig
hf_config = PretrainedConfig(
model_type="qwen3",
num_hidden_layers=1,
architectures=["Qwen3ForCausalLM"],
)
mock_get_config.return_value = hf_config

# Microbatching requires specific all2all backends.
# By default, use_ubatching is True when enable_dbo is True,
# but all2all_backend defaults to allgather_reducescatter.
# This must raise a ValueError.
from vllm.config import DeviceConfig
with pytest.raises(ValueError, match="Microbatching currently only supports"):
VllmConfig(
model_config=ModelConfig("Qwen/Qwen3-0.6B"),
parallel_config=ParallelConfig(enable_dbo=True),
device_config=DeviceConfig(device="cpu"),
)
19 changes: 10 additions & 9 deletions vllm/config/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1740,18 +1740,19 @@ def has_blocked_weights():

if self.parallel_config.use_ubatching:
a2a_backend = self.parallel_config.all2all_backend
assert a2a_backend in [
if a2a_backend not in [
"deepep_low_latency",
"deepep_high_throughput",
"nixl_ep",
], (
"Microbatching currently only supports the deepep_low_latency, "
"deepep_high_throughput, and nixl_ep all2all backends. "
f"{a2a_backend} is not supported. To fix use "
"--all2all-backend=deepep_low_latency, "
"--all2all-backend=deepep_high_throughput, or "
"--all2all-backend=nixl_ep and install the matching kernels."
)
]:
raise ValueError(
"Microbatching currently only supports the deepep_low_latency, "
"deepep_high_throughput, and nixl_ep all2all backends. "
f"{a2a_backend} is not supported. To fix use "
"--all2all-backend=deepep_low_latency, "
"--all2all-backend=deepep_high_throughput, or "
"--all2all-backend=nixl_ep and install the matching kernels."
)

if not self.model_config.disable_cascade_attn:
self.model_config.disable_cascade_attn = True
Expand Down
Loading