Skip to content

feat: configure standalone checkpoint converters with --pure-nnx flag#4560

Closed
RexBearIU wants to merge 1 commit into
gptoss-20b-e2efrom
gptoss-20b-e2e-linen
Closed

feat: configure standalone checkpoint converters with --pure-nnx flag#4560
RexBearIU wants to merge 1 commit into
gptoss-20b-e2efrom
gptoss-20b-e2e-linen

Conversation

@RexBearIU

@RexBearIU RexBearIU commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR configures the standalone GPT-OSS checkpoint converter scripts with a --pure-nnx flag (defaulting to True) and completely bypasses any runtime loader translators or bridges.

Key Details:

  1. Scanned Checkpoint Converter (convert_gpt_oss_ckpt.py):
    • Added --pure-nnx command line argument (default: True).
    • Dynamically formats the converted scanned weight layout to either use pure-NNX integer-nested layer keys under decoder.layers (when --pure-nnx=True), or legacy Flax Linen string keys under decoder.layers_X (when --pure-nnx=False).
  2. Unscanned Checkpoint Converter (convert_gpt_oss_unscanned_ckpt.py):
    • Added --pure-nnx command line argument (default: True).
    • Dynamically formats individual layer variables under nested "layers" with integer keys matching modern NNX scan_layers=False hierarchy (when --pure-nnx=True), or flat string keys (when --pure-nnx=False).
  3. Pristine Core Codebase:
    • Completely restored model_creation_utils.py to its original, pristine state with zero runtime bridge translators or mappings.
    • This ensures absolutely zero risk of regression or side effects for all other models (Llama, Gemma, Mistral) and standard training pipelines.

Note

Relation: This PR provides the essential --pure-nnx converter formatting required by the GPTOSS-20B modular testing pipeline in #4556. It should be reviewed and merged first.

Tests

Checklist

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

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • 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, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@RexBearIU
RexBearIU marked this pull request as draft July 21, 2026 21:05
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@RexBearIU
RexBearIU force-pushed the gptoss-20b-e2e branch 2 times, most recently from 7da9937 to b1b5b0b Compare July 22, 2026 02:22
@RexBearIU
RexBearIU force-pushed the gptoss-20b-e2e-linen branch from 5de2615 to ed08a80 Compare July 22, 2026 02:23
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