Repository navigation
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
c6560f9 to
0906386
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The scoped changes consistently filter build jobs while preserving CLI precedence and compile-target resolution, with no blocking issues identified.
No open issues 🎉
What changed in this PR
This PR makes FlyDSL GEMM and convolution AOT job collection respect wheel build targets in GPU_ARCHS, avoiding unrelated GEMM builds and convolution jobs being dropped because of a machine-type ARCH value.
Changes:
- Centralizes build-target parsing and applies filtering inside both CSV parsers.
- Preserves
ARCHprecedence for CLI entry points while restoring the environment after collection. - Adds focused regression tests and documents the build-versus-CLI behavior.
| File | Description |
|---|---|
op_tests/test_flydsl_aot_arch_filter.py |
Tests target parsing, CLI overrides, and GEMM filtering. |
aiter/aot/flydsl/README.md |
Documents architecture selection for builds and CLI usage. |
aiter/aot/flydsl/gemm.py |
Moves architecture filtering into CSV job collection. |
aiter/aot/flydsl/conv.py |
Uses shared filtering without build-time ARCH interference. |
aiter/aot/flydsl/common.py |
Adds shared target parsing and CLI collection helpers. |
Review effort: Balanced
- Filters FlyDSL GEMM jobs by GPU_ARCHS inside parse_csv, so setup.py's run_aot skips archs the wheel is not built for instead of precompiling every arch in the tuned CSVs. - Reads only GPU_ARCHS in the conv parse_csv, since build images export ARCH as a machine type such as x86_64, which dropped every conv job from a wheel build. - Adds get_gfx_list_env to common, which parses an explicit GPU_ARCHS split on ';' or ',' and treats unset or native as no filter. - Adds collect_cli_jobs to common, which applies ARCH as GPU_ARCHS while the python -m entry points collect jobs, so parse_csv stays the only arch filter and ARCH still takes precedence there. - Covers GPU_ARCHS parsing, ARCH over GPU_ARCHS, and the GEMM parse_csv filter in a new arch filter test.
0906386 to
487e35e
Compare
…-aot-arch-filter # Conflicts: # aiter/aot/flydsl/README.md
- Reads GPU_ARCHS through aot_target_archs for GEMM and conv, replacing get_gfx_list_env, so every kind agrees on what a target list is. - Drops the chunk_gdn_h jobs of unlisted archs in parse_csv, resolving a job's arch through a job_arch shared with its compile step. - Builds no fmha_fp8 jobs unless GPU_ARCHS is unset or lists gfx950, the only arch those kernels compile for. - Lets ARCH replace GPU_ARCHS for the fmha_fp8 entry point, as for the others. - Checks that every kind run_aot pools collects nothing for an unlisted arch.
|
Closing now that #6956 is merged |
Motivation
When
setup.pyprecompiles FlyDSL kernels for a wheel (run_aot), it collects jobs from every kernel family. MoE and MegaMoE keep only the archsGPU_ARCHSnames (#6362). The other families do not:main(), thepython -m aiter.aot.flydsl.gemmentry point.run_aotnever goes throughmain(), so a gfx950 wheel also builds the gfx1250 kernels, and a gfx942 wheel builds 7885 kernels it can never run.parse_csv, but readsARCHbeforeGPU_ARCHS. Build images exportARCHas a machine type such asx86_64, so on those hosts the filter keeps nothing and the wheel ships no precompiled conv kernels.An AOT miss is not fatal (the kernel is JIT-compiled at runtime), but the first two cases waste build time and wheel size, and the third turns every conv call into a runtime compile.
Technical details
run_aotpools now readsGPU_ARCHSthroughaot_target_archs()incommon.py, the helper [OPUS] [FlyDSL] [JIT] [Feature] Build the MoE and MegaMoE AOT caches by replaying the runtime on CPU #6362 added for MoE, so all kinds agree on what a target list is. It does not readARCH.parse_csv. A job's arch is resolved the way its compile step resolves it: the CSV'sgfxcolumn with acu_numfallback for GEMM and conv,cu_numfor chunk_gdn_h, which compiles from it. chunk_gdn_h gets ajob_arch()that both its filter and its compile step use.jobs_for_shapereturns nothing unlessGPU_ARCHSis unset or lists gfx950 (keeps_arch()incommon.py).python -mentry points,collect_cli_jobs()/cli_arch_env()applyARCHasGPU_ARCHSwhile collecting, soARCHstill takes precedence there, as on main, andparse_csvis the only filter. GEMM's second filter inmain()is removed.Behavior changes
FlyDSL jobs collected by
run_aotfrom the in-tree tuned CSVs:GPU_ARCHSunsetARCH=x86_64GPU_ARCHS=gfx950GPU_ARCHS=gfx942GPU_ARCHS=gfx1250The 734 GEMM jobs a gfx950 build drops are the gfx1250 rows. Every chunk_gdn_h tuned row is gfx942. Unset and
GPU_ARCHS=nativekeep every job, as before.GPU_ARCHSlists are;-separated, asaot_target_archs()and the CK build read them. Conv also split on,; it no longer does.python -mentry points,ARCHstill overridesGPU_ARCHS, as on main.Test plan
op_tests/test_flydsl_aot_arch_filter.py:collect_cli_jobswithGPU_ARCHS=gfx942 ARCH=gfx950collects for gfx950 and restoresGPU_ARCHSafterwards (no FlyDSL needed).parse_csvon rows of two archs under unset and a single listed arch; conv also underARCH=x86_64, which it now ignores (skips without FlyDSL).run_aotpools collects nothing for an unlisted arch and something whenGPU_ARCHSis unset, so a new kind cannot skip the filter._collect_aot_jobs_for, the collection steprun_aotuses.ruffandblackare clean on the touched files.