You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a code example to produce the error I am getting:
import jax
import jax.numpy as jnp
import jax.lib.xla_bridge as xb
from jax.sharding import Mesh
num_devices = len(jax.devices())
device_mesh = np.array(jax.devices(), dtype=np.object_).reshape((num_devices, 1))
mesh = Mesh(devices=device_mesh, axis_names=('gpu_index', 'host_index')) # type: ignore
def f(
x: jax.Array
) -> tuple[jax.Array, jax.Array]:
W = jnp.ones((4, 4)) # type: ignore
z = jnp.dot(x, W) # type: ignore
return z, W
x = jnp.ones((8, 4)) # type: ignore
backend = xb.get_backend()
options = xb.get_compile_options( # type: ignore
num_replicas=device_mesh.shape[0],
num_partitions=device_mesh.shape[1],
device_assignment=device_mesh,
use_auto_spmd_partitioning=True,
auto_spmd_partitioning_mesh_shape=list(device_mesh.shape),
auto_spmd_partitioning_mesh_ids=[d.id for d in device_mesh.flatten()]
)
input_dtype_struct = jax.ShapeDtypeStruct(x.shape, x.dtype) # type: ignore
f_new = jax.jit(f).lower(input_dtype_struct).compile(compiler_options=options) # type: ignore
When running this I get the error
File ".../site-packages/jax/_src/interpreters/pxla.py", line 2786, in from_hlo
compiler_options.keys()) if compiler_options is not None else None
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'jaxlib.xla_extension.CompileOptions' object has no attribute 'keys'
If I try putting the compiler options as a dictionary instead, I keep getting
jaxlib.xla_extension.XlaRuntimeError: INVALID_ARGUMENT: No such compile option: 'num_replicas'
System info (python version, jaxlib version, accelerator, etc.)
Description
Here is a code example to produce the error I am getting:
When running this I get the error
If I try putting the compiler options as a dictionary instead, I keep getting
System info (python version, jaxlib version, accelerator, etc.)
The text was updated successfully, but these errors were encountered: