Commit 558d4c61 authored by zhuwenwen's avatar zhuwenwen
Browse files

Merge branch 'v0.11.0-dev-guanyu-qwen2-vl-7b' into 'v0.11.0-dev'

修复qwen2-vl-7b图像处理部分张量创建在cpu上导致报错问题

See merge request dcutoolkit/deeplearing/vllm!408
parents 70506d98 185ccc2d
...@@ -746,7 +746,10 @@ class Qwen2VisionTransformer(nn.Module): ...@@ -746,7 +746,10 @@ class Qwen2VisionTransformer(nn.Module):
rotary_pos_emb = self.rot_pos_emb(grid_thw) rotary_pos_emb = self.rot_pos_emb(grid_thw)
# compute cu_seqlens # compute cu_seqlens
grid_thw_ = torch.tensor(grid_thw) grid_thw_ = torch.tensor(grid_thw,
device=self.device,
dtype=torch.int32
)
cu_seqlens = torch.repeat_interleave(grid_thw_[:, 1] * grid_thw_[:, 2], cu_seqlens = torch.repeat_interleave(grid_thw_[:, 1] * grid_thw_[:, 2],
grid_thw_[:, 0]).cumsum( grid_thw_[:, 0]).cumsum(
dim=0, dtype=torch.int32) dim=0, dtype=torch.int32)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment