[sgl] disable piecewise cuda graph when a model doesn't have layers (#21565)

This commit is contained in:
Bi Xue
2026-03-29 23:04:20 +08:00
committed by GitHub
parent aa9177152e
commit 42c46e6334
@@ -2383,6 +2383,14 @@ class ModelRunner(ModelRunnerKVCacheMixin):
# Collect attention layers and moe layers from the model
self.model.model = resolve_language_model(self.model)
language_model = getattr(self.model, "language_model", self.model)
# Some draft models (e.g. eagle3) don't have a standard 'layers' attribute
if not hasattr(language_model.model, "layers"):
logger.warning(
"Disable piecewise CUDA graph because the model does not have a 'layers' attribute"
)
return
self.attention_layers = []
self.moe_layers = []
self.moe_fusions = []