Repository navigation
feat(ep/v2): gfx1250-strict support - #874
Conversation
- Device code keys gfx125x paths on MORI_GFX125X / CCO_GFX125X, which include gfx1250-strict - Arch detection, build lists and AsyncLL defaults accept gfx1250-strict; arch lists defer to the arch the GPU reports - Tuning rows for gfx1250 ASIC revision 0, picked by revision; tuned grids capped at the CU count - A code object built for another arch fails to load with both archs named - Torch-free EPv2 smoke test; the no-GPU arch tests run in CI Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
59e0a1c to
f45155a
Compare
- Table key gfx1250-rev0 is now gfx1250-strict; selection by ASIC revision is unchanged Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
kawhil-amd
left a comment
There was a problem hiding this comment.
Review of the gfx1250-strict change. I read the full non-test diff and searched the PR head for leftover __gfx1250__ / == "gfx1250" checks. I found none in the device or host paths. I did not review test_ep_smoke_no_torch.py. I did not run any test. My local clang does not support gfx1250-strict, so I could not compile-check the macro below.
1. Device side depends on the macro name __gfx1250_strict__ (medium, unverified)
arch.hpp, cco.hpp and utils.hpp all use it. DeviceMacroTest only greps source text and does not call the compiler. If the name is wrong, v1 intranode_entry.hpp silently takes the portable body. The host still sees the gfx125 prefix and reserves TDM LDS, so host and kernel disagree with no error. The new #error guard covers only v2 ep_intranode_1250x.hpp. Please confirm with clang --offload-arch=gfx1250-strict -dM -E, or add that check to CI.
2. Python and C++ may get the arch name from different sources (medium, unverified)
C++ uses hipGetDeviceProperties().gcnArchName. Python detect_gpu_arch() uses rocm_agent_enumerator / rocminfo. The PR says KFD reports gfx1250 for both targets. If the enumerator reports gfx1250 on a strict runtime, the v1 JIT builds a gfx1250 code object that fails to load. _module_load_note in hip_driver.py compares against the same enumerator, so it adds no hint in exactly that case. Which source reports gfx1250-strict on real hardware?
3. MORI_GPU_ARCHS change also affects gfx9 users (low)
CMake now returns the whole list, so every mori_add_device_target gets all listed archs as HIP_ARCHITECTURES. Before, it got only the first. In Python, a list of several archs no longer overrides detection. The detected GPU wins. Both are probably intended, but the PR description does not mention them.
4. gfx1251 joins the gfx125x family in cco.hpp (low)
CCO_GFX125X includes __gfx1251__. Before, cco.hpp tested only __gfx1250__. gfx1251 now gets wave32 and the SDMA scope fields there. This matches the v1 family test but is a behavior change that is not mentioned.
5. Nits
_fit_cusis copied word for word inhip_tuning_configs.pyandtuning_configs.py. It also clamps silently, with no log.- The PR description is empty. The design is only in
docs/MORI_JIT_V2_DESIGN.md.
The ASIC revision check (KFD capability bits 25:22, revision 0) looks correct. I cannot confirm that revision-0 parts are the ones that can run strict. That needs the author's hardware knowledge.
- Share the CU-count clamp as mori.ops.utils.fit_blocks_to_cus; it warns once when it caps - v1 JIT passes MORI_HOST_GFX125X; intranode_entry.hpp fails to build if the device macros disagree - Test the family macros with the device compiler, and that arch.hpp and cco.hpp test the same family - Update the strict tests for main's aggReserve default and 256-block gfx1250 rows Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Re: review. Thanks for the review. I merged main and pushed the fixes below. 1.
2. Arch source
3.
4. gfx1251 5. Nits Revision 0: Yes. ASIC revision 0 parts are the ones that can run gfx1250-strict; revision 1 parts always report gfx1250. The rows are also selected whenever the runtime reports gfx1250-strict, even if the revision cannot be read. |
- ll128() returns None when the gfx1250-strict rows apply, so these parts run the schedule's plans - Test that revision-0 parts (either code target) get no LL128 plan and revision 1 still does Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
- bf16 dispatch at topk 6/8/9 takes 64x8 for small token counts - Gather combine at topk 6/8/9 takes 128x8 around 256 tokens - New EP4 hidden-2048 topk-8 dispatch rows (16 warps from 512 tokens) in place of the capped gfx1250 ones Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…mbine the same way on every rank Brings in #874 and the KernelConfig schedule; the push plans are keyed by tuning.KernelConfig like the schedule's. Review changes: - Above LL128's max_tok a combine pulls only when it asks for the weight fold or combines a snapshot handle, which every rank of a call does alike, and pushes otherwise, whatever its token count and wherever its input lives; in_view_pull_max is gone. Before, each rank chose from its own token count and from whether its own input was in combine_in_view(), so the ranks of one call could disagree, and the pushing ranks then reduced landing rows nobody wrote. - The push geometry still comes from the rank's own token count; ranks of one call may run different push geometries, since the landing rows and their signals do not depend on it. - bf16_push() reads _device_keys()[0], so gfx1250-strict parts have no row and build no push plans. - MORI_EP_BF16_PUSH=0 builds no push plans and no landing area; any value but 0 or 1 raises. - test_bf16_push_select.py: token counts crossing max_tok and every push bucket edge, the same on every rank and different on each, with the input passed five ways (plain tensor, combine_in_view(), combine_in_view() on alternate ranks only, with weights, through a snapshot handle); under MORI_EP_BF16_PUSH=0 it checks that no push plan is built. - README: the push plans, which combine a call runs, and the opt-out.
No description provided.