Add get_parallel(): a structured accessor for parallel-topology state (#28567)
This commit is contained in:
@@ -5,11 +5,10 @@ from types import SimpleNamespace
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
from sglang.srt.layers import dp_attention as _dp_attn
|
||||
from sglang.srt.runtime_context import get_parallel
|
||||
|
||||
# Patch DP-attention globals before importing backends
|
||||
# TODO: change the interface of both trtllm_mla and flashinfer backends to take tp_size as an argument instead of patching
|
||||
_dp_attn.get_attention_tp_size = lambda: 1 # TP size = 1 for unit test
|
||||
_parallel_override = get_parallel().override(attn_tp_size=1)
|
||||
_parallel_override.__enter__()
|
||||
|
||||
from sglang.srt.configs.model_config import AttentionArch
|
||||
from sglang.srt.layers.attention.flashinfer_mla_backend import FlashInferMLAAttnBackend
|
||||
|
||||
Reference in New Issue
Block a user