Skip to content

fix: accept fractional warmup rates - #385

Open
Iams4kura wants to merge 1 commit into
OpenMOSS:mainfrom
Iams4kura:bugfix/accept-fractional-warmup-rate-20260830t173408z
Open

fix: accept fractional warmup rates#385
Iams4kura wants to merge 1 commit into
OpenMOSS:mainfrom
Iams4kura:bugfix/accept-fractional-warmup-rate-20260830t173408z

Conversation

@Iams4kura

Copy link
Copy Markdown

Summary

  • Fixes: Running finetune_moss.py with a normal fractional override such as --warmup_rates 0.1 exits with argparse error code 2 before training starts, even though the option defaults to the fractional value 0.05.
  • Root cause: The argument parser declares --warmup_rates with type=int while the scheduler consumes it as a ratio multiplied by num_training_steps, so argparse rejects explicit fractional values that match the option's intended semantics.

Regression evidence

  • Before: .venv/bin/python -m unittest discover -s tests -p 'test_finetune_cli.py' -v exited 1

  • After: .venv/bin/python -m unittest discover -s tests -p 'test_finetune_cli.py' -v exited 0

Verification

  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m unittest discover -s tests -v
  • .venv/bin/python finetune_moss.py --warmup_rates 0.1 --help
  • git ls-files -z '*.py' | xargs -0 .venv/bin/python -m py_compile
  • git diff --cached --check

Scope

  • 2 files changed, +30 / -1 lines

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