Skip to content

Commit 7b0e353

Browse files
fix(nnx): ignore rngs in gpt3 checkpoint conversion from paxml
1 parent 2aa4254 commit 7b0e353

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/maxtext/checkpoint_conversion/standalone_scripts/convert_gpt3_ckpt_from_paxml.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ def get_layer_prefix(keystr_pax):
254254

255255
def verify_fn(key_path, _):
256256
keystr = jax.tree_util.keystr(key_path)
257+
if "['rngs']" in keystr:
258+
return
257259
assert keystr in state_map, f"{keystr} not found"
258260

259261
jax.tree_util.tree_map_with_path(verify_fn, state)
@@ -264,6 +266,8 @@ def verify_fn(key_path, _):
264266

265267
def map_fn(key_path, value):
266268
key_path_str = jax.tree_util.keystr(key_path)
269+
if "['rngs']" in key_path_str:
270+
return value
267271
file_path, transform_fn = state_map[key_path_str]
268272
full_path = os.path.join(paxml_ckpt_prefix, file_path)
269273
spec = {"driver": "zarr", "metadata_key": ".zarray", "kvstore": {}}

0 commit comments

Comments
 (0)