openpi icon indicating copy to clipboard operation
openpi copied to clipboard

PI05 lora fine-tune on libero dataset & differences about the norm_stats

Open xuych0826 opened this issue 1 year ago • 3 comments

I tried to reproduce the result on libero benchmark via the lora finetune method for Pi05base model. However after the finetuning process, the success rate is very low (1% on spatial task suite). Here is my config code. Could anyone point out if it is right?

 
TrainConfig(
      name="pi05_libero_low_mem_finetune",
      model=pi0_config.Pi0Config(pi05=True, action_horizon=10, discrete_state_input=False, 
                                 paligemma_variant="gemma_2b_lora", action_expert_variant="gemma_300m_lora"),
      data=LeRobotLiberoDataConfig(
          repo_id="physical-intelligence/libero",
          base_config=DataConfig(prompt_from_task=True),
          extra_delta_transform=False,
      ),
      batch_size=64,
      lr_schedule=_optimizer.CosineDecaySchedule(
          warmup_steps=5_000,
          peak_lr=5e-5/4,
          decay_steps=120_000,
          decay_lr=5e-5/4,
      ),
      optimizer=_optimizer.AdamW(clip_gradient_norm=1.0),
      ema_decay=None,
      weight_loader=weight_loaders.CheckpointWeightLoader("/home/openpi/assets/checkpoints/pi05_base/params"),
      # pytorch_weight_path="/path/to/your/pytorch_weight_path",
      num_train_steps=120_000,
      freeze_filter=pi0_config.Pi0Config(pi05=True, action_horizon=10, discrete_state_input=False, 
                                         paligemma_variant="gemma_2b_lora", action_expert_variant="gemma_300m_lora").get_freeze_filter(),
  ),

And I also found that the norm stats calculated using compute_norm_stats.py is very different from the original dataset, either the provided checkpoint pi05_libero. I don't understand why, since they use the same dataset.

  • this is the part of the norm stats calculated using compute_norm_stats.py:
Image
  • This is the norm stats of provided checkpoint pi05_base model (which I tested, achieved success rate over 96% on libero benchmark)
Image
  • And this is the original norm stats offered by the official hugging face dataset physical-intelligence/libero:
Image

xuych0826 avatar Oct 08 '25 05:10 xuych0826

I tried to reproduce the result on libero benchmark via the lora finetune method for Pi05base model. However after the finetuning process, the success rate is very low (1% on spatial task suite). Here is my config code. Could anyone point out if it is right?

TrainConfig( name="pi05_libero_low_mem_finetune", model=pi0_config.Pi0Config(pi05=True, action_horizon=10, discrete_state_input=False, paligemma_variant="gemma_2b_lora", action_expert_variant="gemma_300m_lora"), data=LeRobotLiberoDataConfig( repo_id="physical-intelligence/libero", base_config=DataConfig(prompt_from_task=True), extra_delta_transform=False, ), batch_size=64, lr_schedule=_optimizer.CosineDecaySchedule( warmup_steps=5_000, peak_lr=5e-5/4, decay_steps=120_000, decay_lr=5e-5/4, ), optimizer=_optimizer.AdamW(clip_gradient_norm=1.0), ema_decay=None, weight_loader=weight_loaders.CheckpointWeightLoader("/home/openpi/assets/checkpoints/pi05_base/params"), # pytorch_weight_path="/path/to/your/pytorch_weight_path", num_train_steps=120_000, freeze_filter=pi0_config.Pi0Config(pi05=True, action_horizon=10, discrete_state_input=False, paligemma_variant="gemma_2b_lora", action_expert_variant="gemma_300m_lora").get_freeze_filter(), ), And I also found that the norm stats calculated using compute_norm_stats.py is very different from the original dataset, either the provided checkpoint pi05_libero. I don't understand why, since they use the same dataset.

  • this is the part of the norm stats calculated using compute_norm_stats.py:
Image * This is the norm stats of provided checkpoint _pi05_base_ model (which I tested, achieved success rate over 96% on libero benchmark) Image * And this is the original norm stats offered by the official hugging face dataset _physical-intelligence/libero_: Image

This config works for me

    TrainConfig(
        name="pi05_libero_lora_v1",

        model=pi0_config.Pi0Config(pi05=True, action_horizon=10, discrete_state_input=False,
                                   paligemma_variant="gemma_2b_lora", action_expert_variant="gemma_300m_lora"),

        data=LeRobotLiberoDataConfig(
            repo_id="physical-intelligence/libero",
            base_config=DataConfig(prompt_from_task=True),
            extra_delta_transform=False,
        ),
        weight_loader=weight_loaders.CheckpointWeightLoader("gs://openpi-assets/checkpoints/pi05_base/params"),
        num_train_steps=30_000,
        # Again, make sure to match the model config above when extracting the freeze filter
        # that specifies which parameters should be frozen during LoRA finetuning.
        freeze_filter=
        pi0_config.Pi0Config(pi05=True, action_horizon=10,
                             discrete_state_input=False,
                             paligemma_variant="gemma_2b_lora",
                             action_expert_variant="gemma_300m_lora"
                             ).get_freeze_filter(),
        # Turn off EMA for LoRA finetuning.
        ema_decay=None,
        wandb_enabled=True,
        # batch_size=32, #use fault 32
        optimizer=_optimizer.AdamW(clip_gradient_norm=1.0),
        lr_schedule=_optimizer.CosineDecaySchedule(
            warmup_steps=10_000,
            peak_lr=5e-5,
            decay_steps=1_000_000,
            decay_lr=5e-5,
        ),
    ),

ZhixuLi-the-Runner avatar Dec 24 '25 21:12 ZhixuLi-the-Runner

Could you guys get satisfiable performance using peft (lora) on pi05_base and libero? LORA only finetunes part of the action head by default. I am not getting good performance.

OliEfr avatar Mar 30 '26 21:03 OliEfr

One check worth adding here: print which norm-stats file the eval config actually loads, at startup. A stats file computed on a different split than the fine-tune fails quietly and only shows up as lower success, so it is easy to chase the wrong thing.

sattyamjjain avatar Sep 28 '26 17:09 sattyamjjain