[Misc] Improve error messages for unsupported types and parameters (#30593)

Signed-off-by: BlankR <hjyblanche@gmail.com>
Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
This commit is contained in:
BlankR
2026-01-07 09:00:16 +00:00
committed by GitHub
co-authored by Wentao Ye
parent 1f33e38e81
commit 0790f07695
11 changed files with 40 additions and 16 deletions
@@ -92,7 +92,10 @@ class ncclDataTypeEnum:
return cls.ncclFloat64
if dtype == torch.bfloat16:
return cls.ncclBfloat16
raise ValueError(f"Unsupported dtype: {dtype}")
raise ValueError(
f"Unsupported dtype {dtype}: should be one of "
f"int8, uint8, int32, int64, float16, float32, float64, bfloat16."
)
ncclRedOp_t = ctypes.c_int
@@ -233,7 +233,10 @@ class RequestTracker:
elif isinstance(new_block_ids, list):
pass
else:
raise ValueError(f"Unsupported new_block_ids type {type(new_block_ids)}")
raise ValueError(
f"Unsupported new_block_ids type {type(new_block_ids)}: "
f"should be None[list[int], ...], tuple or list[int]."
)
self.allocated_block_ids.extend(new_block_ids)
# When a request is scheduled again, and the number of new tokens