Skip to content

Commit 53eec81

Browse files
Edenzzzzxwu-intel
authored andcommitted
misc: cache is_hopper_arch (sgl-project#6799)
1 parent c6d2e02 commit 53eec81

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sgl-kernel/python/sgl_kernel/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414
# ==============================================================================
1515

16+
import functools
1617
from typing import Dict, Tuple
1718

1819
import torch
@@ -41,6 +42,7 @@ def _to_tensor_scalar_tuple(x):
4142
return (None, x)
4243

4344

45+
@functools.lru_cache(maxsize=1)
4446
def is_hopper_arch() -> bool:
4547
# Hopper arch's compute capability == 9.0
4648
device = torch.cuda.current_device()

0 commit comments

Comments
 (0)