EulerDiscreteScheduler returns incorrect v-prediction targets for discrete timesteps
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
調査の方向性
EulerDiscreteScheduler.get_velocityを読み、timestepの検索方法をDDIMScheduler.get_velocityと比較してください。提示された再現手順を実行し、離散timestep 999と500で不一致が生じることを確認してください。同じbetasと入力に対して、両方のschedulerが一致するvelocity targetを返せば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
I found this while reading EulerDiscreteScheduler.get_velocity. It looks up each timestep's position in the descending schedule and uses that position to index alphas_cumprod. At timestep 999 the default schedule reads alphas_cumprod[0]. I plan to fix the lookup to use the discrete training timestep value.
Reproduction
import torch
from diffusers import DDIMScheduler, EulerDiscreteScheduler
config = {
"beta_start": 0.00085,
"beta_end": 0.012,
"beta_schedule": "scaled_linear",
"prediction_type": "v_prediction",
}
sample = torch.tensor([[1.0, -2.0], [0.5, 3.0]])
noise = torch.tensor([[0.25, 0.5], [-0.75, 1.0]])
timesteps = torch.tensor([999.0, 500.0])
actual = EulerDiscreteScheduler(**config).get_velocity(sample, noise, timesteps)
expected = DDIMScheduler(**config).get_velocity(sample, noise, timesteps.long())
print((actual - expected).abs().max().item())
I get 1.4713691473007202. Both schedulers have the same betas, so the velocity targets should agree.
Context
The SDXL T2I-Adapter training script uses this result as its loss target when the scheduler is configured for v_prediction. I reproduced the mismatch at the scheduler call on CPU with synthetic inputs.
System Info
Diffusers 0.44.0.dev0 at 08d5de3, Python 3.14.5, PyTorch 2.15.0+cpu, Linux x86_64. Single process on CPU.
- 主要言語
- Python
- スター
- 35k
- フォーク
- 7.5k
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 58
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
huggingface/diffusers のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
huggingface/diffusers#15463 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
huggingface/diffusers#15460 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/diffusers#15459 ·
メンテナーはふだん 1 日以内に返信
-
GlmImagePipeline: image-to-image fails with `enable_model_cpu_offload()` (device mismatch in `get_image_features`)対応中かも @saeekailas が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
huggingface/diffusers#15449 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
huggingface/diffusers#15436 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
huggingface/diffusers の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
daniel-ospina/tortoise#15014 ·
メンテナーはふだん 1 日以内に返信
-
area:api p2 product:business triage:active type:feat
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
cuadrao-ai/argus#2656 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
good first issue tests
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
yeab7505/tenasig#20 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信