Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
7484e1fc
Unverified
Commit
7484e1fc
authored
Jun 11, 2025
by
Michael Goin
Committed by
GitHub
Jun 11, 2025
Browse files
Add cache to cuda get_device_capability (#19436)
Signed-off-by:
mgoin
<
mgoin64@gmail.com
>
parent
a2142f01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
vllm/platforms/cuda.py
vllm/platforms/cuda.py
+3
-1
No files found.
vllm/platforms/cuda.py
View file @
7484e1fc
...
...
@@ -6,7 +6,7 @@ pynvml. However, it should not initialize cuda context.
import
os
from
datetime
import
timedelta
from
functools
import
wraps
from
functools
import
cache
,
wraps
from
typing
import
TYPE_CHECKING
,
Callable
,
Optional
,
TypeVar
,
Union
import
torch
...
...
@@ -389,6 +389,7 @@ class CudaPlatformBase(Platform):
class
NvmlCudaPlatform
(
CudaPlatformBase
):
@
classmethod
@
cache
@
with_nvml_context
def
get_device_capability
(
cls
,
device_id
:
int
=
0
...
...
@@ -486,6 +487,7 @@ class NvmlCudaPlatform(CudaPlatformBase):
class
NonNvmlCudaPlatform
(
CudaPlatformBase
):
@
classmethod
@
cache
def
get_device_capability
(
cls
,
device_id
:
int
=
0
)
->
DeviceCapability
:
major
,
minor
=
torch
.
cuda
.
get_device_capability
(
device_id
)
return
DeviceCapability
(
major
=
major
,
minor
=
minor
)
...
...
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