Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

训练minimax- h3的nf4模型的lora,使用adapter训练时融合lora会报错

Open
#1,642 1 comment 0 reactions 0 assignees View on GitHub

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

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelscope/DiffSynth-Studio

All issues in modelscope/DiffSynth-Studio

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.