[Bug] Wan MeanFlow zero initialization causes degenerate gradients in r_embedder

Chiusa Adatta ai principianti
#42 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Inizia da fastgen/configs/experiments/WanT2V/config_mf.py e dal ramo di inizializzazione "zero" in fastgen/networks/Wan/network.py. Esegui la configurazione Wan MeanFlow e ispeziona i gradienti di r_embedder dopo il primo backward pass. Il lavoro è completato quando il percorso r inizialmente produce un output nullo senza lasciare i suoi hidden layer addestrabili con gradienti nulli degenerati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Description

In fastgen/configs/experiments/WanT2V/config_mf.py, the Wan MeanFlow model uses:

config.model.net.r_embedder_init = "zero"

This triggers the following code in fastgen/networks/Wan/network.py:

elif embedder_init == "zero":
    for param in embedder.parameters():
        param.data.zero_()

This sets every parameter of the multi-layer r_embedder to zero. As a result, several weight tensors receive zero gradients because of the zero symmetry (only some bias parameters may update). The r-conditioning pathway therefore remains effectively inactive and is difficult to learn.

Reproduction

Run the Wan MeanFlow configuration and inspect the gradients of model.net.transformer.r_embedder after the first backward pass.

The weights of layers such as time_embedder.linear_1 and time_embedder.linear_2.weight remain zero or receive zero gradients.

Image

Expected behavior

The r pathway should initially produce zero output without initializing all of its trainable layers to zero.

Suggested fix

The existing "random" branch appears to implement the intended behavior: it randomly initializes the hidden layers and zero-initializes only the output projections.

Could the "zero" branch be changed to use this initialization strategy, or could the configuration be changed to:

config.model.net.r_embedder_init = "random"

?

Lingua principale
Python
Stelle
1.1k
Fork
89
Merge medio
10h 58m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVlabs/FastGen

Tutte le issue di NVlabs/FastGen

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.