[diffusion] hardware: add set_musa_arch on MUSA (misc, 15/N) (#19381)
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
This commit is contained in:
@@ -43,7 +43,7 @@ from sglang.multimodal_gen.runtime.pipelines_core import (
|
|||||||
from sglang.multimodal_gen.runtime.pipelines_core.schedule_batch import OutputBatch
|
from sglang.multimodal_gen.runtime.pipelines_core.schedule_batch import OutputBatch
|
||||||
from sglang.multimodal_gen.runtime.platforms import current_platform
|
from sglang.multimodal_gen.runtime.platforms import current_platform
|
||||||
from sglang.multimodal_gen.runtime.server_args import PortArgs, ServerArgs
|
from sglang.multimodal_gen.runtime.server_args import PortArgs, ServerArgs
|
||||||
from sglang.multimodal_gen.runtime.utils.common import set_cuda_arch
|
from sglang.multimodal_gen.runtime.utils.common import set_cuda_arch, set_musa_arch
|
||||||
from sglang.multimodal_gen.runtime.utils.layerwise_offload import (
|
from sglang.multimodal_gen.runtime.utils.layerwise_offload import (
|
||||||
OffloadableDiTMixin,
|
OffloadableDiTMixin,
|
||||||
iter_materialized_weights,
|
iter_materialized_weights,
|
||||||
@@ -474,6 +474,8 @@ def run_scheduler_process(
|
|||||||
globally_suppress_loggers()
|
globally_suppress_loggers()
|
||||||
if current_platform.is_cuda():
|
if current_platform.is_cuda():
|
||||||
set_cuda_arch()
|
set_cuda_arch()
|
||||||
|
elif current_platform.is_musa():
|
||||||
|
set_musa_arch()
|
||||||
|
|
||||||
port_args = PortArgs.from_server_args(server_args)
|
port_args = PortArgs.from_server_args(server_args)
|
||||||
|
|
||||||
|
|||||||
@@ -261,6 +261,15 @@ def set_cuda_arch():
|
|||||||
os.environ["TORCH_CUDA_ARCH_LIST"] = f"{arch}{'+PTX' if arch == '9.0' else ''}"
|
os.environ["TORCH_CUDA_ARCH_LIST"] = f"{arch}{'+PTX' if arch == '9.0' else ''}"
|
||||||
|
|
||||||
|
|
||||||
|
# musa
|
||||||
|
|
||||||
|
|
||||||
|
def set_musa_arch():
|
||||||
|
capability = torch.cuda.get_device_capability()
|
||||||
|
arch = f"{capability[0]}{capability[1]}"
|
||||||
|
os.environ["TORCH_MUSA_ARCH_LIST"] = f"{arch}"
|
||||||
|
|
||||||
|
|
||||||
# env var managements
|
# env var managements
|
||||||
|
|
||||||
_warned_bool_env_var_keys = set()
|
_warned_bool_env_var_keys = set()
|
||||||
|
|||||||
Reference in New Issue
Block a user