Skip to content

Fix hlo_diff_test to compile the real NNX path#4308

Merged
copybara-service[bot] merged 1 commit into
mainfrom
fix/hlo-diff-nnx-references
Jul 1, 2026
Merged

Fix hlo_diff_test to compile the real NNX path#4308
copybara-service[bot] merged 1 commit into
mainfrom
fix/hlo-diff-nnx-references

Conversation

@ecnal-cienet

@ecnal-cienet ecnal-cienet commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

hlo_diff_test loaded each model yml (e.g. models/llama3-8b.yml) directly as the top-level config. Those model ymls declare no base_config parent, so base.yml was never merged in. Two things broke as a result:

  • pure_nnx fell back to its pydantic schema default (False) instead of base.yml's True, so the test silently kept compiling the Linen path even after the NNX defaults were flipped. Its reference HLOs were therefore stale Linen graphs.
  • logical_axis_rules lives only in base.yml, so it was left empty.

Compile via base.yml + model_name (the normal training path) instead, so the config inherits base.yml's logical_axis_rules and exercises the real NNX path. The three reference HLOs (deepseek3, llama3_8b, qwen3_1.7b) are regenerated for NNX via the Update HLO References workflow.

Tests

  • Ran the Update HLO References workflow on this branch to regenerate tests/utils/reference_hlo_*.txt in the GitHub Actions TPU (v6e-4) environment.
  • tests/integration/hlo_diff_test.py passes against the regenerated references in CI.

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.

@ecnal-cienet ecnal-cienet force-pushed the fix/hlo-diff-nnx-references branch from d04acaf to efbac61 Compare June 30, 2026 19:24
@AI-Hypercomputer AI-Hypercomputer deleted a comment from google-cla Bot Jun 30, 2026
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hi @ecnal-cienet, 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

Copy link
Copy Markdown
Contributor

🤖 I'm sorry @ecnal-cienet, but I was unable to process your request. Please see the logs for more details.

@xibinliu xibinliu 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.

Can we also change the NNX flag default values to "True", so even without including the base.yaml, the tests can use the True flags.

Comment thread tests/integration/hlo_diff_test.py Outdated
hlo_diff_test loaded each model yml directly as the top-level config, which
skips base.yml and leaves pure_nnx at its pydantic schema default (False), so
the test kept silently compiling the Linen path even after the NNX defaults
were flipped to True in base.yml. Its reference HLOs are therefore still Linen.

Compile via base.yml + model_name (the normal training path) so the config
inherits base.yml's logical_axis_rules and exercises the NNX path. The three
reference HLOs are regenerated for NNX via the Update HLO References workflow.

Also flip the enable_nnx/pure_nnx/pure_nnx_decoder pydantic schema defaults to
True so a config built without base.yml no longer silently falls back to the
Linen path.
@ecnal-cienet ecnal-cienet force-pushed the fix/hlo-diff-nnx-references branch from bff39a0 to 36e333c Compare June 30, 2026 22:59
@copybara-service copybara-service Bot merged commit d30c749 into main Jul 1, 2026
105 of 107 checks passed
@copybara-service copybara-service Bot deleted the fix/hlo-diff-nnx-references branch July 1, 2026 02:56
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