Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Locate the MTP drafter-drop fallback by its shape, not one spelling (#13922)

Daniel Hanbd063767f4da
diff --git a/studio/backend/tests/test_tensor_parallel.py b/studio/backend/tests/test_tensor_parallel.py
index e0a7e61c0b2..20bfea1e2e6 100644
--- a/studio/backend/tests/test_tensor_parallel.py
+++ b/studio/backend/tests/test_tensor_parallel.py
@@ -19,6 +19,7 @@ from __future__ import annotations
import asyncio
import inspect
+import re
import socket
import sys
import threading
@@ -329,10 +330,16 @@ def test_mtp_decode_probe_wired_under_tensor_parallel():
# shared drafter-drop fallback fires.
after = src[probe : probe + 900]
assert "_with_flash_attn_off" in after and "healthy = False" in after
- fallback = src.find(
- "and (_spec_requested_mtp or _spec_requested_dspark or _spec_requested_dflash)"
+ # The drafter-drop fallback is `if not healthy and (<any drafter requested>) ...`. Matched on
+ # its shape, not its exact spelling: #13806 added eagle3 to that list and wrapped it over
+ # several lines, and a one-line literal then found nothing.
+ match = re.search(
+ r"not healthy\s+and\s*\(\s*_spec_requested_mtp\s+or\s+_spec_requested_dspark\b"
+ r"[^)]*?_spec_requested_dflash\b",
+ src,
)
- assert 0 <= probe < fallback, "the probe must precede the drafter-drop fallback"
+ assert match is not None, "load_model no longer has a drafter-drop fallback for MTP"
+ assert probe < match.start(), "the probe must precede the drafter-drop fallback"
def test_probe_mtp_decode_returns_false_on_crash(monkeypatch):