Skip to content

Allow variadic arguments in find_executable_batch_size - #4508

Open
Yushu-Li wants to merge 1 commit into
huggingface:mainfrom
Yushu-Li:fix/variadic-batch-size
Open

Yushu-Li wants to merge 1 commit into
huggingface:mainfrom
Yushu-Li:fix/variadic-batch-size

Conversation

@Yushu-Li

@Yushu-Li Yushu-Li commented Nov 7, 2026

Copy link
Copy Markdown

What does this PR do?

I updated the argument guard in find_executable_batch_size so a training function that accepts *args can receive those arguments. The previous check counted parameter names as a fixed positional capacity and could reject valid calls before the training function ran. Functions with a fixed signature still use the existing guard and error message.

The regressions exercise a simulated out-of-memory retry with positional and keyword arguments, a wrapped bound method, and a call with no extra arguments. The first two fail on upstream main. The memory utility suite passes locally (9 passed, 1 skipped), along with Ruff lint and format checks for the changed files. The out-of-memory path is simulated, so no accelerator is needed.

I used OpenAI Codex to assist with implementation and testing.

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