fix(checkpointing): load_biencoder_checkpoint passes release twice to get_checkpoint_name - #6975
fix(checkpointing): load_biencoder_checkpoint passes release twice to get_checkpoint_name#6975Anai-Guo wants to merge 2 commits into
Conversation
load_biencoder_checkpoint() calls
get_checkpoint_name(load_path, iteration, args.use_distributed_optimizer,
release=False)
but get_checkpoint_name()'s third parameter IS `release`, so the call passes
`release` both positionally and by keyword and raises
`TypeError: get_checkpoint_name() got multiple values for argument 'release'`.
There is no `use_distributed_optimizer` parameter to receive it.
Every other call site in the file passes `release` as the third positional and
nothing else; this one is the only inconsistent one.
Signed-off-by: Anai-Guo <antai12232931@outlook.com>
|
This PR has been automatically converted to draft because all PRs must start as drafts. When you are ready for review, click Ready for Review to begin the review process. This will:
See the contribution guide for more details. |
| checkpoint_name = get_checkpoint_name( | ||
| load_path, iteration, args.use_distributed_optimizer, release=False | ||
| ) | ||
| checkpoint_name = get_checkpoint_name(load_path, iteration, release=False) |
There was a problem hiding this comment.
Wish get_checkpoint_name had adopted https://realpython.com/python-asterisk-and-slash-special-parameters/
Are you interested in adding them?
|
/claude fix |
Signed-off-by: svcnvidia-nemo-ci <svcnvidia-nemo-ci@nvidia.com>
|
🛠️ Claude fix commit
What changed Files changed by Claude
Why DCO Sanitized and posted by |
|
/ok to test 646030b |
|
❌ Claude fix stopped because exact-SHA CI did not complete in time. View exact-SHA CI. |
|
The biencoder model was removed, the correct fix here is to remove the load_biencoder_checkpoint function all together. (and _add_biencoder_args() from arguments.py) while we're at it. |
What does this PR do?
load_biencoder_checkpoint()cannot run. It calls:but the third parameter of
get_checkpoint_name()isrelease:So
releaseis supplied both positionally and by keyword, and the call raises:There is no
use_distributed_optimizerparameter for that value to land in, so theextra argument is simply stale — it looks left over from an older signature.
The fix
Drop the stray positional.
argsis still used in the function (args.load), sonothing else changes.
Reformatted onto one line because it now fits inside the configured
line_length = 100.Why this is the right call shape
Every other
get_checkpoint_name()call site incheckpointing.pyalready passesreleaseas the third positional and nothing extra, e.g.Binding every call site in the file against the real signature: 15 consistent, 1
inconsistent — the one this PR fixes.
Verification
No GPU needed for this one. I lifted the real
get_checkpoint_namesignature out ofthe source with
ast, rebuilt it as aninspect.Signature, and replayed both callshapes:
get_checkpoint_name(load_path, iteration, args.use_distributed_optimizer, release=False)(current)TypeError: multiple values for argument 'release'get_checkpoint_name(load_path, iteration, release=False)(this PR)release=Falsepylint'sE1124(redundant-keyword-arg) covers exactly this shape, but therepo's pre-commit
pylinthook does not flag it today, which is presumably how itsurvived.
🤖 Generated with Claude Code