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
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Three public API functions had parameters present in their signatures but missing from their docstrings.
load_accelerator_state()— missingdataloadersdataloadersis a required parameter (no default value) but was completely absent from theArgssection, unlike the equivalentsave_accelerator_state()which documents it correctly.find_executable_batch_size()— missingreduce_batch_size_fnAllows 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()— missingnon_blockingandskip_keysnon_blocking: enables async GPU transfers, useful for overlapping data movement with computationskip_keys: excludes specific dict keys from device transferFiles changed
src/accelerate/checkpointing.pysrc/accelerate/utils/memory.pysrc/accelerate/utils/operations.py