exo-explore/exo · error · ValueError
Expected BHSD with B=1, got shape={tuple(t.shape)}
Error message
Expected BHSD with B=1, got shape={tuple(t.shape)} What it means
Error "Expected BHSD with B=1, got shape={tuple(t.shape)}" thrown in exo-explore/exo.
Source
Thrown at src/exo/worker/engines/mlx/disaggregated/adapter.py:83
raise ValueError(f"Unsupported mlx dtype for wire: {t.dtype}")
def bytes_to_array(data: bytes, shape: tuple[int, ...], dtype: DType) -> mx.array:
match dtype:
case "bfloat16":
arr = np.frombuffer(data, dtype=np.uint16).reshape(shape).copy()
return mx.array(arr).view(mx.bfloat16)
case "float16":
arr = np.frombuffer(data, dtype=np.float16).reshape(shape).copy()
return mx.array(arr)
case "float32":
arr = np.frombuffer(data, dtype=np.float32).reshape(shape).copy()
return mx.array(arr)
def bhsd_to_nhd(t: mx.array) -> mx.array:
if t.ndim != 4 or int(t.shape[0]) != 1:
raise ValueError(f"Expected BHSD with B=1, got shape={tuple(t.shape)}")
return mx.transpose(t[0], (1, 0, 2))
def nhd_to_bhsd(t: mx.array) -> mx.array:
if t.ndim != 3:
raise ValueError(f"Expected NHD (3D), got shape={tuple(t.shape)}")
return mx.expand_dims(mx.transpose(t, (1, 0, 2)), 0)
def send_mlx_kv_cache(
stream: BinaryIO,
caches: KVCacheType,
*,
dtype: DType,
start_pos: int = 0,
max_tokens: int | None = None,
) -> int:
tokens_sent = 0View on GitHub (pinned to 21a54c5ea0)
When it happens
Trigger: Thrown at src/exo/worker/engines/mlx/disaggregated/adapter.py:83 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of exo-explore/exo@21a54c5ea0 (2026-08-26).
Data as JSON: /api/errors/8cd8c96a6827aadd.
Report an issue: GitHub.