[Bugfix] Place empty Qwen encoder-DP embeddings on the communication device (#31663)
This commit is contained in:
@@ -707,7 +707,7 @@ def run_dp_sharded_mrope_vision_model(
|
|||||||
out_dim = getattr(vision_model.config, "hidden_size", None)
|
out_dim = getattr(vision_model.config, "hidden_size", None)
|
||||||
image_embeds_local = torch.empty(
|
image_embeds_local = torch.empty(
|
||||||
(0, embed_dim_reduction_factor, out_dim),
|
(0, embed_dim_reduction_factor, out_dim),
|
||||||
device=input_device,
|
device=vision_model.device,
|
||||||
dtype=input_dtype,
|
dtype=input_dtype,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
@@ -725,7 +725,7 @@ def run_dp_sharded_mrope_vision_model(
|
|||||||
out_dim = vision_model.config.hidden_size
|
out_dim = vision_model.config.hidden_size
|
||||||
image_embeds_local = torch.empty(
|
image_embeds_local = torch.empty(
|
||||||
(0, out_dim),
|
(0, out_dim),
|
||||||
device=input_device,
|
device=vision_model.device,
|
||||||
dtype=input_dtype,
|
dtype=input_dtype,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user