-
Notifications
You must be signed in to change notification settings - Fork 442
Checkpoint utility: gpt-oss, hf to orbax #2818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
dae0b48 to
dd51cf4
Compare
|
🤖 Hi @shuningjin, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📋 Review Summary
This pull request introduces a significant and valuable set of enhancements to the checkpoint conversion utilities. The refactoring improves code modularity by moving shared functions to a central utils.py, and the new functionality, such as support for local Hugging Face models and unscanned GPT-OSS models, greatly increases the flexibility of these tools.
🔍 General Feedback
- Positive: The addition of more granular timing logs is a great improvement for performance analysis and debugging. The updated documentation in the README provides a much clearer overview of supported models and conversion paths.
- Good Refactoring: Moving
check_param_map_keystoutils.pyand introducingget_maxtext_model_infointo_maxtext.pyare excellent changes that improve code organization and reusability.
I have left a couple of minor comments, one regarding a bug in the timing calculation and another for a small docstring clarification. Overall, this is a solid contribution.
Description
Previously we have gpt-oss, orbax(scan) -> hf: #2647
Fix: b/459541579
Fix: b/452392132
Fix: b/452391921
What this does
to_maxtext.pyparam_mapping.py, gpt-ossto_huggingface.py_check_param_map_keysto utils.py, so it can be reused by to_maxtext.pyTests
1 HF -> orbax (gpt-oss-20b)
since we made non-trivial changes to lazy tensor implementation, also test lazy mode
HF -> orbax (scan), cpu
https://paste.googleplex.com/4888544332087296
https://paste.googleplex.com/5272274628378624
HF -> orbax (scan), cpu, lazy load
https://paste.googleplex.com/6192468888518656
https://paste.googleplex.com/5022180226236416
HF -> orbax (unscan), cpu
https://paste.googleplex.com/6000687559344128
https://paste.googleplex.com/6128993298415616
2 orbax -> HF (gpt-oss-20b)
orbax -> HF (unscan), cpu
https://paste.googleplex.com/5483624130543616
https://paste.googleplex.com/4854884102963200
3 HF -> orbax (check other models just in case)
qwen3-4b
https://paste.googleplex.com/5401590255190016
https://paste.googleplex.com/6538164284030976
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.