Skip to content

Commit

Permalink
Update weight_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkuligowski committed Jan 30, 2025
1 parent 8abc1a0 commit 09e4e60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vllm/model_executor/model_loader/weight_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,13 @@ def initialize_dummy_weights(
# XLA device does not support torch.Generator()
param.uniform_(low, high)
continue

if current_platform.is_hpu():
import habana_frameworks.torch.hpu.random as htrandom
generator = htrandom.default_generators[0]
else:
generator = torch.Generator(device=param.data.device)

generator.manual_seed(seed)
if torch.finfo(param.data.dtype).bits < 16:
# uniform_ doesn't support < 16-bit datatypes (FP8)
Expand Down

0 comments on commit 09e4e60

Please sign in to comment.