[Auto Sync] Update pynccl_wrapper.py, environ.py, registry.... (20251111) (#13097)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Lianmin Zheng
2025-11-13 15:58:47 -08:00
committed by GitHub
parent e9c0c55833
commit 19f6a33ce9
3 changed files with 15 additions and 3 deletions

View File

@@ -340,10 +340,10 @@ class NCCLLibrary:
self.lib = NCCLLibrary.path_to_library_cache[so_file]
except Exception as e:
logger.error(
"Failed to load NCCL library from %s ."
"It is expected if you are not running on NVIDIA/AMD GPUs."
"Failed to load NCCL library from %s . "
"It is expected if you are not running on NVIDIA/AMD GPUs. "
"Otherwise, the nccl library might not exist, be corrupted "
"or it does not support the current platform %s."
"or it does not support the current platform %s. "
"If you already have the library, please set the "
"environment variable SGLANG_NCCL_SO_PATH"
" to point to the correct nccl library path.",

View File

@@ -75,6 +75,11 @@ class EnvField:
return self.get()
class EnvTuple(EnvField):
def parse(self, value: str) -> tuple[str, ...]:
return tuple(s.strip() for s in value.split(",") if s.strip())
class EnvStr(EnvField):
def parse(self, value: str) -> str:
return value
@@ -125,6 +130,7 @@ class Envs:
# Model & File Download
SGLANG_USE_MODELSCOPE = EnvBool(False)
SGLANG_DISABLED_MODEL_ARCHS = EnvTuple(tuple())
# Logging Options
SGLANG_LOG_GC = EnvBool(False)

View File

@@ -9,6 +9,8 @@ from typing import AbstractSet, Dict, List, Optional, Tuple, Type, Union
import torch.nn as nn
from sglang.srt.environ import envs
logger = logging.getLogger(__name__)
@@ -91,6 +93,10 @@ def import_model_classes(package_name: str):
package = importlib.import_module(package_name)
for _, name, ispkg in pkgutil.iter_modules(package.__path__, package_name + "."):
if not ispkg:
if name.split(".")[-1] in envs.SGLANG_DISABLED_MODEL_ARCHS.get():
logger.debug(f"Skip loading {name} due to SGLANG_DISABLED_MODEL_ARCHS")
continue
try:
module = importlib.import_module(name)
except Exception as e: