Skip to content

[OPUS] [JIT] Exp/mx32 plain - #5778

Open
yzhou103 wants to merge 8 commits into
ROCm:mainfrom
yzhou103:exp/mx32-plain
Open

yzhou103 wants to merge 8 commits into
ROCm:mainfrom
yzhou103:exp/mx32-plain

Conversation

@yzhou103

@yzhou103 yzhou103 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

DeepSeek-V4/V4.1 runs batched MXFP8 GEMMs with row-major (non-preshuffled) weights on gfx950 at three weight-scale granularities: 128x128, 32x32 and 1x32 (one e8m0 scale per row per 32 K). The Opus row-major BMM entry had these gaps:

  • No 1x32 kernel at all.
  • No 32x32 twin of the pipeline family, where the large-M wins are, so large-M 32x32 shapes fell back to flatmm at about half the throughput.
  • The 256x256 pipeline was capped at K <= 8192.
  • No compact (LDS-staged) tile for row-major B, so mid-M 128x128 shapes were underserved.
  • Several silent-wrong-result holes: unaligned N/K, the scale-ring lifetime, partial M-panel remapping, and direct-only kids handed split-K.

Technical Details

New scale granularities

  • 1x32 (GROUP_N=1, GROUP_K=32): flatmm twins of every tile that has a 32x32 twin (kids 98xx), plus pipeline kids 9891-9896. A 1x32 B scale is B_N rows, as large as the A panel: 9891-9893 preload only A and read B per lane from global, while 9894-9896 slide a B panel alongside the A window.
  • 32x32 pipeline twins: 9150 and 9158, the latter with the B-scale panel staged in LDS.
  • Tuned-table key: rows are keyed on w_scale_block (128x128, 32x32, 1x32). Legacy CSVs without the column load as 128x128.

Long K

  • New kids 8157 and 9157 slide both scale panels along K, so the pipeline has no K ceiling. 8158's footprint at K <= 8192 is unchanged.
  • The paired 256x256 pipeline now refuses odd K-tile counts instead of producing wrong output.

Row-major compact tiles (a8w8_mxscale_bmm_compact, kids 8470-8476, 8483, 8484)

  • Row-major-B twins of the bpreshuffle compact tiles. B reuses A's LDS swizzle.
  • A, scale and Y addressing are stride-generic, so both token-major [M,G,K] and batch-major [G,M,K] views run without a copy.
  • Limits: M < 2048, batch <= 16, 128x128 scale blocks only.

Dispatch and policy

  • The untuned heuristic picks the tile and split-K from output size and K, and sizes the tile for M < 64.
  • The C++ entry now checks each kid's M/N/K tile alignment from the generated per-kid table. Previously an unaligned N/K read past the row and returned wrong results silently.
  • Unknown kids raise a catchable RuntimeError instead of SIGABRT.
  • Direct-only kids always go through the launch plan when split_k > 1, even with a caller-owned workspace.

Correctness fixes in the pipeline

  • Scale-ring slots stay alive until their consumers finish.
  • Large B16 shapes interleave complete M panels within adjacent batch pairs. The remap is guarded so it applies only to complete panels.

DSV4 tuned table (dsv4_batched_gemm_a8w8_blockscale_mxscale_tuned.csv, 1044 rows: 352 at 128x128, 352 at 32x32, 340 at 1x32)

  • Retuned for all three blocks.
  • The 128x128 rows were retuned with the compact twins as candidates. The compact twins win 206 of 340 shapes, with same-session speedups of:
M Mean speedup Max speedup
17-128 1.05x 1.32x
129-1024 1.18x 1.89x
1025-2047 1.23x 1.73x

Test Plan

  • op_tests/test_opus_a8w8_bmm.py: every 32x32 and 1x32 twin, plus the row-major compact kids in token-major and batch-major layouts, against a dequantized fp32 reference. Also covers odd-K refusal and long K.
  • op_tests/test_opus_mxscale_regressions.py: scale-ring lifetime, workspace validation, and odd or partial M-panel traversal.
  • op_tests/test_opus_a8w8_interface.py and op_tests/tuning_tests/test_config_shape_collision.py: launch plan, policy, CSV key, legacy CSV, and direct-only split-K rejection (CPU only).
  • op_tests/test_batched_gemm_a8w8_mxscale_bpreshuffle.py: regression.
  • Table validation: load the merged DSV4 table through the policy and run a sample of its rows on the GPU against the reference.

Test Result

On MI355X (gfx950), after merging current main:

  • Interface tests: 71 passed.
  • test_opus_a8w8_bmm.py: passed, including 36 compact layout pairs.
  • bpreshuffle BMM: 23 passed.
  • DSV4 table: 50 sampled rows run with 0 failures.
  • The public path gives the same result as the kid 8000 baseline.
  • black and ruff are clean.

Submission Checklist

@yzhou103
yzhou103 requested review from a team and a lite review from Copilot September 23, 2026 05:15
@github-actions github-actions Bot changed the title Exp/mx32 plain [OPUS] Exp/mx32 plain Sep 23, 2026
@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; main branch always runs both MI35X and MI300X
multigpu 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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 5778 --add-label <label>

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 opt this PR out.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical LDS synchronization, scale-buffer bounds, and error-handling issues remain, along with moderate dispatch and tuning compatibility issues.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 High severity · 2 Medium severity

Open (5)
What changed in this PR

Extends gfx950 OPUS MXFP8 BMM support from 128-element to 32-element quantization blocks.

Changes:

  • Adds GROUP32 kernels, dispatch metadata, validation, and scale addressing.
  • Updates LDS pipeline/ring handling and split-K support.
  • Makes tuning and CSV schemas group-size aware.
  • Adds MX32 correctness coverage.
File Summary and final findings
op_tests/​test_opus_a8w8_bmm.py Adds MX32 tests. Nit: vary independent 32-wide blocks in _block_varied; add an MX32 N=1024 padding/ring-bound test.
csrc/​opus_gemm/​opus_gemm_common.py Registers MX32 kernel variants.
csrc/​opus_gemm/​opus_bmm.cu Adds group-aware dispatch. Critical: enable throwing before unknown-kid lookup to avoid process aborts.
csrc/​opus_gemm/​opus_bmm_mxscale_tune.py Adds group-aware tuning. Moderate: include groupSize in untuned rows so existing tuned shapes are skipped correctly.
csrc/​opus_gemm/​include/​gfx950/​opus_gemm_traits_a8w8_scale_gfx950.cuh Adds MX32 scale traits. Moderate: reserve ring capacity only for preload specializations.
csrc/​opus_gemm/​include/​gfx950/​opus_gemm_pipeline_a8w8_scale_gfx950.cuh Updates scale loading and sliding panels.
csrc/​opus_gemm/​include/​gfx950/​opus_gemm_pipeline_a8w8_mxscale_flatmm_splitk_gfx950.cuh Implements MX32 split-K scale handling. Critical: compute descriptor bounds from the shifted remaining buffer for both scale buffers.
csrc/​opus_gemm/​include/​gfx950/​opus_bmm_pipeline_a8w8_mxscale_gfx950.cuh Adds MX32 BMM pipeline logic. Critical: drain LDS reads before sliding-panel overwrite. Nit: correct the documented sliding-window limit and refill behavior.
csrc/​opus_gemm/​include/​gfx950/​opus_bmm_launchers_a8w8_mxscale_gfx950.cuh Adds group-aware shape checks.
csrc/​opus_gemm/​gen_instances.py Generates group-specific kernel metadata.
aiter/​ops/​opus/​policy.py Adds group-size tuning lookup. Moderate: thread group_size through automatic plan resolution; preserve or intentionally reject legacy CSVs missing groupSize.
aiter/​ops/​opus/​gemm_op_a8w8.py Adds per-kid Python validation.
aiter/​configs/​model_configs/​dsv4_batched_gemm_a8w8_blockscale_mxscale_tuned.csv Updates tuned configuration schema.
aiter/​configs/​model_configs/​dsv4_batched_gemm_a8w8_blockscale_mxscale_bpreshuffle_tuned.csv Updates bpreshuffle configuration schema.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

// and the price of the slide. Once per SFA_TILES_RESIDENT tiles, so at
// K=4096 and GROUP_K=32 that is twice in a 32-tile loop.
auto sfa_slide = [&](int first) {
__builtin_amdgcn_s_barrier();
Comment on lines +578 to +581
const unsigned int sfb_groups_avail =
(unsigned int)(ceil_div(kargs.n, T::GROUP_N) - col / T::GROUP_N);
const unsigned int sfb_bytes =
sfb_groups_avail * (unsigned int)kargs.stride_sfb * sizeof(D_SF);
Comment thread csrc/opus_gemm/opus_bmm.cu Outdated
// The kid's scale blocks, so the check knows which shape to demand. Looked up
// before the arch gate because a wrong-shaped scale is worth reporting on any
// device, and the table is compile-time data rather than a kernel.
const auto groups = opus_bmm_mxscale_kid_groups(kid);
Comment thread aiter/ops/opus/policy.py Outdated
n: int,
k: int,
*,
group_size: int = 128,
Comment thread csrc/opus_gemm/opus_bmm_mxscale_tune.py Outdated
}

KEYS: ClassVar[list[str]] = ["gfx", "b", "m", "n", "k"]
KEYS: ClassVar[list[str]] = ["gfx", "b", "m", "n", "k", "groupSize"]
Copilot AI review requested due to automatic review settings September 23, 2026 05:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// 2/CU and hangs every time, b=2 m=1024 is 512 and never did. That is
// also why it looked intermittent from the perf sweep, and why it hung
// there on 09c52c8a16 as well: the protocol is unchanged from upstream.
__builtin_amdgcn_s_barrier();
Comment thread aiter/ops/opus/policy.py Resolved
Copilot AI review requested due to automatic review settings September 23, 2026 08:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opus::static_for<T::SF_RING_A_BYTES / CHUNK>([&](auto c_c) {
constexpr int c = decltype(c_c)::value * CHUNK;
const int idx = c + wave_base + lane_off;
async_load<VEC>(g_sfa, slot + c + wave_base,
Comment thread aiter/ops/opus/policy.py Resolved
Comment on lines +441 to +442
static constexpr int prefetch_k_iter =
max_lds_size_per_wg / (per_block_iter_lds_size + (SF_USE_RING ? SF_RING_SLOT : 0));
@zufayu

zufayu commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

@aiter-bot review

zufayu added a commit that referenced this pull request Sep 23, 2026
…imeouts)

Large-diff reviews (e.g. #5778, +1544/-339, 14 files) timed out: the GLM worker
was killed at the 1000s agent timeout on every attempt, so no card was produced.

Two fixes:
1. 1000s (16.7min) is too short for a large diff (GLM generation has high
   thinking-chain variance). Raise AITER_AGENT_TIMEOUT to 2400s (40min).
2. run_agent retried on ANY failure including a timeout, but retrying a slow
   generation just burns another full window. Now a timeout (exit 124) is not
   retried; only a transient failure (dropped connection / 5xx) is, up to
   AITER_REVIEW_RETRIES attempts. Envelope stays bounded: the timeout path is
   one 40min attempt per agent (worker + refuter = 80min worst), under the job
   cap, raised 90 -> 120min for headroom.

40min is a reasoned starting point; override per-run via the env vars.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@aiter-bot

aiter-bot commented Sep 23, 2026 •

Copy link
Copy Markdown

⚠️ aiter-bot — this review could not complete: a problem with the GLM model service, not with this PR.

the GLM worker failed after retries -- the backend is timing out or down

Triage: if GLM serves but its output is malformed it may be the ATOM framework (@valarLip); if the box, GPU, disk or network is unhealthy it may be the machine (@gyohuangxin).

Re-comment @aiter-bot review once it is resolved.

@yzhou103
yzhou103 marked this pull request as draft September 23, 2026 09:41
gyohuangxin pushed a commit that referenced this pull request Sep 23, 2026
…imeouts) (#5785)

Large-diff reviews (e.g. #5778, +1544/-339, 14 files) timed out: the GLM worker
was killed at the 1000s agent timeout on every attempt, so no card was produced.

Two fixes:
1. 1000s (16.7min) is too short for a large diff (GLM generation has high
   thinking-chain variance). Raise AITER_AGENT_TIMEOUT to 2400s (40min).
2. run_agent retried on ANY failure including a timeout, but retrying a slow
   generation just burns another full window. Now a timeout (exit 124) is not
   retried; only a transient failure (dropped connection / 5xx) is, up to
   AITER_REVIEW_RETRIES attempts. Envelope stays bounded: the timeout path is
   one 40min attempt per agent (worker + refuter = 80min worst), under the job
   cap, raised 90 -> 120min for headroom.

40min is a reasoned starting point; override per-run via the env vars.

Co-authored-by: zufayu <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
@zufayu

zufayu commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

@aiter-bot review

@aiter-bot

Copy link
Copy Markdown

[ROCm/aiter] PR #5778 — [OPUS] Exp/mx32 plain

Adds 32-element-block ("MX32") twins of the gfx950 OPUS MXFP8 batched-GEMM kernels — per-lane scale addressing, byte-budgeted LDS scale panels/rings, kid-specific scale-shape checks, and a groupSize column in the tuned CSV — next to the unchanged 128-block paths.

Review (advisory): ⚠️ NEEDS WORK
Validation (deterministic): NOT RUN — REVIEW_AUTO_VALIDATE=0; the target op_tests/test_opus_a8w8_bmm.py exists but auto-validation is disabled, and this box has no gfx950 or torch to run it by hand (environment gap, not a PR defect)
Perf (advisory): NOT RUN — no gfx950 on this box (gfx942 only, no torch env); the target ships a timing harness but it could not run here

🔴 [verified] aiter/ops/opus/policy.py:616-619 makes the groupSize column mandatory and re-keys every tuned row on six columns (policy.py:681-686), which deterministically breaks two existing collected tests — op_tests/test_opus_a8w8_interface.py:253-254 writes a legacy fixture CSV with no groupSize and now gets ValueError instead of a warning-and-heuristic, and that file runs in the Aiter Test workflow on every PR — and op_tests/tuning_tests/test_config_shape_collision.py:241,246 asserts the old 5-tuple key and now gets KeyError; worse, any user-tuned CSV pointed at by AITER_CONFIG_BATCHED_GEMM_A8W8_BLOCKSCALE_MXSCALE raises on every mxscale BMM call after upgrade, where the repo's own precedent (get_CKBatchedGEMM_config's legacy gfx-column fallback) warns and adapts. Author must accept a groupSize-less CSV as groupSize=128 (or migrate both tests and ship a migration note for tuned-CSV users), and add the ci:all label so this serving-path change is exercised downstream before merge.
⚠️ [verified] aiter/ops/opus/policy.py:690-696 adds a group_size kwarg that no caller ever passes — resolve_a8w8_mxscale_bmm_plan (policy.py:767) and the public batched_gemm_a8w8_mxscale entry resolve 128-block kids only — so the 158 new 32-block tuned rows are unread data, and a caller arriving with 32-block scales gets a 128 kid that the C++ shape check rejects at launch; the MX32 kernels are reachable only via an explicit kid to opus_bmm, and the PR description (an unfilled template) names no consumer. Author must thread group_size through the plan resolver and the public entry, or state which consumer passes the explicit 9xxx kids.
⚠️ [verified] csrc/opus_gemm/opus_bmm.cu:84 looks the kid up in opus_bmm_mxscale_kid_groups before opus_bmm_a8w8_common_checks sets g_aiter_can_throw=true, so an unknown kid reaching the launch on a thread's first call now aborts the process (aiter_hip_common.h:59-63) where the old code threw a catchable RuntimeError from the dispatch table; the public opus_bmm route pre-validates the kid, so the window is the private raw op or a C++ caller, but the failure mode in a serving process is a hard abort. Author must move the lookup after the common checks, or set g_aiter_can_throw=true inside opus_bmm_mxscale_kid_groups, so an unknown kid throws.
⚠️ [verified] No base-vs-head timing exists for this kernel change: op_tests/test_opus_a8w8_bmm.py ships the timing harness, but the PR's only perf evidence is the tuner-written CSV plus "measured" numbers in comments (86 vs 34 v_mul_lo_u32, a 46% stall, 1891→1793 TFLOPS) that trace to no attached output, the 128-block rows are re-committed byte-identical rather than re-measured, and the Test Plan/Test Result sections are template comments. Author must run the target base-vs-head on a gfx950 box and attach the numbers, or mark the 128-path no-regression claim unverified.
📝 [verified] The b_ready flag protocol in csrc/opus_gemm/include/gfx950/opus_gemm_pipeline_a8w8_mxscale_flatmm_splitk_gfx950.cuh is replaced by s_barrier among the surviving waves for the pre-existing 128-block kid 8646 and its MX32 twin, but check_mx32_kids exercises it only at b=2/m=128 (8 workgroups) while the hang being fixed needed ~8192 workgroups to reproduce, and no sweep log for 8646/9646 is attached. Reviewer should ask for one large-grid run (b=4, m=16384) of kid 8646 and its twin to confirm the barrier protocol holds at the scale where the old one died.

@yzhou103
yzhou103 marked this pull request as ready for review September 24, 2026 10:07
Copilot AI review requested due to automatic review settings September 24, 2026 10:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread aiter/ops/opus/policy.py Outdated
Comment on lines 681 to 682
shape_keys = ["gfx", "b", "m", "n", "k", "groupSize"]
duplicate_shapes = df.duplicated(subset=shape_keys, keep=False)
Comment on lines +568 to +569
g_sfa.template async_load<VEC>(s_sfa_ptr + idx,
m * kargs.stride_sfa + col0 + kt);
Comment on lines +625 to +631
// Scale reads trail the A/B register prefetch by one barrier. Keep
// one extra scale slot so a producer cannot overwrite scales still
// needed by a consumer after releasing the corresponding A/B slot.
constexpr int SF_RING_SLOTS = T::prefetch_k_iter + 1;
constexpr int SF_LDS_ELEMS =
PRELOAD_SF_LDS ? ((SFA_ROWS + T::N_SCALE_GROUPS) * SF_SCALES_MAX) : 1;
SF_PANEL ? ((SFA_ROWS + T::N_SCALE_GROUPS) * SF_SCALES_MAX)
: (SF_RING ? SF_RING_SLOTS * T::SF_RING_SLOT : 1);
Comment thread csrc/opus_gemm/opus_bmm_mxscale_tune.py Outdated
Comment on lines +514 to +519
self.parser.add_argument(
"--groupSize",
type=_intlist,
default=None,
help="only tune kids with these quantisation block sizes "
"(e.g. 32); default is every group in the policy",
Copilot AI review requested due to automatic review settings September 24, 2026 10:39
@github-actions github-actions Bot changed the title [OPUS] Exp/mx32 plain [OPUS] [JIT] Exp/mx32 plain Sep 24, 2026
@github-actions github-actions Bot added the JIT label Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Comment on lines +190 to +192
constexpr int NG = T::SFB_GROUPS_PER_HALF;
constexpr int SPK = T::SF_LANE_SCALES_PER_BK;
constexpr int NG_ROWS = T::SFB_PER_LANE_ROW ? T::T_N * T::W_N : 1;
Copilot AI lite review requested due to automatic review settings October 23, 2026 08:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread aiter/ops/batched_gemm_op_a8w8.py Resolved
Comment on lines +467 to +469
if instance is not None and (
split_k <= 1 or (workspace is not None and not instance.direct_only)
):
Copilot AI lite review requested due to automatic review settings October 23, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot AI lite review requested due to automatic review settings October 24, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread aiter/ops/opus/policy.py
Comment on lines +1143 to +1145
if w_scale_block == "1x32":
return _heuristic_mxscale_bmm_1x32_kid(g, m, n, k)
offset = 1000 if group_size == 32 else 0
Comment on lines +168 to 171
auto ga32 = make_gmem((const unsigned int*)k.ptr_sfa + batch * (k.ssb / 4),
(unsigned int)((k.m - 1) * k.ssm + scale_k));
auto gb32 = make_gmem((const unsigned int*)k.ptr_sfb + (size_t)batch * (N / 128) * scale_words,
(unsigned int)((N / 128) * scale_k));
Comment on lines +1872 to +1877
# Row-major B twins of the compact tiles: same schedule, B staged through LDS
# like A. Local ids 461-469 mirror 470-476, 483, 484.
_BMM_COMPACT_ROW_B_TWINS = {
461: 470, 462: 471, 463: 472, 464: 473, 465: 474,
466: 475, 467: 476, 468: 483, 469: 484,
}
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

No activity for 15 days, so this is now labelled stale. A push or a comment clears it; keep-open exempts it. Nothing is closed automatically.

@github-actions github-actions Bot added the stale The PR hasn't been updated in 2 weeks label Nov 9, 2026
Resolve the quant config, policy, registry, codegen and launcher conflicts
while retaining main's gfx/CU-scoped local IDs and exception guard. Assign
separate local IDs to the PR's row-major compact, 1x32 and long-K kernels
and translate the 1044 DSV4 tuning rows by their existing kernel symbols.
Preserve the PR's dispatch policy, scale-ring fixes and shape validation.

Update CPU fixtures to the scoped catalog and shared scale validation.
Select compact test kernels by tag so ID migration cannot leave an empty
coverage range. No hipBLASLt tuning results are added.

Validation on gfx950: 104 interface/config tests and 2 subtests; 24
registry/policy tests and 120 subtests; BMM numerical regressions including
89 group32 kernels, 33 row-major 1x32 kernels, long-K and split-K paths;
36 compact layout pairs; 23 bpreshuffle tests. Codegen, Black and Ruff pass.
Copilot AI lite review requested due to automatic review settings November 11, 2026 07:52
@aiter-bot

aiter-bot commented Nov 11, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision fe9250091526 · mode shadow

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

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which architecture, dtype and shape boundaries select the changed kernel path, and what invariant prevents unsupported inputs from reaching it?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer
  • FAIL — changed op test not explained in Changed op tests: op_tests/test_opus_a8w8_bmm.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/test_opus_a8w8_interface.py
  • FAIL — changed op test not explained in Changed op tests: op_tests/tuning_tests/test_config_shape_collision.py
  • FAIL — Changed op tests must explain why each changed op test is necessary and non-redundant

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread aiter/ops/opus/policy.py
Comment on lines +877 to +881
if m < 64:
if m <= 16 or (m <= 48 and e < 1 << 16):
kid = 70
elif m <= 32:
kid = 72

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked against fe92500. These examples match the current tests:

  • (2,1,1024,4096) selects (kid, splitK) = (70,1) for 128x128 and (1070,1) for 32x32. The 140/1140 expectation in test_mxscale_untuned_group_fallback is for (2,1,64,256), not this shape.
  • (4,64,512,16384) enters the k >= 8192 branch and selects (144,8) / (1144,8), matching test_mxscale_untuned_split_k_fills_cus.

The 36 parameter combinations in these two tests match. A fresh run of python -m pytest -q op_tests/test_opus_a8w8_interface.py op_tests/tuning_tests/test_config_shape_collision.py completed with 104 passed, 2 subtests passed. No heuristic change was needed for this comment.

Comment on lines +847 to +849
else sfa_async_fill(col0, number<4>{});
} else {
sfa_async_fill(col0, number<4>{});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the alignment premise on MI355X (gfx950, HIP 7.2 / AMD clang 22), using this PR's opus::gmem::async_load and the same full-panel address calculation (256 rows x 96 bytes, 512 threads).

The 4-byte path copied the expected bytes exactly with source row strides 513, 514 and 515, with a column offset of 93, and with a base-pointer offset of 1 byte. Aligned controls and three 16-byte cases also passed: 9 cases, 0 mismatched bytes out of 24,576 in every case. Disassembly confirms buffer_load_dword ... lds for the 4-byte path.

Thus the tested instruction does not produce incorrect data solely because the input address is not 4-byte aligned. No alignment restriction was added on that basis. This evidence is a native copy-primitive diagnostic, not a full strided-BMM validation or a performance claim; a failing BMM reproducer would warrant a separate investigation.

Comment thread op_tests/test_opus_a8w8_bmm.py Resolved
@github-actions github-actions Bot removed the stale The PR hasn't been updated in 2 weeks label Nov 12, 2026
Copilot AI lite review requested due to automatic review settings November 13, 2026 03:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Human validation is needed because the broad gfx950 CUDA changes span multiple kernel, LDS, dispatch, and generated-contract paths, while MI355X behavior and the base-versus-head GS128 regression comparison remain unverified.

25 open issues

And 5 more that still need to be addressed.

1 resolved since last review

Review effort: Lite

@yifehuan

Copy link
Copy Markdown
Contributor

This PR currently conflicts with main. Please rebase onto the current main branch, resolve the conflicts, and rerun CI so we can review the updated OPUS MX32 changes.

This branch has not been deployed

No deployments
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.

6 participants