Skip to content

GPT-OSS: Add user guide and tests - #2382

Merged
copybara-service[bot] merged 1 commit into
mainfrom
shuningjin-oss8
Sep 25, 2025
Merged

GPT-OSS: Add user guide and tests#2382
copybara-service[bot] merged 1 commit into
mainfrom
shuningjin-oss8

Conversation

@shuningjin

@shuningjin shuningjin commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator

Description

Main change: for gpt-oss

  • add user guide:
    • end_to_end/tpu/gpt_oss/run_gpt_oss.md
    • use gpt-oss-20b on v5p-8 (sparse_matmul + megablox) as example
  • add test script
    • end_to_end/tpu/gpt_oss/20b/test_gpt_oss.sh
    • end_to_end/tpu/gpt_oss/120b/test_gpt_oss.sh
  • pyconfig validation

Other change: format output from forward_logit_checker, correct typos in other files

Tests

single script for tpu: checkpoint conversion, logit check, train, sft, decode (instead of splitting conversion to another)

gpt-oss-20b, end-to-end test on v5p-8 cluster, takes around 1h

The test will also be onboarded to XLML: GoogleCloudPlatform/ml-auto-solutions#913

Additional Notes

HF tokenizer:

  • Here we directly use the HF tokenizer, instead of storing it as assets in the repo. This practice seems fine, as long as the HF access token is handled correctly.

HF access token:

  • For MaxText native training, the access token is not needed because the HF model/tokenizer (gpt-oss) and HF dataset (used in SFT) are not gated.
  • However, decoding with HF tokenizer still needs access token despite that the model is not gated. The tokenizer is built from JetStream utils, which handles things differently from MaxText.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed.

@RissyRan RissyRan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a few minor comments

Comment thread end_to_end/tpu/deepseek/Run_DeepSeek.md
Comment thread end_to_end/tpu/gpt_oss/20b/test_gpt_oss.sh

@RissyRan RissyRan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add announcement to the Main page to claim the support for gpt-oss models?

@shuningjin

Copy link
Copy Markdown
Collaborator Author

Could you also add announcement to the Main page to claim the support for gpt-oss models?

I just updated "README.md" and "supported_models_and_architectures.md".

@RissyRan RissyRan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

🤖 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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 support for the GPT-OSS family of models, including comprehensive user guides, test scripts, and necessary configuration updates. The changes are well-structured and the documentation is thorough.

🔍 General Feedback

  • The addition of end-to-end test scripts for gpt-oss-20b and gpt-oss-120b is excellent for ensuring model correctness and providing clear usage examples.
  • Several minor typos and path corrections in existing documentation have been addressed, improving overall quality.
  • The validation logic added to pyconfig.py is a good proactive measure to prevent misconfiguration of the new models.
  • There were critical formatting errors in the new test scripts that would have caused them to fail. These have been highlighted in the inline comments.

Comment thread end_to_end/tpu/gpt_oss/120b/test_gpt_oss.sh
Comment thread end_to_end/tpu/gpt_oss/20b/test_gpt_oss.sh
Comment thread end_to_end/tpu/gpt_oss/120b/test_gpt_oss.sh
Comment thread end_to_end/tpu/gpt_oss/20b/test_gpt_oss.sh
Comment thread end_to_end/tpu/gpt_oss/120b/test_gpt_oss.sh
Comment thread end_to_end/tpu/gpt_oss/20b/test_gpt_oss.sh
Comment thread docs/reference/supported_models_and_architectures.md
Comment thread end_to_end/tpu/deepseek/Run_DeepSeek.md
Comment thread end_to_end/tpu/gpt_oss/120b/test_gpt_oss.sh
Comment thread end_to_end/tpu/gpt_oss/run_gpt_oss.md

@parambole parambole left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this. I have left a few comments.

@parambole parambole left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

@github-actions

Copy link
Copy Markdown
Contributor

🤖 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.

@copybara-service
copybara-service Bot merged commit 240a59a into main Sep 25, 2025
58 of 61 checks passed
@copybara-service
copybara-service Bot deleted the shuningjin-oss8 branch September 25, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants