Skip to content

--auto_batch_finding is silently ignored for torchFSDP trainer #426

Description

@Demirrr

Summary

--auto_batch_finding is documented (via its --help text) as "Only available for TP trainer", but in practice it is also wired up for the single-GPU/CPU trainer and the DDP trainer — just not for FSDP. When combined with --trainer torchFSDP, the flag is silently accepted and has no effect: TorchFSDPTrainer never reads self.attributes.auto_batch_finding and just uses --batch_size as given.

Details

  • Flag definition: dicee/config.py:171 (self.auto_batch_finding: bool = False) and dicee/scripts/run.py:153 (--auto_batch_finding, help: "Find a batch size fitting in GPUs. Only available for TP trainer").
  • Implemented in:
    • dicee/trainer/torch_trainer.py:92-109 (single-GPU/CPU)
    • dicee/trainer/torch_trainer_ddp.py:134-149 (DDP)
    • dicee/trainer/model_parallelism.py:77-92 (TP)
  • Not implemented in dicee/trainer/torch_trainer_fsdp.py — no reference to auto_batch_finding anywhere in the file. It reads self.attributes.batch_size directly (line 202) and never attempts auto-sizing.

Impact

Running dicee --trainer torchFSDP --auto_batch_finding ... gives no error or warning; users may assume batch size is being auto-tuned when it is not, and must set --batch_size manually for FSDP runs.

Suggested fix

Either:

  1. Wire auto_batch_finding into TorchFSDPTrainer (analogous to the DDP implementation, respecting rank-0 discovery + broadcast), or
  2. Explicitly warn/raise when --auto_batch_finding is combined with --trainer torchFSDP, and update the --help text/README to reflect actual trainer support instead of only mentioning TP.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions