Skip to content

Conversation

@NuojCheng
Copy link
Collaborator

@NuojCheng NuojCheng commented Dec 27, 2025

Description

Start with a short description of what the PR does and how this is a change from
the past.

The rest of the description includes relevant details and context, examples:

  • why is this change being made,
  • the problem being solved and any relevant context,
  • why this is a good solution,
  • some information about the specific implementation,
  • shortcomings of the solution and possible future improvements.

If the change fixes a bug or a Github issue, please include a link, e.g.,:
FIXES: b/123456
FIXES: #123456

Notice 1: Once all tests pass, the "pull ready" label will automatically be assigned.
This label is used for administrative purposes. Please do not add it manually.

Notice 2: For external contributions, our settings currently require an approval from a MaxText maintainer to trigger CI tests.

Tests

Test 1: search both batch sizes and remat policies (llama3.1-405b on tpu7x-1024)

Command

python -m MaxText.estimator \
MaxText/configs/base.yml \
compile_topology=tpu7x-1024 \
compile_topology_num_slices=1 \
model_name=llama3.1-405b \
max_target_length=32768 \
ici_context_parallelism=8 \
ici_fsdp_parallelism=-1 \
log_config=False \
write_estimator_result=False

Output recommendation:

Search completed in 971.74 seconds.
  - Found valid combo (not saved to file): pdb=0.25, policy={'mlpwo': 'remat', 'context': 'remat', 'mlpwi_0': 'remat', 'mlpwi_1': 'remat', 'query_proj': 'remat', 'out_proj': 'remat', 'key_proj': 'remat', 'value_proj': 'remat'}
  - Found valid combo (not saved to file): pdb=0.125, policy={'mlpwo': 'offload', 'context': 'offload', 'mlpwi_0': 'offload', 'mlpwi_1': 'offload', 'query_proj': 'device', 'out_proj': 'device', 'key_proj': 'device', 'value_proj': 'device'}
  - Found valid combo (not saved to file): pdb=0.125, policy={'mlpwo': 'remat', 'context': 'remat', 'mlpwi_0': 'remat', 'mlpwi_1': 'offload', 'query_proj': 'offload', 'out_proj': 'offload', 'key_proj': 'offload', 'value_proj': 'offload'}
  - Found valid combo (not saved to file): pdb=0.25, policy={'mlpwo': 'remat', 'context': 'remat', 'mlpwi_0': 'remat', 'mlpwi_1': 'remat', 'query_proj': 'offload', 'out_proj': 'offload', 'key_proj': 'offload', 'value_proj': 'offload'}
  - Found valid combo (not saved to file): pdb=0.25, policy={'mlpwo': 'remat', 'context': 'remat', 'mlpwi_0': 'remat', 'mlpwi_1': 'remat', 'query_proj': 'remat', 'out_proj': 'offload', 'key_proj': 'offload', 'value_proj': 'offload'}
  - Found valid combo (not saved to file): pdb=0.25, policy={'mlpwo': 'remat', 'context': 'remat', 'mlpwi_0': 'remat', 'mlpwi_1': 'remat', 'query_proj': 'remat', 'out_proj': 'remat', 'key_proj': 'offload', 'value_proj': 'offload'}
  - Found valid combo (not saved to file): pdb=0.25, policy={'mlpwo': 'remat', 'context': 'remat', 'mlpwi_0': 'remat', 'mlpwi_1': 'remat', 'query_proj': 'remat', 'out_proj': 'remat', 'key_proj': 'remat', 'value_proj': 'offload'}
  - Found valid combo (not saved to file): pdb=0.25, policy={'mlpwo': 'remat', 'context': 'remat', 'mlpwi_0': 'remat', 'mlpwi_1': 'remat', 'query_proj': 'remat', 'out_proj': 'remat', 'key_proj': 'remat', 'value_proj': 'remat'}
Done.

Full output: log

Test 2: search both batch size and remat policies only (deepseek3-671b on v5p-1024)

python3 -m MaxText.estimator MaxText/configs/base.yml \
model_name=deepseek3-671b \
compile_topology=v5p-1024 \
compile_topology_num_slices=1 \
ici_fsdp_parallelism=64 \
ici_expert_parallelism=8 \
dtype=bfloat16 \
weight_dtype=float32 \
scan_layers=True \
sparse_matmul=True \
use_custom_sort_vjp=False \
use_tokamax_splash=True \
use_tokamax_gmm=True \
sa_use_fused_bwd_kernel=False \
max_target_length=8192 \
sa_block_q=1024 \
sa_block_kv=1024 \
sa_block_kv_compute=1024 \
sa_block_q_dkv=1024 \
sa_block_kv_dkv=1024 \
sa_block_kv_dkv_compute=1024 \
sa_block_q_dq=1024 \
sa_block_kv_dq=1024 \
log_config=False \
write_estimator_result=False

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@NuojCheng NuojCheng added the draft Draft PR label Dec 27, 2025
@codecov
Copy link

codecov bot commented Dec 27, 2025

Codecov Report

❌ Patch coverage is 0% with 31 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/MaxText/estimator.py 0.00% 31 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft Draft PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant