Skip to content

I add mixed array restore support to SingleReplicaArrayHandler - #3613

Open
jabrailkhalil wants to merge 4 commits into
google:mainfrom
jabrailkhalil:fix/mixed-single-replica-restore
Open

jabrailkhalil wants to merge 4 commits into
google:mainfrom
jabrailkhalil:fix/mixed-single-replica-restore

Conversation

@jabrailkhalil

@jabrailkhalil jabrailkhalil commented Oct 2, 2026 •

Copy link
Copy Markdown

Fixes #3527.

I allow SingleReplicaArrayHandler to restore a batch containing both SingleReplicaArrayRestoreArgs and ordinary ArrayRestoreArgs. A registry batches JAX arrays under the same handler, so the current type check prevents arrays partitioned across the replica axis from opting out of broadcasting.

I split the validated batch by argument type, retain the existing single-replica implementation in a private helper, delegate ordinary arguments to ArrayHandler, and restore the original result order. I document that corresponding argument types must agree across processes and add a changelog entry.

I add 12 distributed regression cases covering interleaved arguments, ordinary-only batches, both primary replicas, and OCDBT/non-OCDBT storage, plus six invalid-input cases. I verified that all 12 final regression cases fail on the updated upstream handler.

I reran the following on Linux CPU with JAX 0.11.2 after rebasing onto upstream db64a37. The validated checkpoint source is identical to current head a158276:

I also reran 14 local tests, a real PyTree round trip with six ordinary array dtypes, isort, and the repository-pinned pytype with -P checkpoint; these passed. The updated baseline fails that type check on the existing narrow override signature. Pylint reports existing warnings; I compared both complete files against the updated baseline and found no additional diagnostic counts (202 baseline, 193 current).

I reran JAX 0.6.0 validation, but serialization/mesh failures also reproduce on the unmodified baseline, including missing ArrayImpl.format and non-context-manager jax.sharding.set_mesh. The default pytype hook fails on standard-library stub resolution in both revisions; the combined workflows remain red for those baseline failures. I have not validated accelerator hardware or a Pathways dispatcher.

@jabrailkhalil

jabrailkhalil commented Oct 3, 2026 •

Copy link
Copy Markdown
Author

Update (October 11): the current head is a158276ac53152df8250c135dd02580cb7df932b. The Google CLA check passes. The contributor lint/security workflows still require maintainer authorization; the available change-classification check is green, but its scan steps were skipped, so I am not counting that as a completed security scan. Could a maintainer authorize the pending runs and review the mixed-argument routing when convenient?

The PR description links the executed two-process CPU checks and unmodified-baseline comparisons, including the existing minimum-JAX failures. Those are contributor-run results, not upstream approval or GPU/TPU/Pathways validation. I have kept the existing broadcast implementation intact and am happy to adjust the argument-handling boundary if needed.

@jabrailkhalil
jabrailkhalil force-pushed the fix/mixed-single-replica-restore branch from 9015daf to 3929327 Compare October 5, 2026 17:21
@jabrailkhalil
jabrailkhalil force-pushed the fix/mixed-single-replica-restore branch from 3929327 to a158276 Compare October 7, 2026 12:55
@jabrailkhalil

jabrailkhalil commented Oct 20, 2026 •

Copy link
Copy Markdown
Author

I merged current main (30f564d6), resolving only the changelog conflict. I kept the new upstream entries and the pending mixed-restore entry; the handler and regression tests are byte-identical to the previous PR head.

Fresh Linux CPU validation of f24a56f8, with JAX 0.11.2: run and rank logs.

  • Complete upstream single-host checkpoint selection: 4055 passed, 289 skipped, 375 subtests passed.
  • Two-rank type-handler suite: 87/85 passed; all 12 mixed-restore regressions passed on each rank.
  • Two-rank checkpoint-handler integration: 301/297 passed, 20 subtests per rank. The unchanged current-main baseline also passes both distributed suites.

The PR still changes only the handler, its tests, and the changelog. No GPU/TPU/Pathways execution is claimed.

The conflict is cleared. Upstream formatting/lint and security-scan workflows are awaiting maintainer authorization; could a maintainer authorize those runs and review the update?

@jabrailkhalil

jabrailkhalil commented Oct 22, 2026 •

Copy link
Copy Markdown
Author

I merged main at e758a290 into 185d8736, keeping both imports. The mixed-restore logic is unchanged.

On Linux CPU with JAX 0.11.2, I ran two ranks with four devices each. The type-handler suites passed 117 and 115 tests (two skips on rank 1). The checkpoint-handler suites passed 301 and 297 tests (four skips on rank 1). All 12 mixed-restore cases per rank failed as expected when I restored the main handler.

The hooks still hit import-order and stub issues on main and the PR. The package-aware pytype check found the same two existing findings on both trees. The narrow override mismatch on main is gone on the PR.

I also tested the automatic merge with 45017eea, which adds the typed PRNG-key restore fix. The same four dispatcher tests fail on exact main and on the PR merge tree with the unexpected thinmint_testing argument. The remaining type-handler tests passed on both ranks, including all mixed-restore cases.

Previous merge results

I merged current main and resolved the import conflict, preserving its new batching code. Validation on this exact source is green: the full single-host checkpoint selection and the two-rank type-handler/checkpoint-handler suites, with both head and current-main controls. The mixed-restore regressions also pass. Ready for another look.

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.

Support mixed SingleReplicaArrayRestoreArgs / ArrayRestoreArgs batches in SingleReplicaArrayHandler.deserialize

1 participant