Skip to content

Commit db21f3c

Browse files
committed
Use native jax.device_put matching reference FLUX/SDXL models
1 parent ef7b8d5 commit db21f3c

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/maxdiffusion/generate_flux2klein.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,7 @@ def unbox_fn(x):
381381
max_logging.log("🚀 Pinning all parameters to TPU HBM permanently...")
382382
max_logging.log("=" * 80 + "\n")
383383
def put_params_on_devices(params_tree, shardings_tree):
384-
def _put_leaf(param, sharding):
385-
if hasattr(sharding, "is_fully_addressable") and sharding.is_fully_addressable:
386-
return jax.device_put(param, sharding)
387-
return device_put_replicated(param, sharding)
388-
389-
return jax.tree_util.tree_map(_put_leaf, params_tree, shardings_tree)
384+
return jax.device_put(params_tree, shardings_tree)
390385

391386
max_logging.log("Putting params on TPU HBM...")
392387
with mesh, nn_partitioning.axis_rules(config.logical_axis_rules):

0 commit comments

Comments
 (0)