Repository navigation
[FlyDSL] Tune DSV4.1 Flash EP4 configs and support large-token CSV fallback - #7960
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: Reviews: |
WAITING ON AUTHORPR Self-ReviewRevision Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision. Questions to answer in the PR description
Edit the Missing or invalid answers
Shadow mode reports what would block but keeps the status successful. Set |
Summary
Improve DeepSeek V4.1 Flash grouped MoE configuration selection on gfx1250: tune EP4 rows and reuse the largest compatible CSV token when a larger workload has no exact match. For example, non-EP 32768 tokens now uses the existing 16384-token configuration while still computing all 32768 tokens.
Changes
dsv41_tuned_grouped_fmoe.csvtodsv41_flash_tuned_grouped_fmoe.csv.topk=-1) rows for tokens 32–2048, 16384 and 32768; add a separate 65536 row. Keep tokens 4/8/16 and 4096/8192 unchanged. Replace existing rows rather than retaining duplicate scatter variants.min(next_pow2(m), 131072). This allows EP raw tokens 32768 and 65536 to select distinct rows.Performance
Hardware: AMD gfx1250, 256 CUs. A4W4 MXFP4, BF16 output, SiLU, dimensions 5120/2304, topk=6, no shared experts, balanced routing, seed=0; GEMM1 activation and requantization enabled. Values below are isolated GEMM timings, not end-to-end MoE or communication timings.
EP4: original CSV versus selected tuning
Native
op_tests/test_moe_ep.py, real EP mode, local compute (ep_fused=0), global E=384/local E=96, warmup=5, iters=128. EP raw tokens are global: compare raw4*Twith non-EPT(E96). The baseline and candidate were measured in the same workspace (02f8455c715cbfbc1884a1aaecae7860fd31ad9f), changing only the CSV. These selected tuning fields match the PR; tested rows had explicitep_fused=0, whereas the PR uses shared wildcard rows.Times are GEMM1+GEMM2 in microseconds. Positive reduction means faster. Raw 1024 and 32768 use the median of two runs; other listed points use one run.
The latest commit changes EP 16384 and 65536 configurations after these measurements; their previous candidate timings are intentionally excluded. Those two final rows still need GPU revalidation. Unchanged rows are omitted from the tuning table.
Non-EP validation, including 32768 tokens
FlyDSL 0.5.0, E96, warmup=5, iters=32; constant data/constant scales and uniform data/auto scales. The full powers-of-two sweep from 1 through 32768 passed 32/32 correctness checks. The measured lookup implementation and non-EP CSV rows match the PR. These are absolute validation results; no paired before/after timing was collected for this sweep.
Runtime logging confirms non-EP 32768 selects CSV token 16384. Const/random GEMM sums at 32768 are 1012.09/1133.68 µs.
Reproduce the non-EP sweep with FlyDSL 0.5.0 and the PR CSV:
Testing
Documentation
dsv41_flash_tuned_grouped_fmoe.csv.Dependencies
No new third-party dependencies or submodule changes. The unintended CK pin change was removed; CK matches main at
f93c029e09f67c983696eecac8e0e0350f3dbb54.Breaking Changes
The explicit CSV path is renamed; update external
AITER_CONFIG_GROUPED_FMOEreferences. No Python API or tensor shape changes.PR Self-Review
Reviewed revision
ad1f5faa842d91d16e611e2dcd8fa17394d3cd06Behavior and intent
Large inputs retain the actual workload size and reuse compatible tuning only when their lookup token exceeds available tuning. EP and non-EP retain distinct topk keys. Exact matches take priority; gaps below the maximum remain gaps.
Validation and unverified scope
ep_fused=1./workspace/trace/dsv41_ep4_tune_20261113/,/workspace/trace/dsv41_non_ep_32768_20261113/,/workspace/trace/flash_all_20261113_211740_3768/. These are local paths, not public downloads.PR-specific question
No automated path-specific self-review question was posted when this description was updated.
Changed op tests
op_tests/tuning_tests/test_grouped_ep_fused_lookup.py: adds coverage for maximum-token fallback, exact-match priority, missing intermediate buckets, workload/CU/scatter isolation, real Flash CSV selection and padding boundaries. These extend the existing lookup suite to cover the new behavior. Validation used the CPU-isolated AST harness; this is not a full package-import test run.