Skip to content

Warn when running on the Linen code path - #4654

Draft
ecnal-cienet wants to merge 1 commit into
mainfrom
feat/linen-deprecation-warning
Draft

Warn when running on the Linen code path#4654
ecnal-cienet wants to merge 1 commit into
mainfrom
feat/linen-deprecation-warning

Conversation

@ecnal-cienet

@ecnal-cienet ecnal-cienet commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Description

Logs a deprecation banner during config validation when a run selects the Linen code path, and notes the upcoming deprecation in the relevant field descriptions.

What it looks like

W0728 23:10:04 types.py:2922] ================================================================================
W0728 23:10:04 types.py:2923] MAXTEXT DEPRECATION NOTICE: you are running on the Linen code path.
W0728 23:10:04 types.py:2924] Selected by: pure_nnx_decoder=False
W0728 23:10:04 types.py:2925] Linen will be deprecated in the near future and removed after that.
W0728 23:10:04 types.py:2926] Plan to migrate to NNX: leave enable_nnx, pure_nnx and pure_nnx_decoder at their default of True.
W0728 23:10:04 types.py:2927] ================================================================================

Testing

case banner Selected by: Log
defaults (NNX) no log
enable_nnx=false yes enable_nnx=False log
pure_nnx=false yes pure_nnx=False log
pure_nnx_decoder=false yes pure_nnx_decoder=False log
all three off yes all three log

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.

Linen is slated for deprecation, but nothing tells users when they are on it.
Setting any of enable_nnx, pure_nnx or pure_nnx_decoder to False selects Linen,
including partial combinations such as pure_nnx_decoder=False alone, which
silently bridges a Linen decoder that Qwix cannot see.

Log a banner from config validation listing exactly which flags selected the
Linen path, and note the upcoming deprecation in the three field descriptions.
The check lives in the Pydantic model validator so it covers every entry point
rather than just train.
@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.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants