@@ -151,6 +151,37 @@ def default_xla_options(
151151 xla_tpu_enable_ici_ag_pipelining = "true" ,
152152 )
153153
154+ # v7x flags from MaxText, inclusing SparseCore configs
155+ # TODO(samuel-andersen): Move v7x SparseCore config below with v6e
156+ options .update (
157+ xla_tpu_enable_sparse_core_collective_offload_all_reduce = "true" ,
158+ xla_tpu_enable_sparse_core_collective_offload_reduce_scatter = "true" ,
159+ xla_tpu_enable_sparse_core_collective_offload_all_gather = "true" ,
160+ xla_tpu_enable_sparse_core_collective_offload_2d_all_gather = "true" ,
161+ xla_tpu_enable_sparse_core_reduce_scatter_v2 = "true" ,
162+ xla_tpu_enable_sparse_core_collective_offload_3d_all_gather = "true" ,
163+ xla_tpu_use_single_sparse_core_for_all_gather_offload = "true" ,
164+ xla_sc_disable_megacore_partitioning = "true" ,
165+ xla_tpu_use_tc_device_shape_on_sc = "true" ,
166+ )
167+ if version == "v7x" :
168+ options .update (
169+ # Many of the v7x flags are similar to v6e
170+ xla_tpu_scoped_vmem_limit_kib = 65536 ,
171+ xla_tpu_enable_all_gather_offload_tracing = "true" ,
172+ xla_tpu_enable_async_collective_fusion_fuse_all_gather = "false" ,
173+ xla_enable_async_all_gather = "true" ,
174+ xla_tpu_prefer_async_allgather_to_allreduce = "true" ,
175+ xla_tpu_bf16_emission_mode = "NATIVE_EMISSION" ,
176+ )
177+
178+ # Ensure pipelining is properly configured
179+ options .update (
180+ xla_should_allow_loop_variant_parameter_in_chain = "true" ,
181+ xla_should_add_loop_invariant_op_in_chain = "true" ,
182+ xla_tpu_enable_ici_ag_pipelining = "true" ,
183+ )
184+
154185 # v7x flags from MaxText, inclusing SparseCore configs
155186 # TODO(samuel-andersen): Move v7x SparseCore config below with v6e
156187 options .update (
0 commit comments