Clean up swa handling in fa3 backend (#15877)
This commit is contained in:
@@ -440,16 +440,6 @@ class ModelRunner(ModelRunnerKVCacheMixin):
|
||||
self.model, self.remote_instance_transfer_engine
|
||||
)
|
||||
|
||||
# Check if the model is using hybrid SWA
|
||||
if (
|
||||
not self.server_args.disable_hybrid_swa_memory
|
||||
and self.sliding_window_size is not None
|
||||
and self.sliding_window_size > 0
|
||||
):
|
||||
architectures = self.model_config.hf_config.architectures
|
||||
if architectures and not any("Llama4" in arch for arch in architectures):
|
||||
self.is_hybrid_swa = self.model_config.is_hybrid_swa = True
|
||||
|
||||
# For MTP models like DeepSeek-V3 or GLM-4.5, the MTP layer(s) are used separately as draft
|
||||
# models for speculative decoding. In those cases, `num_nextn_predict_layers` is used to
|
||||
# determine the number of layers.
|
||||
@@ -941,6 +931,12 @@ class ModelRunner(ModelRunnerKVCacheMixin):
|
||||
self.sliding_window_size = None
|
||||
if hasattr(self.model, "get_attention_sliding_window_size"):
|
||||
self.sliding_window_size = self.model.get_attention_sliding_window_size()
|
||||
elif (
|
||||
self.model_config.is_hybrid_swa
|
||||
and self.model_config.sliding_window_size is not None
|
||||
):
|
||||
# sliding window field in model config may have different meaning for different kinds of models (e.g., dllm), here we only consider the sliding window in SWA model
|
||||
self.sliding_window_size = self.model_config.sliding_window_size
|
||||
elif self.model_config.attention_chunk_size is not None:
|
||||
self.sliding_window_size = self.model_config.attention_chunk_size
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user