训练minimax- h3的nf4模型的lora,使用adapter训练时融合lora会报错
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- machine-learning
Research direction
Start with examples/minimax_h3/model_training/train.py, then trace switch_pipe_to_training_mode in diffsynth/diffusion/training_module.py through load_lora in diffsynth/diffusion/base_pipeline.py. Inspect diffsynth/utils/lora/general.py around line 67 and compare the base and LoRA tensor shapes for the NF4 adapter. Done means the MiniMax H3 NF4 training example can fuse the adapter without the reported size-mismatch error.
Written by the indexing model from the issue text.
Description
[rank0]: Traceback (most recent call last):
[rank0]: File "/data4/hjhuang/code/DiffSynth-Studio-2.1.4/examples/minimax_h3/model_training/train.py", line 190, in
[rank0]: model = MiniMaxH3TrainingModule(
[rank0]: File "/data4/hjhuang/code/DiffSynth-Studio-2.1.4/examples/minimax_h3/model_training/train.py", line 50, in init
[rank0]: self.switch_pipe_to_training_mode(
[rank0]: File "/data4/hjhuang/code/DiffSynth-Studio-2.1.4/diffsynth/diffusion/training_module.py", line 322, in switch_pipe_to_training_mode
[rank0]: pipe.load_lora(getattr(pipe, preset_lora_model), preset_lora_path)
[rank0]: File "/data4/hjhuang/code/DiffSynth-Studio-2.1.4/diffsynth/diffusion/base_pipeline.py", line 280, in load_lora
[rank0]: lora_loader.fuse_lora_to_base_model(module, lora, alpha=alpha)
[rank0]: File "/data4/hjhuang/code/DiffSynth-Studio-2.1.4/diffsynth/utils/lora/general.py", line 67, in fuse_lora_to_base_model
[rank0]: state_dict_base["weight"] = state_dict_base["weight"].to(device=self.device, dtype=self.torch_dtype) + weight_lora
[rank0]: RuntimeError: The size of tensor a (57802752) must match the size of tensor b (21504) at non-singleton dimension 0
- Dominant language
- Python
- Stars
- 13.2k
- Forks
- 1.3k
- Avg merge
- 22h 15m
- Merged PRs (30d)
- 31
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelscope/DiffSynth-Studio
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelscope/DiffSynth-Studio#1707 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
modelscope/DiffSynth-Studio#1668 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
modelscope/DiffSynth-Studio#1499 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
modelscope/DiffSynth-Studio#1373 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
[Reproducibility] Training script / config for MiniMax-H3-TrainingAdapter (DeCFG adapter) itselfOpen
Difficulty 5/5 Over a week Newbie friendliness 35/100
modelscope/DiffSynth-Studio#1713 · 1 comment ·
Maintainers usually reply within 1 day
All issues in modelscope/DiffSynth-Studio
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
BasedHardware/omi#20271 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
openai/openai-cookbook#3153 ·
Maintainers usually reply within 1 day
-
cvss-severity:high devguard l3montree-cybersecurity/devguard/devguard pkg:golang/github.com/l3montree-dev/devguard risk:low state:open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
l3montree-dev/devguard#3146 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-webui/open-webui#31849 · 2 comments ·
Maintainers usually reply within 1 day