[compile] raise on compile_size implicit padding (#32343)

Signed-off-by: dolpm <34420038+dolpm@users.noreply.github.com>
This commit is contained in:
dolpm
2026-01-14 20:46:56 +00:00
committed by GitHub
parent 66652e8082
commit 8471b27df9
2 changed files with 79 additions and 0 deletions
+14
View File
@@ -909,6 +909,20 @@ class CompilationConfig:
# May get recomputed in the model runner if adjustment is needed for spec-decode
self.compute_bs_to_padded_graph_size()
# Validate that compile_sizes won't be changed by padding.
# Only validate when cudagraphs are actually being used.
if self.compile_sizes and self.cudagraph_mode != CUDAGraphMode.NONE:
for size in self.compile_sizes:
if size <= self.max_cudagraph_capture_size:
padded = self.bs_to_padded_graph_size[size]
if padded != size:
raise ValueError(
f"compile_sizes contains {size} which would be "
f"padded to {padded}. All compile_sizes must be "
"values that won't be changed by cudagraph padding. "
"Use values from cudagraph_capture_sizes."
)
def set_splitting_ops_for_v1(
self, all2all_backend: str, data_parallel_size: int = 1
):