From f81b6e8f51705e58dcc589259277d4f732b53887 Mon Sep 17 00:00:00 2001 From: Lianmin Zheng Date: Mon, 13 Apr 2026 14:42:49 -0700 Subject: [PATCH] [Misc] Add @cache_once to is_arch_support_pdl in jit_kernel (#22724) --- python/sglang/jit_kernel/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/sglang/jit_kernel/utils.py b/python/sglang/jit_kernel/utils.py index ec3ebd5ab..59ced5e57 100644 --- a/python/sglang/jit_kernel/utils.py +++ b/python/sglang/jit_kernel/utils.py @@ -52,7 +52,7 @@ def cache_once(fn: F) -> F: @functools.wraps(fn) def wrapper(*args, **kwargs): - key = (args, tuple(sorted(kwargs.items(), key=lambda x: x[0]))) + key = (args, tuple(sorted(kwargs.items()))) if key not in result_map: result_map[key] = fn(*args, **kwargs) return result_map[key] @@ -305,6 +305,7 @@ def get_jit_cuda_arch() -> ArchInfo: return _CUDA_ARCH +@cache_once def is_arch_support_pdl() -> bool: if is_hip_runtime(): return False