Commit 71cb74ff authored by zhuwenwen's avatar zhuwenwen
Browse files

update qwen2_vl and qwen2_5_vl conv layout

parent 4d53d14c
...@@ -436,7 +436,8 @@ class Qwen2_5_VisionPatchEmbed(nn.Module): ...@@ -436,7 +436,8 @@ class Qwen2_5_VisionPatchEmbed(nn.Module):
L, C = x.shape L, C = x.shape
x = x.view(L, -1, self.temporal_patch_size, self.patch_size, x = x.view(L, -1, self.temporal_patch_size, self.patch_size,
self.patch_size) self.patch_size)
x = x.to(memory_format=torch.channels_last_3d) if os.environ.get('PYTORCH_MIOPEN_SUGGEST_NDHWC') == '1':
x = x.to(memory_format=torch.channels_last_3d)
x = self.proj(x).view(L, self.hidden_size) x = self.proj(x).view(L, self.hidden_size)
return x return x
......
...@@ -464,7 +464,8 @@ class Qwen2VisionPatchEmbed(nn.Module): ...@@ -464,7 +464,8 @@ class Qwen2VisionPatchEmbed(nn.Module):
L, C = x.shape L, C = x.shape
x = x.view(L, -1, self.temporal_patch_size, self.patch_size, x = x.view(L, -1, self.temporal_patch_size, self.patch_size,
self.patch_size) self.patch_size)
x = x.to(memory_format=torch.channels_last_3d) if os.environ.get('PYTORCH_MIOPEN_SUGGEST_NDHWC') == '1':
x = x.to(memory_format=torch.channels_last_3d)
x = self.proj(x).view(L, self.embed_dim) x = self.proj(x).view(L, self.embed_dim)
return x return x
......
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