diff --git a/python/sglang/srt/two_batch_overlap.py b/python/sglang/srt/two_batch_overlap.py index 601d3918371..a2f3936a431 100644 --- a/python/sglang/srt/two_batch_overlap.py +++ b/python/sglang/srt/two_batch_overlap.py @@ -346,7 +346,10 @@ def filter_batch( ) # TODO improve, e.g. unify w/ `init_raw` - if global_server_args_dict["moe_dense_tp_size"] == 1: + if ( + global_server_args_dict["moe_dense_tp_size"] == 1 + and batch.gathered_buffer is not None + ): sum_len = end_token_index - start_token_index gathered_buffer = torch.zeros( (sum_len, batch.gathered_buffer.shape[1]),