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
be0c5180
Unverified
Commit
be0c5180
authored
May 09, 2024
by
Michael Goin
Committed by
GitHub
May 09, 2024
Browse files
[Bugfix] Add logs for all model dtype casting (#4717)
parent
cea64430
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
vllm/config.py
vllm/config.py
+3
-0
No files found.
vllm/config.py
View file @
be0c5180
...
...
@@ -1063,6 +1063,7 @@ def _get_and_verify_dtype(
if
config_dtype
==
torch
.
float32
:
# Following the common practice, we use float16 for float32
# models.
logger
.
info
(
"Casting torch.float32 to torch.float16."
)
torch_dtype
=
torch
.
float16
else
:
torch_dtype
=
config_dtype
...
...
@@ -1087,9 +1088,11 @@ def _get_and_verify_dtype(
if
torch_dtype
!=
config_dtype
:
if
torch_dtype
==
torch
.
float32
:
# Upcasting to float32 is allowed.
logger
.
info
(
"Upcasting %s to %s."
,
config_dtype
,
torch_dtype
)
pass
elif
config_dtype
==
torch
.
float32
:
# Downcasting from float32 to float16 or bfloat16 is allowed.
logger
.
info
(
"Downcasting %s to %s."
,
config_dtype
,
torch_dtype
)
pass
else
:
# Casting between float16 and bfloat16 is allowed with a warning.
...
...
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