Group offloading (block_level): non-block modules are copied to the device and back on every forward
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 18/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- ai-infra-agents
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 35k
- Fork
- 7.5k
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 58
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của huggingface/diffusers
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
huggingface/diffusers#15436 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
InpaintProcessor crashes when padding_mask_crop is set and a dimension is omittedCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
huggingface/diffusers#15433 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LTXEulerAncestralRFScheduler skips signal scaling with s_noise=0Có thể đã có người làm @hparik11 đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
huggingface/diffusers#15423 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Docs: 13 docstrings document parameters their functions don't haveCó thể đã có người làm @M-Colley đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
huggingface/diffusers#15363 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`ZImageImg2ImgPipeline` / `ZImageInpaintPipeline`: explicit height/width different from the input image raises RuntimeErrorCó thể đã có người làm @chessing234 đã nhận 11 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
huggingface/diffusers#15337 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của huggingface/diffusers
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 79/100
developmentseed/titiler-covjson#164 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
awslabs/visual-asset-management-system#2164 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
MakazhanAlpamys/Soup#3589 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocketĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày