Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
c429919d
Unverified
Commit
c429919d
authored
Jun 01, 2025
by
Wenxuan Tan
Committed by
GitHub
Jun 01, 2025
Browse files
misc: cache is_hopper_arch (#6799)
parent
1da8d230
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
sgl-kernel/python/sgl_kernel/utils.py
sgl-kernel/python/sgl_kernel/utils.py
+2
-0
No files found.
sgl-kernel/python/sgl_kernel/utils.py
View file @
c429919d
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# limitations under the License.
# limitations under the License.
# ==============================================================================
# ==============================================================================
import
functools
from
typing
import
Dict
,
Tuple
from
typing
import
Dict
,
Tuple
import
torch
import
torch
...
@@ -41,6 +42,7 @@ def _to_tensor_scalar_tuple(x):
...
@@ -41,6 +42,7 @@ def _to_tensor_scalar_tuple(x):
return
(
None
,
x
)
return
(
None
,
x
)
@
functools
.
lru_cache
(
maxsize
=
1
)
def
is_hopper_arch
()
->
bool
:
def
is_hopper_arch
()
->
bool
:
# Hopper arch's compute capability == 9.0
# Hopper arch's compute capability == 9.0
device
=
torch
.
cuda
.
current_device
()
device
=
torch
.
cuda
.
current_device
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment