Skip to content

Fix snapshot restore for abstract shapes and memory kind - #4879

Merged
sadikneipp merged 1 commit into
abhinavsing/snapshot-scalefrom
ksadi/snapshot-scale-fix
Aug 14, 2026
Merged

Fix snapshot restore for abstract shapes and memory kind#4879
sadikneipp merged 1 commit into
abhinavsing/snapshot-scalefrom
ksadi/snapshot-scale-fix

Conversation

@sadikneipp

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the pathways-utils dependency version and modifies the restore_original_shardings function in train_utils.py to compare sharding and memory_kind attributes on leaves. The review feedback points out a critical bug where jax.device_put could be called on a jax.ShapeDtypeStruct (which has a sharding attribute but is not a valid array-like object), resulting in a TypeError. It also notes that the subsequent elif block becomes redundant, and provides a code suggestion to resolve both issues.

Comment thread src/maxtext/utils/train_utils.py Outdated
@sadikneipp
sadikneipp force-pushed the ksadi/snapshot-scale-fix branch 3 times, most recently from 0c8abd1 to e16716c Compare August 14, 2026 18:01
@sadikneipp
sadikneipp force-pushed the ksadi/snapshot-scale-fix branch from e16716c to b7b4dd4 Compare August 14, 2026 18:04
@sadikneipp
sadikneipp merged commit 193b648 into abhinavsing/snapshot-scale Aug 14, 2026
16 of 19 checks passed
@sadikneipp
sadikneipp deleted the ksadi/snapshot-scale-fix branch August 14, 2026 21:53
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