Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion python/sglang/srt/layers/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,4 +380,14 @@ def get_cross_encoder_activation_function(config: PretrainedConfig):
logger.info(
"sgl-kernel is not available on Non-NV, Non-AMD platforms or Non-AMX CPUs. Fallback to other kernel libraries."
)
from vllm.model_executor.layers.activation import GeluAndMul, SiluAndMul
try:
from vllm.model_executor.layers.activation import GeluAndMul, SiluAndMul
except ImportError:

class GeluAndMul:
def __init__(self, *args, **kwargs):
pass

class SiluAndMul:
def __init__(self, *args, **kwargs):
pass
3 changes: 2 additions & 1 deletion python/sglang/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import urllib.request
import weakref
from concurrent.futures import ThreadPoolExecutor
from functools import wraps
from functools import lru_cache, wraps
from io import BytesIO
from json import dumps
from typing import Any, Callable, List, Optional, Tuple, Type, Union
Expand Down Expand Up @@ -542,6 +542,7 @@ async def async_stream_and_merge(llm, prompt, sampling_params):
yield cleaned_chunk # yield the non-overlapping portion


@lru_cache(maxsize=128)
def resolve_obj_by_qualname(qualname: str) -> Any:
"""
Resolve an object by its fully qualified name.
Expand Down