Skip to content

feat(ep/v2): peak and capped tuning profiles for the hip schedule - #1003

Merged
jhchouuu merged 3 commits into
mainfrom
jiahzhou/ep-tuning-profile
Nov 16, 2026
Merged

jhchouuu merged 3 commits into
mainfrom
jiahzhou/ep-tuning-profile

Conversation

@jhchouuu

@jhchouuu jhchouuu commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a second tuning profile for the hip intranode schedule, so an EP op can keep its grids small and leave CUs to the expert GEMMs that share the GPU, while callers that read the tables directly keep today's rows.

  • peak: the tuned tables as they are.
  • capped: no grid wider than 64 blocks. A shape takes its _CAPPED_* rows. Without any, it keeps its peak buckets that fit and puts each wider bucket on 64 blocks of the larger of its warp count and the default's (16 dispatch, 8 combine), so a 128x24 push combine runs 64x24, and logs a warning naming the shape. LL128 and bf16 push rows already fit. AsyncLL sizes its grids from the CU count and is outside both profiles.

How the profile is chosen:

caller default override
the op (EpDispatchCombineConfig.tuning_profile) capped on gfx125x, peak elsewhere the config field, then MORI_EP_TUNING_PROFILE
hip_tuning_configs.lookup(profile=...), e.g. aiter's MegaMoE peak the argument, then MORI_EP_TUNING_PROFILE

The op stores the profile it resolved in tuning_profile, and the schedule dump names it. Pinned geometry and an explicit schedule work as before; an unknown profile name is refused on every path.

The capped rows added here are for EP4 hidden 5120, both DeepSeek-V4.1-Flash MoEs:

  • dispatch: 64x4 up to 256 tokens, 64x8 to 1024, 64x16 above, for every dispatch dtype;
  • combine: 64x8 up to 128 tokens, 64x16 above.

Their measurements are in the table comments.

test_tuning_profile.py (CPU only) checks:

  • under capped, every gfx125x lookup (each table shape × dispatch dtype × combine quant type, ASIC revisions 0 and 1) stays within 64 blocks;
  • the capped rows and the bucket fallback;
  • peak is lookup()'s default and leaves every lookup unchanged;
  • a capped push row without a peak push row, push buckets keeping their warps, AsyncLL staying outside the profiles;
  • precedence between the config field, the environment variable and the device default.

CI runs it with the other table tests; a conftest clears MORI_EP_TUNING_PROFILE so an exported value cannot change them.

🤖 Generated with Claude Code

- lookup() takes profile "peak" (the tuned tables, default) or "capped" (no grid over 64 blocks)
- Capped takes a shape's _CAPPED_* rows, else its peak rows with each wider bucket on the default
- EpDispatchCombineConfig.tuning_profile; MORI_EP_TUNING_PROFILE; capped is the gfx125x op default
- Capped rows for EP4 hidden 5120 (both DeepSeek-V4.1-Flash MoEs)
- test_tuning_profile.py and a README section

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@jhchouuu
jhchouuu requested a review from zhangfei829 November 13, 2026 14:32
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

GPU CI for bc3c1d60 (run): changed areas: ci_cco, epv2, test_setup

lane runs jobs
mori no MI355X intranode, MI355X ROCm 7.14, MI355X JAX, MI355X internode
mi300x no MI300X intranode, MI300X internode
umbp no UMBP unit test
cco yes CCO unit test, CCO EPv2 single-node test, CCO internode
fused yes CCO fused GEMM test
build yes MoRI build (compile check)

Test groups (the steps that run in those jobs): cco, epv2, fused.

Lanes follow the changed files. Adding ci:full re-runs CI with every lane, the full internode sweeps and every fused GEMM case; adding ci:mi300x re-runs it with the MI300X lanes added. /ci-rerun re-runs CI against the current main.

… profiles

- A wider bucket goes to 64 blocks of max(its warps, the default's), so push combine keeps 64x24
- A capped push row counts without a peak push row
- AsyncLL ops do not resolve a profile; tuning_profile is validated on every path
- The schedule dump names the profile; conftest clears MORI_EP_TUNING_PROFILE for these tests
- CI runs test_tuning_profile.py with the other table tests

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@zhangfei829

Copy link
Copy Markdown
Collaborator

look good for me, when it is merged to main, I will clean about block128 code, like blockNum == 128

@zhangfei829 zhangfei829 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please merge. thanks

- ci_cco.yml: the tuning-table step runs test_tuning_configs.py (#1001) and test_tuning_profile.py

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jhchouuu
jhchouuu merged commit e57a3d4 into main Nov 16, 2026
20 checks passed
@jhchouuu
jhchouuu deleted the jiahzhou/ep-tuning-profile branch November 16, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants