Skip to content

[HIP] [OPUS] [JIT] Hybrid pinning and ASIC-aware gfx1250 A0 COs - #6988

Merged
zufayu merged 2 commits into
mainfrom
demonsan/opus-gfx1250-hybrid-a0-co
Oct 27, 2026
Merged

zufayu merged 2 commits into
mainfrom
demonsan/opus-gfx1250-hybrid-a0-co

Conversation

@demonsan

Copy link
Copy Markdown
Contributor

Summary

  • Migrate the OPUS gfx1250 BF16 CO register banks to automatic-local amdgpu_pin_vgpr attributes with SSA copy-out, preserving exact kid/symbol identities and the 64-byte launch ABI.
  • Rebuild all 221 regular variants with yuyzhang512/llvm-project amdgpu-pin-hybrid@352c37bad3561fc0f23163d5b1419910213d26bb, and add 221 independent A0 --offload-arch=gfx1250-strict images under csrc/opus_gemm/gen_co/gfx1250-a0/. The previous named_reg/gfx1250/ explicit path mirrors the rebuilt regular images.
  • Select A0/B0 COs from the current HIP device's ASIC Revision (0 -> A0 strict, 1+ -> regular), rather than a node-wide stepping minimum or rocminfo agent ordinal. Cache registrations by device plus resolved absolute image path; remove the generated launcher's first-device static reference.
  • Validate actual ELF processor identity (0xeb strict vs 0x49 regular), reject missing/wrong profiles without cross-profile fallback, and roll back failed registrations before image buffers are released.
  • Adapt the newer unsigned TDM descriptor builtin prototype with C++17 SFINAE/equal-width bit casts; preserve the older prototype paths and exclude nested debug IR/assembly directories from packaging.
  • Add host parser/profile/cache regression coverage and a native HIP CO launch harness that does not depend on PyTorch, GPU RNG or rocminfo.

Validation

Recorded during development:

  • 332 passed for the regular CO integration suite on a gfx1250 B0 machine, including all 221 registered kids and padded/BMM/graph/tail coverage.
  • 5 parser/codegen/path tests + 12 builder tests passed; C++17 profile selection tests and compiled mock-HIP device/root-cache/registration-rollback tests passed.
  • All three physical CO directories (221 regular, 221 A0, 221 mirrored regular) were independently checked against their metadata: actual SHA256 and ELF processor identity, matching kids/symbols, 64-byte kernargs, zero spills, and no unresolved device symbols. Each profile records 87,968 WMMA destinations in its requested named banks.
  • In the exact rocm/dev-ubuntu-24.04:10.1.0-full image on g21-10, the native A0 smoke completed for 3 family representatives / 6 CPU-golden cases, including batch=2, tiny K, ragged M/N/K and row padding. Maximum absolute error was 0 for these cases. Runtime ASIC Revision was 0 and the real strict ELF was loaded without changing its processor flag.

Known A0 validation limitation - not a full correctness certification

The subsequent all-variant native rerun did not complete: it stopped making progress on kid 21316, 257x257x257, batch=2, pad=8, after loading the kernel. The same case had passed in the initial smoke. The test exceeded its bounded window and its worker did not exit after termination requests; no shared GPU reset was attempted.

Therefore this PR does not claim all-221 A0 numerical/stability certification or a performance improvement. A0 repeat-run behavior still needs investigation before treating the strict profile as fully validated for production. Earlier Torch/GPU-input validation attempts also encountered runtime/device-query stalls and are not counted as passing.

HIP 7.16.26385 was confirmed to load the strict ELF; HIP 7.15.26333 rejected it with hipErrorNoBinaryForGpu.

See the hybrid validation report and dev-image launch report for exact compiler/image identities, reproduction commands and the validation boundaries. The older std-branch experiment is explicitly marked historical.

Compile regular and gfx1250-strict images with LLVM amdgpu-pin-hybrid, preserve exact kids, and select the A0 profile by current-device ASIC Revision. Validate ELF identity and pin placement, isolate registrations by device/path, and add native HIP and cache regression coverage. Document the successful A0 smoke and incomplete full-repeat stability validation.
@demonsan
demonsan requested a review from a team October 27, 2026 05:13
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 6988 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@github-actions github-actions Bot changed the title [OPUS] Hybrid pinning and ASIC-aware gfx1250 A0 COs [HIP] [OPUS] [JIT] Hybrid pinning and ASIC-aware gfx1250 A0 COs Oct 27, 2026
Sort test imports, document the controlled trusted-AST execution using the existing test convention, and format the changed Python files with Black. Keep CO artifacts and runtime behavior unchanged.
@zufayu
zufayu merged commit fbb5e98 into main Oct 27, 2026
75 checks passed
@zufayu
zufayu deleted the demonsan/opus-gfx1250-hybrid-a0-co branch October 27, 2026 10:56
zufayu added a commit that referenced this pull request Oct 27, 2026
#6988 (merged) added A0 strict Opus code objects under gen_co/gfx1250-a0/,
selected by ASIC revision and validated by ELF mach id. Its refactor also
reintroduced many exact 'gfx1250' runtime-dispatch checks.

Rather than sweep every call site, collapse gfx1250-strict -> gfx1250 at the
single runtime detection source (_detect_native): A0 and B0 select the same
kernel family, and B0-only artifacts are rejected on A0 by the asicRevision
asm gate and the Opus mach-0xeb check, not by the dispatch name. Build-time
(GPU_ARCHS=gfx1250-strict) and AOT replay keep the strict identity, so the asm
gate and strict codegen are unaffected.

Conflicts (fmha_kernels, gemm_op_a8w8, pa_sparse_prefill_opus) resolved to
main's refactor; the normalization covers strict there. Plan workstream-2
updated to reflect #6988.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
yuychang added a commit to yuychang/aiter that referenced this pull request Oct 27, 2026
- Resolve chip_info.py: keep the get_gfx_runtime.cache_clear shim and main's _parse_asic_revision (ROCm#6988) side by side
- get_asic_revision() still reads rocminfo/hipinfo agents; a missing tool now yields no agents and it raises as before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants