thu-ml / thu-ml/TurboDiffusion

Question about different patch embedding implementation compared to official Wan-Video

Open
#114 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.7k
Forks
277
Avg merge
2h 57m
Merged PRs (30d)
2

Description

Hello,

Thank you for your great work!

While going through the code, I noticed that the implementation of patch_embedding differs from the official Wan-Video repository.

In WanModel.py from Wan-Video, patch embedding is implemented as:

self.patch_embedding = nn.Conv3d( in_dim, dim, kernel_size=patch_size, stride=patch_size)

However, in TurboDiffusion (wan2pt1.py, it is implemented as:

self.patch_embedding = nn.Linear(in_dim * patch_size[0] * patch_size[1] * patch_size[2], dim)

I would like to understand the design choice behind replacing Conv3d with a Linear layer.

My main questions are:

What is the motivation for using nn.Linear instead of nn.Conv3d here?

If the pretrained Wan-Video model uses a Conv3d patch embedding, how are your patch embedding parameters trained to maintain model performance?

Since distillation only enforces consistency between teacher and student outputs, but does not guarantee that the output of your version will be consistent with that of official version.

I would really appreciate hearing from you.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare WanModel.py from Wan-Video with turbodiffusion/rcm/networks/wan2pt1.py, focusing on the patch_embedding definitions and their parameters. Read the surrounding model and distillation context first; done means providing a supported explanation of the Linear design and how its parameters relate to the pretrained Conv3d implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.