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
bb73b5a6
Commit
bb73b5a6
authored
Jul 12, 2024
by
zhuwenwen
Browse files
fix bf16 error
parent
deeb9cb8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
16 deletions
+28
-16
examples/offline_inference.py
examples/offline_inference.py
+1
-1
vllm/distributed/device_communicators/custom_all_reduce.py
vllm/distributed/device_communicators/custom_all_reduce.py
+27
-15
No files found.
examples/offline_inference.py
View file @
bb73b5a6
...
...
@@ -12,7 +12,7 @@ if __name__ == '__main__':
sampling_params
=
SamplingParams
(
temperature
=
0.8
,
top_p
=
0.95
)
# Create an LLM.
llm
=
LLM
(
model
=
"facebook/opt-125m"
,
trust_remote_code
=
True
,
dtype
=
"float16"
,
enforce_eager
=
Tru
e
)
llm
=
LLM
(
model
=
"facebook/opt-125m"
,
trust_remote_code
=
True
,
dtype
=
"float16"
,
enforce_eager
=
Fals
e
)
# Generate texts from the prompts. The output is a list of RequestOutput objects
# that contain the prompt, generated text, and other information.
outputs
=
llm
.
generate
(
prompts
,
sampling_params
)
...
...
vllm/distributed/device_communicators/custom_all_reduce.py
View file @
bb73b5a6
...
...
@@ -12,8 +12,10 @@ from vllm.distributed.device_communicators.custom_all_reduce_utils import (
from
vllm.distributed.parallel_state
import
(
get_local_rank
,
get_tensor_model_parallel_cpu_group
,
is_in_the_same_node
)
from
vllm.logger
import
init_logger
from
vllm.utils
import
is_hip
try
:
if
(
not
is_hip
()):
import
pynvml
# Simulate ImportError if custom_ar ops are not supported.
...
...
@@ -29,6 +31,16 @@ try:
yield
finally
:
pynvml
.
nvmlShutdown
()
else
:
custom_ar
=
False
pynvml
=
None
@
contextmanager
def
_nvml
():
try
:
yield
finally
:
pass
except
ImportError
:
# For AMD GPUs
...
...
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