Skip to content

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

Merged
SunMarc merged 1 commit into
huggingface:mainfrom
kratos0718:fix/document-missing-params
Jun 9, 2026
Merged

DOC: document missing parameters in load_accelerator_state, find_executable_batch_size, and send_to_device#4051
SunMarc merged 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.

@SunMarc SunMarc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@SunMarc SunMarc merged commit 6fbd0ae into huggingface:main Jun 9, 2026
18 of 25 checks passed
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

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.

3 participants