Support piecewise cuda graph for MLA (#11812)

This commit is contained in:
Ke Bao
2025-11-10 09:13:48 +08:00
committed by GitHub
parent 885cfca273
commit db24d34603
10 changed files with 196 additions and 89 deletions

View File

@@ -112,6 +112,9 @@ def _infer_dynamic_arg_dims_from_annotations(forward_fn):
for a in getattr(ann, "__args__", [])
):
dyn[name] = 0
elif ann == "torch.Tensor" or ann == "Optional[torch.Tensor]":
# For future import annotations (e.g. from __future__ import annotations), the annotation is a string
dyn[name] = 0
if not dyn:
raise ValueError("No dynamic dims inferred; pass dynamic_arg_dims explicitly.")
return dyn