Repository navigation
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
Review (FlyDSL GEMM AOT consumer / non-comm enablement)This is the packaging consumer of #5340 for SILOTIGER-978. Runtime lookup already keys FlyDSL GEMM on On the second-opinion item ( Also:
I ran the codegen tests (82 function checks / 11 pytest cases). No full |
5f9cd36 to
03d1d98
Compare
70038fe to
bd52fd7
Compare
- Filters the packaging AOT job collector by build target, where previously only the CLI filtered and packaging baked every job in the CSVs. - Selects exact (gfx, cu_num) jobs for AITER_GPU_TARGETS, and keeps GPU_ARCHS and ARCH as arch-wide filters, warning for a requested target with no jobs and retaining its runtime fallback. - Reads both legacy variables through one parser, so each rejects an unknown arch, a separator-only value, and native combined with other entries, and both keep accepting ';' and ',' as they did before. - Keeps a row that records no CU count for every target of its arch, matching how a row that records no arch is inferred from its count. - Resolves the active target variable in one place, so the log line cannot name a variable the filter did not use. - Covers the packaging collector, partial coverage, legacy rows, the rejected inputs, and the separator contract in the codegen tests. The collector filters GEMM only: the other AOT kinds record half a target each, a CU count without an arch or an arch without a count, so a (gfx, cu_num) filter would drop all of them. main() catches the configuration errors, but the collector path raises them, so a caller there should expect a raise rather than a silent pass-through of a junk target env.
- Resolves GPU_ARCHS with CU_NUM into the same (gfx, cu_num) pairs the rest of the build compiles for, so a wheel carries only the jobs its targets name. - Keeps arch-wide selection for the CLI, where naming an arch to cross-compile all of it is the point, and for ARCH on both paths. - Corrects the AOT README, which said these variables were banner output and did not affect what gets built. - Moves the filter tests onto the resolved-pair contract and covers the CLI mode beside it. GPU_ARCHS=gfx950 CU_NUM=128 kept every gfx950 job and reported no gap in gfx950:128 coverage. Runtime dispatch was never at risk, since the lookup keys on (gfx, cu_num) regardless; the cost was dead kernels in the wheel and a coverage hole nothing named.
- Restricts the packaging path to AITER_GPU_TARGETS and GPU_ARCHS, the two variables this filter introduces, so a build host that exports ARCH for its own purposes cannot abort or narrow the wheel. - Leaves ARCH where python -m aiter.aot.flydsl.gemm already had it, selecting arch-wide and rejecting an unrecognised value exactly as before. - Drops the ARCH cases from the AOT filter test, which pinned behaviour this change has no reason to define. - Names main() and the full module command where the docs distinguish the two paths, neither of which said which entry point was meant. Build images and wrapper scripts commonly set ARCH to a machine type such as x86_64, and the filter raises on a value it does not recognise rather than ignoring it. Routing packaging through it would have made setup.py fail at the FlyDSL AOT stage on those hosts, and no in-tree workflow sets ARCH, so CI would not have caught it.
- Black rejects the trailing space.
cb7cc4e to
4c3ad41
Compare
…ctions added in earlier commits of this branch so CLI and packaging rules are easier to follow.
…ydsl-aot # Conflicts: # aiter/aot/flydsl/README.md # aiter/aot/flydsl/gemm.py
…solution' into cu-aware-targets/flydsl-aot
|
I merged main into this branch instead of merging the parent branch, so the stacked pr pulled commits from main into the diff. I'm fixing it now. The copilot comments were about changes made from some commits in main, not my branch. Fixed :) |
| test_flydsl_aot_target_filter() | ||
| test_flydsl_aot_legacy_rows() | ||
| test_flydsl_aot_invalid_archs() |
…argets/flydsl-aot
There was a problem hiding this comment.
🔵 Needs a closer look
Unconditional FlyDSL tests can abort the existing codegen suite when optional dependencies are unavailable.
1 open finding
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
- Wraps the imports of the three FlyDSL AOT filter tests in a guard that reports SKIP and returns, so the file runs on CPU with only pandas installed, as its docstring states. - Re-raises any ModuleNotFoundError whose missing module is neither torch nor flydsl, so a broken FlyDSL submodule or other dependency still fails the run.
There was a problem hiding this comment.
🔵 Needs a closer look
End-to-end multi-architecture wheel validation remains unconfirmed and needs human review.
1 open finding
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
|
See: |
|
Closed since the base branch is now closed. I opened #6847 to replace this PR. It's based off main and no longer in a pr stack. |


Stops a released wheel from precompiling FlyDSL GEMM kernels for architectures it is not built for. The packaging path compiled every job in the tuned CSVs regardless of the wheel's targets; it now filters by build target, the way the standalone entry point already did.
Stacked on #5340, which introduces
AITER_GPU_TARGETS: build targets written asgfx:cu_numpairs. The filter here resolves through that machinery, so packaging selects AOT jobs the way the rest of the build selects tuned rows.Motivation
setup.py→run_aot()→_collect_aot_jobs_for()calledcollect_aot_jobs()with no target filter, so approximately 220 gfx1250 kernels were built into every gfx942/gfx950 wheel, which never reaches them. The same gap shows up on MI350P: FlyDSL dispatch keys on(gfx, cu_num)from the live device, and every tuned FlyDSL row records 256 CUs, so on a 128-CU part every lookup misses, yet agfx950:128build was precompiling all of those kernels anyway. It now selects none of them, and once rows are tuned for 128 CUs it will select exactly those.Scope
GEMM only. Each other
OpKindreads its own CSVs and keeps only one of the two fields a target needs: MoE and chunk_gdn_h carrycu_numand recover an arch later throughcu_num_to_arch, grouped MoE carriesgfxalone, mxfp4 MoE hardcodesFLYDSL_GPU_ARCHto gfx950, and mega MoE builds its jobs without a CSV. Matching those jobs against a(gfx, cu_num)pair would drop every one. Filtering them means widening eachparse_csvto carry both fields, plus agfxcolumn for the mxfp4 model CSVs that lack one, which is out of scope here.Technical Details
1. Packaging now resolves targets the way CK does; the standalone entry point still does not. CK's codegen resolves
GPU_ARCHSandCU_NUMinto exact(gfx, cu_num)pairs and keeps only the tuned rows matching them. FlyDSL packaging did none of that, baking every row in the CSVs whatever the build targeted. It now resolves the same pairs, so both halves of a build select for the same SKU.The standalone entry point is unchanged: it still matches on architecture alone and ignores
CU_NUM. Only that divergence is now visible. UnderGPU_ARCHS=gfx950 CU_NUM=128packaging selects nothing, since every FlyDSL GEMM row records 256 CUs, while the CLI selects every gfx950 job. Neither result is wrong on its own, and an AOT miss only falls back to a runtime JIT compile, but one environment now means two different things depending on which entry point reads it.2. An unknown arch now fails the build.
GPU_ARCHS=gfx9999raises, aborting the wheel build where packaging previously ignored the variable and baked everything. Intended, but it is a hard failure on a free-formworkflow_dispatchinput. Every in-tree caller passes a valid value andgpu_archshas a default, so no automated path can hit it.3. The filter reads
AITER_GPU_TARGETSandGPU_ARCHSonly.ARCHstays on the standalone entry point: build images export it as a machine type such asx86_64, and an unrecognised value raises, so routing packaging through it would kill the wheel build on those hosts.4. Uppercase now matches where it previously matched nothing. Case-folding means
GFX950selects every gfx950 job where it used to select none. On the packaging path that is a narrowing, since it baked every job in the CSVs before reading no target variable at all; on the standalone entry point it is the opposite, since an unmatched arch there selected nothing and fell back to runtime JIT.Also in here
A release build gains one warning line naming gfx942, correct since no
libtype=flydslGEMM rows exist for it.parse_csvno longer raises on an emptycu_numcell; it parses as 0, which the filter treats as a wildcard. No shipped CSV trips this today.Test Plan
op_tests/test_gemm_codegen.py, covering the packaging collector end to end, partial target coverage, legacy rows with nogfx, both separator forms, and each rejectedGPU_ARCHSinput.Test Result
Passes;
ruffandblackclean. An AOT miss is not a failure, it falls back to a runtime JIT compile, soAITER_GPU_TARGETS=gfx950:128selecting 0 jobs today is safe.