Skip to content

Commit 57bf96b

Browse files
Merge pull request #2459 from AI-Hypercomputer:xibin/v5p_1024_config
PiperOrigin-RevId: 816051413
2 parents 95542d9 + 3eb77db commit 57bf96b

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

benchmarks/maxtext_v5p_model_configs.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,46 @@
2323

2424
v5p_model_dict = {}
2525

26+
llama3_1_405b_8192_v5p_1024 = _add_to_model_dictionary(
27+
v5p_model_dict,
28+
MaxTextModel(
29+
model_name="llama3-1-405b-8192-v5p-1024",
30+
model_type="llama3.1-405b",
31+
tuning_params={
32+
"per_device_batch_size": 2,
33+
"ici_fsdp_parallelism": -1,
34+
"max_target_length": 8192,
35+
"attention": "flash",
36+
"gcs_metrics": True,
37+
"use_iota_embed": True,
38+
"remat_policy": "custom",
39+
"context": "offload",
40+
"mlpwo": "offload",
41+
"num_vocab_tiling": 4,
42+
"sa_block_q": 2048,
43+
"sa_block_kv": 2048,
44+
"sa_block_kv_compute": 2048,
45+
"sa_block_q_dkv": 2048,
46+
"sa_block_kv_dkv": 2048,
47+
"sa_block_kv_dkv_compute": 2048,
48+
"sa_block_q_dq": 2048,
49+
"sa_block_kv_dq": 2048,
50+
"dataset_path": "gs://max-datasets-rogue",
51+
"dataset_type": "synthetic",
52+
"reuse_example_batch": 1,
53+
"enable_checkpointing": False,
54+
"profiler": "xplane",
55+
"skip_first_n_steps_for_profiler": 5,
56+
"profiler_steps": 5,
57+
},
58+
xla_flags=(
59+
xla_flags_library.DENSE_VMEM_LIMIT_FLAG
60+
+ xla_flags_library.CF_FOR_ALL_GATHER
61+
+ xla_flags_library.HOST_OFFLOAD_FLAGS
62+
),
63+
),
64+
)
65+
2666
deepseek_v3_ep_256_v5p_512 = _add_to_model_dictionary(
2767
v5p_model_dict,
2868
MaxTextModel(
@@ -64,6 +104,8 @@
64104
),
65105
)
66106

107+
# llama4_scout_dropless_v5p_1024 should be tested with the same configuration
108+
# as the following llama4_scout_dropless_v5p_256 config.
67109
llama4_scout_dropless_v5p_256 = _add_to_model_dictionary(
68110
v5p_model_dict,
69111
MaxTextModel(
@@ -241,3 +283,52 @@
241283
),
242284
),
243285
)
286+
287+
deepseek3_671b_v5p_1024 = _add_to_model_dictionary(
288+
v5p_model_dict,
289+
MaxTextModel(
290+
model_name="deepseek3_671b_v5p_1024",
291+
model_type="deepseek3-671b",
292+
tuning_params={
293+
"ici_fsdp_parallelism": -1,
294+
"ici_tensor_parallelism": 1,
295+
"per_device_batch_size": 6,
296+
"max_target_length": 8192,
297+
"dtype": "bfloat16",
298+
"weight_dtype": "float32",
299+
"megablox": True,
300+
"sparse_matmul": True,
301+
"scan_layers": True,
302+
"use_custom_sort_vjp": True,
303+
"sa_block_q": 2048,
304+
"sa_block_kv": 2048,
305+
"sa_block_kv_compute": 2048,
306+
"sa_block_q_dkv": 2048,
307+
"sa_block_kv_dkv": 2048,
308+
"sa_block_kv_dkv_compute": 2048,
309+
"sa_block_q_dq": 2048,
310+
"sa_block_kv_dq": 2048,
311+
"remat_policy": "custom",
312+
"decoder_layer_input": "offload",
313+
"out_proj": "offload",
314+
"tile_batch_seq": 512,
315+
"tile_embed_dim": 1024,
316+
"tile_mlp_dim": 1024,
317+
"sa_use_fused_bwd_kernel": False,
318+
"dataset_type": "synthetic",
319+
"enable_checkpointing": False,
320+
"profiler": "xplane",
321+
"skip_first_n_steps_for_profiler": 5,
322+
"profiler_steps": 5,
323+
},
324+
xla_flags=(
325+
xla_flags_library.ENABLE_SPARSECORE_OFFLOADING_FOR_RS_AG_AR
326+
+ xla_flags_library.HOST_OFFLOAD_FLAGS
327+
+ xla_flags_library.LAYOUT_FOR_ALL_REDUCE_SCATTER
328+
+ xla_flags_library.DATA_PARALLEL_OVERLAP
329+
+ xla_flags_library.MOE_VMEM_LIMIT_FLAG
330+
+ xla_flags_library.DISABLE_MEGACORE_FUSION_ALLOW_AGS
331+
+ xla_flags_library.ENABLE_ASYNC_COLLECTIVE_PERMUTE
332+
),
333+
),
334+
)

benchmarks/xla_flags_library.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,7 @@
191191

192192
# Disables collective matmul operations.
193193
DISABLE_COLLECTIVE_MATMUL = " --xla_jf_spmd_threshold_for_windowed_einsum_mib=1000000"
194+
# Disable "megacore fusion allow ags".
195+
DISABLE_MEGACORE_FUSION_ALLOW_AGS = " --xla_tpu_megacore_fusion_allow_ags=false"
196+
# Enable async collective permute.
197+
ENABLE_ASYNC_COLLECTIVE_PERMUTE = " --xla_enable_async_collective_permute=true"

0 commit comments

Comments
 (0)