Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions axlearn/cloud/gcp/examples/colocated_python_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""

import argparse
import ast
import os
import time
from contextlib import contextmanager
Expand Down Expand Up @@ -82,8 +83,11 @@ def create_state_spec_from_checkpoint(ckpt_path: str):
continue

if isinstance(value, dict) and "shape" in value and "dtype" in value:
# pylint: disable=eval-used
shape = eval(value["shape"]) if isinstance(value["shape"], str) else value["shape"]
shape = (
ast.literal_eval(value["shape"])
if isinstance(value["shape"], str)
else value["shape"]
)
dtype_str = value["dtype"]

# Convert dtype string to jax dtype
Expand Down