Skip to content

fix(ci): resolve CI failures for PR #4501 sharding and Tunix adapter rollout regression - #4689

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_957035527
Open

fix(ci): resolve CI failures for PR #4501 sharding and Tunix adapter rollout regression#4689
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_957035527

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

fix(ci): resolve CI failures for PR #4501 sharding and Tunix adapter rollout regression

This CL fixes CI test and notebook failures:

  1. Follow-up for PR feat(nnx): support native Flax NNX PEFT/LoRA training loop #4501 (sharding.py):

    • Scopes PartitionSpec P() defaulting to NNX variables (isinstance(p_leaf, nnx.Variable)), allowing NNX LoRA and full-weight training models to execute safely without missing-spec errors.
    • Standard Linen parameters remain None so unit tests (test_mixed_sharding_fails) throw an AssertionError on unannotated arrays as expected (tolerance=0.5 untouched).
    • Keeps element counts (p_leaf.size) for unsharded parameter totals to preserve mixed-precision sharding validation.
  2. Fix for rollout regression (tunix_adapter.py):

    • Resolves a regression from upstream code changes by adding a _compat_wsc fallback shim around jax.lax.with_sharding_constraint in TunixMaxTextAdapter.
    • Ensures TPU notebooks and VllmRollout safely fall back to jax.sharding.reshard when encountering explicit mesh sharding assertions.

Tests

  • Verified tests/unit/maxtext_utils_test.py::TestAssertParamsSufficientlySharded (7/7 passed with tolerance=0.5 untouched).
  • Verified tests/integration/lora_e2e_nnx_test.py (sharding validation passed across all 10 tests).

Checklist

  • 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 and provided workload details above.
  • I have made or will make corresponding changes to the doc if needed.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#4501 from AI-Hypercomputer:nnx-lora-support 5b4a7de

@copybara-service
copybara-service Bot force-pushed the test_957035527 branch 4 times, most recently from 5229448 to 3e677e0 Compare July 31, 2026 14:21
@copybara-service
copybara-service Bot force-pushed the test_957035527 branch 5 times, most recently from 42d784f to 38aff74 Compare July 31, 2026 14:52
@copybara-service copybara-service Bot changed the title fix(sharding): restore strict sharding.spec assertion in _analyze_sharding fix(ci): resolve CI failures for PR #4501 sharding and Tunix adapter rollout regression Jul 31, 2026
@copybara-service
copybara-service Bot force-pushed the test_957035527 branch 14 times, most recently from 85c8daf to f583668 Compare July 31, 2026 17:09
…rollout regression

This CL fixes CI test and notebook failures:

1. **Follow-up for PR #4501 (`sharding.py`):**
   - Scopes `PartitionSpec P()` defaulting to NNX variables (`isinstance(p_leaf, nnx.Variable)`), allowing NNX LoRA and full-weight training models to execute safely without missing-spec errors.
   - Standard Linen parameters remain `None` so unit tests (`test_mixed_sharding_fails`) throw an `AssertionError` on unannotated arrays as expected (`tolerance=0.5` untouched).
   - Keeps element counts (`p_leaf.size`) for unsharded parameter totals to preserve mixed-precision sharding validation.

2. **Fix for rollout regression (`tunix_adapter.py`):**
   - Resolves a regression from upstream code changes by adding a `_compat_wsc` fallback shim around `jax.lax.with_sharding_constraint` in `TunixMaxTextAdapter`.
   - Ensures TPU notebooks and `VllmRollout` safely fall back to `jax.sharding.reshard` when encountering explicit mesh sharding assertions.

# Tests
- Verified `tests/unit/maxtext_utils_test.py::TestAssertParamsSufficientlySharded` (7/7 passed with tolerance=0.5 untouched).
- Verified `tests/integration/lora_e2e_nnx_test.py` (sharding validation passed across all 10 tests).

# Checklist
- [x] I have performed a self-review of my code. For an optional AI review, add the `gemini-review` label.
- [x] I have necessary comments in my code, particularly in hard-to-understand areas.
- [x] I have run end-to-end tests and provided workload details above.
- [x] I have made or will make corresponding changes to the doc if needed.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#4501 from AI-Hypercomputer:nnx-lora-support 5b4a7de
PiperOrigin-RevId: 957035527
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