Add MiniCPM-1B model support#4601
Open
Belugaaaa wants to merge 1 commit into
Open
Conversation
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.
Before submitting
Validation passed locally:
pre-commit run --files ...bash -n scripts/minicpm/run_ms_swift_gsm8k.sh scripts/minicpm/run_sft_gsm8k.sh tests/integration_test/minicpm_sft_single_card.shpython3 -m py_compile scripts/minicpm/*.py paddleformers/nn/norm.py paddleformers/transformers/minicpm/*.py tests/transformers/minicpm/*.pyAdd test cases into
testsfolder. If there are codecov issues, please add tests cases first.Added test coverage:
tests/transformers/minicpm/test_modeling.pytests/config/ci/minicpm_sft_single.yamltests/integration_test/minicpm_sft_single_card.shPR types
New features
PR changes
Models, Docs
Description
This PR adds PaddleFormers support for
openbmb/MiniCPM-1B-sft-bf16, including:Local validation uses the current best path: full-depth, full-width MiniCPM-1B. The HF
pytorch_model.bincheckpoint is converted to Paddle nativemodel_state.pdparams, then loaded through PaddleFormers for alignment and training validation.Validation results:
max_diff=4.57763671875e-05mean_diff=8.224584234994836e-06last_max_diff=3.0517578125e-05last_mean_diff=7.700375135755166e-06first_10_tokens_match=True[11225, 72, 5, 2219, 8107, 1379, 8360, 1410, 11225, 72]0.5329, step 1000.5421, step 1500.5408, step 2000.5424, step 2500.5483, step 3000.5435train_loss=0.1506,train_steps_per_second=0.1510.58973086, step 1000.56501245, step 1500.55724013, step 2000.55477822, step 2500.55431318, step 3000.554190040.0107Ran 33 tests ... OK (skipped=5)train_loss=11.2081Known remaining acceptance items:
tests/integration_test/minicpm_sft_single_card.sh.fused_rms_norm_ext; this should be rerun in the official compiler/runtime acceptance environment.