Skip to content

Commit

Permalink
chore: ran format.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Akash Kaothalkar <[email protected]>
  • Loading branch information
Akashcodes732 committed Dec 19, 2024
1 parent 14241ab commit 616e760
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2144,14 +2144,18 @@ def _get_and_verify_dtype(
torch_dtype = torch.float16
else:
torch_dtype = config_dtype

if (current_platform.is_cpu() and
current_platform.get_cpu_architecture() == interface.CpuArchEnum.POWERPC):
if config_dtype == torch.float16 or config_dtype == torch.float32:
logger.info(
"For POWERPC, we cast models to bfloat16 instead of"
"using float16 by default. Float16 is not currently supported for POWERPC.")
torch_dtype = torch.bfloat16

if (current_platform.is_cpu()
and current_platform.get_cpu_architecture()
== interface.CpuArchEnum.POWERPC
and (config_dtype == torch.float16
or config_dtype == torch.float32)):
logger.info(
"For POWERPC, we cast models to bfloat16 instead of "
"using float16 by default. Float16 is not currently "
"supported for POWERPC.")
torch_dtype = torch.bfloat16

if current_platform.is_hpu() and config_dtype == torch.float16:
logger.info(
"For HPU, we cast models to bfloat16 instead of"
Expand Down

0 comments on commit 616e760

Please sign in to comment.