Group offloading (block_level): non-block modules are copied to the device and back on every forward
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 18/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Domínio
- ai-infra-agents
Direção de pesquisa
The work sits in the group offloading path of apply_group_offloading and ModelMixin.enable_group_offload, specifically the top-level group that holds non-block modules under block_level. Start by reading how that group is built and how it is moved to and from the device on each forward. Done means the two proposed arguments exist, keep_non_block_modules_resident and num_resident_blocks, with tests showing the non-block modules stay on device and output is unchanged. Note that a prototype is already linked as PR #15394, so check that PR before starting.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Is your feature request related to a problem? Please describe.
With offload_type="block_level", every module, parameter and buffer outside the block groups (embedders, norms, refiners, ...) goes into one top-level group that is copied to the device and back synchronously on every forward pass. The streamed blocks overlap with compute, but this group does not. For MiniMax-H3-Image these modules (token refiner and embedders) total 1.72 GB: about 0.23 s host-to-device plus 0.54 s device-to-host per forward, on one Radeon AI PRO R9600D. Over a request that is ~4 s of a ~32 s total.
Describe the solution you'd like.
Two opt-in arguments for block_level in apply_group_offloading / ModelMixin.enable_group_offload:
keep_non_block_modules_resident: bool = False: place the non-block modules ononload_deviceonce and never offload them.num_resident_blocks: int = 0: keep the first N block groups on the device permanently, for users with spare device memory.
Measured with a prototype on MiniMax-H3-Image 1024x1024 (transformer block_level, use_stream=True): 32.22 -> 28.09 s per request with keep_non_block_modules_resident=True, same peak memory (6.23 GiB), bitwise identical output.
Additional context.
Non-block parameter size of other models (from their configs): HunyuanVideo 0.67 GiB, Wan2.1-14B 0.43 GiB, Qwen-Image 0.075 GiB, so the gain is mainly for large video DiTs. Implemented in #15394.
- Linguagem predominante
- Python
- Estrelas
- 35k
- Forks
- 7.5k
- Merge médio
- 2d 22h
- PRs com merge (30d)
- 58
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de huggingface/diffusers
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
huggingface/diffusers#15436 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omittedTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
huggingface/diffusers#15433 ·
Mantenedores costumam responder em até 1 dia
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0Talvez já em andamento @hparik11 assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
huggingface/diffusers#15423 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Docs: 13 docstrings document parameters their functions don't haveTalvez já em andamento @M-Colley assumiu há 3 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
huggingface/diffusers#15363 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorTalvez já em andamento @chessing234 assumiu há 11 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
huggingface/diffusers#15337 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de huggingface/diffusers
Issues semelhantes
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount dueTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 79/100
developmentseed/titiler-covjson#164 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
awslabs/visual-asset-management-system#2164 ·
Mantenedores costumam responder em até 1 dia
-
needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
MakazhanAlpamys/Soup#3589 ·
Mantenedores costumam responder em até 1 dia
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocketAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
Mantenedores costumam responder em até 1 dia