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
1b3f4b5b
Commit
1b3f4b5b
authored
May 19, 2025
by
王敏
Browse files
[fix]修复开启并行解码后,打印"Current platform rocm does not have 'Event' attribute"问题
parent
85f3aba3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
vllm/spec_decode/metrics.py
vllm/spec_decode/metrics.py
+8
-6
No files found.
vllm/spec_decode/metrics.py
View file @
1b3f4b5b
...
@@ -86,10 +86,12 @@ class AsyncMetricsCollector:
...
@@ -86,10 +86,12 @@ class AsyncMetricsCollector:
if
isinstance
(
device_type
,
torch
.
device
):
if
isinstance
(
device_type
,
torch
.
device
):
torch
.
cuda
.
set_device
(
device_type
)
torch
.
cuda
.
set_device
(
device_type
)
device_type
=
device_type
.
type
device_type
=
device_type
.
type
stream
=
current_platform
.
Stream
# stream = current_platform.Stream
if
stream
is
not
None
:
# if stream is not None:
self
.
_copy_stream
=
stream
()
# self._copy_stream = stream()
if
device_type
==
'cuda'
:
self
.
_copy_stream
=
torch
.
cuda
.
Stream
()
pin_memory
=
is_pin_memory_available
()
pin_memory
=
is_pin_memory_available
()
self
.
_aggregate_num_accepted_tokens
=
torch
.
tensor
(
self
.
_aggregate_num_accepted_tokens
=
torch
.
tensor
(
0
,
dtype
=
torch
.
long
,
device
=
"cpu"
,
pin_memory
=
pin_memory
)
0
,
dtype
=
torch
.
long
,
device
=
"cpu"
,
pin_memory
=
pin_memory
)
...
@@ -99,8 +101,8 @@ class AsyncMetricsCollector:
...
@@ -99,8 +101,8 @@ class AsyncMetricsCollector:
def
maybe_collect_rejsample_metrics
(
def
maybe_collect_rejsample_metrics
(
self
,
k
:
int
)
->
Optional
[
SpecDecodeWorkerMetrics
]:
self
,
k
:
int
)
->
Optional
[
SpecDecodeWorkerMetrics
]:
# Skip for any platform that doesn't have device Event
# Skip for any platform that doesn't have device Event
if
current_platform
.
Event
is
None
:
#
if current_platform.Event is None:
return
None
#
return None
# If a copy was initiated in the previous call, collect and return.
# If a copy was initiated in the previous call, collect and return.
if
self
.
_in_flight_copy
is
not
None
:
if
self
.
_in_flight_copy
is
not
None
:
...
...
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