[MiniMax-H3] Block-level group offloading of the Qwen3-VL text encoder fails: the encoder step bypasses its top-level forward
維護者通常 1 天內回覆
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 18/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
研究方向
Start with get_qwen3vl_prompt_embeds in the MiniMax-H3 and Pika-H3-Flex pipeline modules, where text_encoder.model(...) and the manual _hf_hook.pre_forward call bypass the top-level forward. Reproduce with block_level group offloading on the text encoder to see the device mismatch on the token embedding. Done means encoding succeeds under block_level offloading and matches the existing output; the linked pull request #15395 already proposes the change, so this is not open for a fresh attempt.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
get_qwen3vl_prompt_embeds (MiniMax-H3, MiniMax-H3-Image, and its copy in Pika-H3-Flex) calls text_encoder.model(...) and fires accelerate's _hf_hook.pre_forward by hand; the code carries a TODO about it. Hooks that wrap only the top-level forward therefore never fire. With offload_type="block_level" group offloading on the text encoder, the modules outside the decoder blocks (the token embedding) are never onloaded and encoding fails:
RuntimeError: Expected all tensors to be on the same device, but got index is on cuda:0, different from other tensors on cpu
Reproduction
import torch
from diffusers import ModularPipeline
from diffusers.hooks import apply_group_offloading
pipe = ModularPipeline.from_pretrained("<MiniMax-H3-Image diffusers checkpoint>")
pipe.load_components(dtype=torch.bfloat16)
dev = torch.device("cuda")
pipe.transformer.enable_group_offload(dev, offload_device=torch.device("cpu"), offload_type="block_level", num_blocks_per_group=1, use_stream=True)
apply_group_offloading(pipe.text_encoder, dev, offload_device=torch.device("cpu"), offload_type="block_level", num_blocks_per_group=1, use_stream=True)
pipe.vae.to(dev)
pipe(prompt="a garden", height=1024, width=1024, output="images") # fails in the text encoder step
leaf_level on the text encoder works, because it hooks every leaf module.
Context
Offloading is the only way to run MiniMax-H3-Image on one 32 GB GPU: the documented ComponentsManager auto offload moves the ~62 GB text encoder as a whole and does not fit.
System Info
diffusers main (e3f8451), torch 2.14 (ROCm 10.1), Radeon AI PRO R9600D / R9700 (gfx1201).
Fix
#15395 calls text_encoder(...) with logits_to_keep=1 instead, so the top-level hooks fire; hidden_states[50] is bitwise identical to the current call.
- 主要語言
- Python
- 星號
- 35k
- 分支
- 7.5k
- 平均合併
- 2 天 22 小時
- 30 天內合併 PR
- 58
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
huggingface/diffusers 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
huggingface/diffusers#15436 · 1 則留言 ·
維護者通常 1 天內回覆
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omitted可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 82/100
huggingface/diffusers#15433 ·
維護者通常 1 天內回覆
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0可能已有人在做 @hparik11 於 3 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 74/100
huggingface/diffusers#15423 · 2 則留言 ·
維護者通常 1 天內回覆
-
Docs: 13 docstrings document parameters their functions don't have可能已有人在做 @M-Colley 於 3 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
huggingface/diffusers#15363 · 2 則留言 ·
維護者通常 1 天內回覆
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeError可能已有人在做 @chessing234 於 11 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 70/100
huggingface/diffusers#15337 · 3 則留言 ·
維護者通常 1 天內回覆
查看 huggingface/diffusers 的全部 Issue
相似的 Issue
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount due可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 2/5 1-3 小時 新手友好度 79/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 79/100
developmentseed/titiler-covjson#164 ·
維護者通常 1 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 82/100
awslabs/visual-asset-management-system#2164 ·
維護者通常 1 天內回覆
-
needs-triage
難度 2/5 1-3 小時 新手友好度 86/100
MakazhanAlpamys/Soup#3589 ·
維護者通常 1 天內回覆
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocket未關閉
難度 2/5 1-3 小時 新手友好度 86/100
維護者通常 1 天內回覆