Skip to content

Upstream sync 24/N: merge 49fb2ee348 [ROCm][CI] add Aiter ops tests (#52208) (conflict) - #1271

Merged
roberteg16 merged 4 commits into
rogarcia.merge-upstream-119from
rogarcia.merge-upstream-120
Sep 10, 2026
Merged

roberteg16 merged 4 commits into
rogarcia.merge-upstream-119from
rogarcia.merge-upstream-120

Conversation

@roberteg16

@roberteg16 roberteg16 commented Sep 7, 2026 •

Copy link
Copy Markdown

Context

Twenty-fourth step of the batched upstream catch-up. Stacked on #<batch 23 PR>.

Conflict-only step.

Merged upstream changes:

  1. 49fb2ee348 [ROCm][CI] add Aiter ops tests vllm-project/vllm#52208 — [ROCm][CI] add Aiter ops tests

Two hunks in vllm/_aiter_ops.py, both in AiterOps static methods.

Hunk 1 — rms_norm (plus a fork accessor caught in the same hunk)

ours:     def get_fused_qk_norm_mrope_kvcache_op() -> OpOverload:
              return torch.ops.vllm.aiter_fused_qk_norm_mrope_kvcache.default


            @staticmethod
            def rms_norm(x, weight, variance_epsilon):
                return torch.ops.vllm.rocm_aiter_rms_norm(x, weight, variance_epsilon)
  theirs:   def rms_norm(x, weight, epsilon):
                import aiter
                return aiter.rms_norm(x, weight, epsilon)
  resolved: def get_fused_qk_norm_mrope_kvcache_op() -> OpOverload:      <- ours
                return torch.ops.vllm.aiter_fused_qk_norm_mrope_kvcache.default

            @staticmethod
            def rms_norm(x, weight, epsilon):                            <- theirs
                import aiter
                return aiter.rms_norm(x, weight, epsilon)

Hunk 2 — rms_norm2d_with_add

ours:     return torch.ops.vllm.rocm_aiter_rmsnorm2d_fwd_with_add(
              x, residual, weight, variance_epsilon)
theirs:   import aiter
          out = torch.empty_like(x); residual_out = torch.empty_like(x)
          aiter.rmsnorm2d_fwd_with_add(out, x, residual, residual_out,
                                       weight, epsilon, 0)
          return out, residual_out
resolved: <theirs verbatim>

Audit

The fork's two implementations dispatch through torch.ops.vllm.* wrappers. Checked whether those wrappers exist, because a missing registration here is an AttributeError at first call rather than at import, and this file is ROCm-only so CI on other platforms would never reach it.

They do not exist. Against the built tree at batch 23 — i.e. before this merge:

register_ops_once(); hasattr(torch.ops.vllm, 'rocm_aiter_rms_norm')
  -> False
register_ops_once(); hasattr(torch.ops.vllm, 'rocm_aiter_rmsnorm2d_fwd_with_add')
  -> False

Neither name appears in the direct_register_custom_op block at _aiter_ops.py:2178-2440. So the fork's side was already broken; taking ours would have preserved two methods that raise on any call.

Upstream's versions call the aiter library directly and are exactly what the commit's new tests exercise — tests/kernels/core/test_rocm_aiter_ops.py:215 calls rocm_aiter_ops.rms_norm(x, weight, eps) and compares against a PyTorch reference. Taking theirs both fixes the dispatch and satisfies the new tests.

get_fused_qk_norm_mrope_kvcache_op is unrelated to either side — it only landed in the same hunk because it immediately precedes rms_norm — and is kept. Its op is registered, it is exercised by tests/rocm/aiter/test_fused_qk_norm_mrope_kvcache.py, and it is consumed by the qk-norm fusion pass; dropping it would have broken both.

py_compile, ruff check and ruff format pass on the merged file.

Merge commit only — do not squash or rebase.

AI assistance was used to prepare this merge.

Test plan

  • Both torch.ops.vllm.* targets proven absent at runtime on the pre-merge build — the fork's side could not have worked
  • Fork's get_fused_qk_norm_mrope_kvcache_op confirmed registered and tested before being retained
  • py_compile + ruff check + ruff format
  • pytest tests/kernels/core/test_rocm_aiter_ops.py — cannot run on gfx1151: require_aiter() gates on is_aiter_found_and_supported() = get_cdna_version() > 2, i.e. CDNA 3+. This board is RDNA 3.5, so all 12 tests skip by design (verified at runtime: is_aiter_found_and_supported() -> False). Needs MI3xx hardware; the rest of the suite (test_triton_scaled_mm.py) passes 61/61 against this wheel.
  • Build + 6-model benchmark sweep vs the Strix Halo dashboard — no regression on transformers 5.15.0, all six within the gate (results)

divakar-amd and others added 4 commits August 17, 2026 18:33
Signed-off-by: Divakar Verma <divakar.verma@amd.com>
…m-project#52208) (conflict)

Conflict-only step. Two hunks in vllm/_aiter_ops.py, both in AiterOps static
methods. Took upstream's implementations; kept the fork's unrelated accessor
that git had glued into the same hunk.

Hunk 1 - rms_norm (and the fork's qk_norm accessor caught up in it)

  ours:   def get_fused_qk_norm_mrope_kvcache_op() -> OpOverload:
              return torch.ops.vllm.aiter_fused_qk_norm_mrope_kvcache.default

          @staticmethod
          def rms_norm(x, weight, variance_epsilon):
              return torch.ops.vllm.rocm_aiter_rms_norm(x, weight, variance_epsilon)
  theirs: def rms_norm(x, weight, epsilon):
              import aiter
              return aiter.rms_norm(x, weight, epsilon)

Hunk 2 - rms_norm2d_with_add

  ours:   return torch.ops.vllm.rocm_aiter_rmsnorm2d_fwd_with_add(
              x, residual, weight, variance_epsilon)
  theirs: import aiter
          out = torch.empty_like(x); residual_out = torch.empty_like(x)
          aiter.rmsnorm2d_fwd_with_add(out, x, residual, residual_out,
                                       weight, epsilon, 0)
          return out, residual_out

The fork's two implementations dispatch through torch.ops.vllm.* wrappers.
Checked whether those wrappers exist, because a missing registration here is an
AttributeError at first call rather than an import error, and this file is
ROCm-only so CI on other platforms would never reach it. They do not exist:

  register_ops_once(); hasattr(torch.ops.vllm, 'rocm_aiter_rms_norm')
    -> False
  register_ops_once(); hasattr(torch.ops.vllm, 'rocm_aiter_rmsnorm2d_fwd_with_add')
    -> False

Verified against the built tree at batch 23, i.e. before this merge, so the
fork's side was already referencing unregistered ops - neither name appears in
the direct_register_custom_op block at _aiter_ops.py:2178-2440. Upstream's
versions call the aiter library directly and are what its new test exercises
(tests/kernels/core/test_rocm_aiter_ops.py:215 calls
rocm_aiter_ops.rms_norm(x, weight, eps) and compares against a PyTorch
reference), so taking theirs both fixes the dispatch and satisfies the tests the
commit adds.

get_fused_qk_norm_mrope_kvcache_op is unrelated to either side of the conflict -
it only landed in the same hunk because it directly precedes rms_norm - and is
kept. Its op IS registered and is exercised by
tests/rocm/aiter/test_fused_qk_norm_mrope_kvcache.py; dropping it would have
broken that test and the qk-norm fusion pass.

py_compile, ruff check and ruff format pass on the merged file.
@roberteg16
roberteg16 marked this pull request as ready for review September 8, 2026 10:12
@roberteg16
roberteg16 requested review from eble-amd and removed request for AndreasKaratzas September 8, 2026 10:12

@eble-amd eble-amd left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The conflict suggests that there might be other cruft remaining in our branch, but this merge LGTM on its own.

@roberteg16
roberteg16 added this pull request to stack #1288 September 10, 2026 05:59
@roberteg16
roberteg16 merged commit 17fcf0f into gfx11 Sep 10, 2026
10 of 15 checks passed
@roberteg16
roberteg16 deleted the rogarcia.merge-upstream-120 branch October 12, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants