Skip to content

DOC: document missing parameters in load_accelerator_state, find_executable_batch_size, and send_to_device#4051

Open
kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:fix/document-missing-params
Open

DOC: document missing parameters in load_accelerator_state, find_executable_batch_size, and send_to_device#4051
kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:fix/document-missing-params

Conversation

@kratos0718
Copy link
Copy Markdown

What this fixes

Three public API functions had parameters present in their signatures but missing from their docstrings.

load_accelerator_state() — missing dataloaders

dataloaders is a required parameter (no default value) but was completely absent from the Args section, unlike the equivalent save_accelerator_state() which documents it correctly.

find_executable_batch_size() — missing reduce_batch_size_fn

Allows users to provide a custom batch size reduction strategy instead of the default multiply-by-0.9 behavior on OOM. Undocumented means users can't discover or use this customization point.

send_to_device() — missing non_blocking and skip_keys

  • non_blocking: enables async GPU transfers, useful for overlapping data movement with computation
  • skip_keys: excludes specific dict keys from device transfer

Files changed

  • src/accelerate/checkpointing.py
  • src/accelerate/utils/memory.py
  • src/accelerate/utils/operations.py

…utable_batch_size, and send_to_device

Three public API functions were missing parameters from their docstrings:

- load_accelerator_state(): dataloaders was a required parameter with no
  documentation despite being present in the function signature.

- find_executable_batch_size(): reduce_batch_size_fn was undocumented.
  It allows users to provide a custom batch size reduction strategy
  instead of the default multiply-by-0.9 behavior.

- send_to_device(): non_blocking and skip_keys were both undocumented.
  non_blocking enables async GPU transfers; skip_keys lets callers
  exclude specific dict keys from device transfer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant