Skip to content

update script - #3

Merged
valarLip merged 2 commits into
mainfrom
pa_1121_xxx
Nov 22, 2024
Merged

valarLip merged 2 commits into
mainfrom
pa_1121_xxx

Conversation

@carlushuang

Copy link
Copy Markdown
Collaborator

No description provided.

@valarLip
valarLip merged commit f18268b into main Nov 22, 2024
@valarLip
valarLip deleted the pa_1121_xxx branch December 12, 2024 15:52
@valarLip
valarLip restored the pa_1121_xxx branch December 12, 2024 15:52
@valarLip
valarLip deleted the pa_1121_xxx branch December 16, 2024 14:56
amd-youchen pushed a commit to amd-youchen/aiter that referenced this pull request Nov 25, 2025
* Update trtllm_all_reduce_fusion.py

* Update test_trtllm_all_reduce_fusion.py
poyenc added a commit to poyenc/aiter that referenced this pull request Feb 4, 2026
- Update Issue ROCm#2 with complete root cause analysis:
  - Bug occurs when (seqlen_k % 16) is in range [5, 11]
  - K positions 4-7, 20-23, 36-39, etc. not accumulated
  - Verified P is correct (K[pos]=0 changes output)
  - Verified V is not accumulated (V[K=4]=0 produces no change)
- Add Issue ROCm#3 for separate causal masking bug (seqlen≥256)
- Renumber V Tile Transpose bug to Issue ROCm#4
- Add complete test results for seqlen_k 1-64
- Include pattern diagram and verification test commands

Co-Authored-By: Claude Opus 4.5 <[email protected]>
poyenc added a commit to poyenc/aiter that referenced this pull request Feb 4, 2026
Root cause: P/V lane distribution mismatch in PV GEMM.
Fix: Use SwizzleB warp gemm for QK GEMM to align P distribution
with V tile distribution (8 contiguous K positions per lane).

Test results: 176/176 FP8 tests pass.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
valarLip added a commit that referenced this pull request Mar 18, 2026
@nidal567 nidal567 mentioned this pull request Apr 1, 2026
9 of 11 tasks
JohnNikolay84 pushed a commit that referenced this pull request Apr 2, 2026
JohnNikolay84 added a commit that referenced this pull request Apr 9, 2026
* Fix precision issue for 32x256, 64x128, 64x256 kernels silu and gelu variants
---------

Co-authored-by: Sergey Solo <[email protected]>
sunway513 pushed a commit that referenced this pull request Apr 21, 2026
* Fix precision issue for 32x256, 64x128, 64x256 kernels silu and gelu variants
---------

Co-authored-by: Sergey Solo <[email protected]>
Liang-jianhao97 pushed a commit that referenced this pull request Apr 30, 2026
* Fix precision issue for 32x256, 64x128, 64x256 kernels silu and gelu variants
---------

Co-authored-by: Sergey Solo <[email protected]>
anhminhnguyenhoang added a commit that referenced this pull request Jun 9, 2026
… fix

Refresh the optimization report and benchmark repro to the current kernel
(16x16x32 atom + XCD remap + bounded-A fix):
- §2 rewritten with the two-method comparison (do_bench cold-L2 + rocprofv3
  hot-L2, both autotune-excluded): FlyDSL wins 3 of 4 shapes (~5-6% ahead on both
  D=512 cells, tie-to-slightly-behind on B1024_D256 depending on L2 warmth).
- Added method lessons #3 (cold vs hot L2) and #4 (skew finding reversed on the
  current kernel) and reproduction subsections 4.5 (do_bench) / 4.6 (skew remap).
- §6 next-opportunities: XCD remap + gate marked done; fp8 weights flagged as the
  only decisive lever; confirmed dead-ends listed.

Co-Authored-By: Claude Opus 4 <[email protected]>
simondanielsson added a commit to simondanielsson/aiter that referenced this pull request Sep 9, 2026
simondanielsson added a commit to simondanielsson/aiter that referenced this pull request Sep 9, 2026
…ed completely if return_lse (ROCm#3 & ROCm#4)

Signed-off-by: simondanielsson <[email protected]>
valarLip pushed a commit that referenced this pull request Sep 11, 2026
…el for chunked prefill (#3606)

* fix(mla): always write partial output + LSE for prefill PS tiles

The PS scheduler in v1_2_host.cuh's generate_work_info tagged tiles
that a single threadgroup could absorb from block 0 with the sentinel
partial_o_loc = -1, causing generate_reduce_info to exclude them
from reduce_indptr / reduce_final_map / reduce_partial_map. As a
result mla_reduce_v1 never wrote final_lse[qo_start:qo_end, :] for
those tiles, leaving stale workspace bytes that downstream consumers
(vLLM's chunked-context MLA prefill on MI350) read as garbage LSE
and fed into merge_attn_states, causing a ~2-3pp gsm8k accuracy
regression on DeepSeek-V3.

Always assign a real partial_o_loc so every tile produces a partial
output + partial LSE that reduce processes (num_partials==1 for what
used to be the fast-path tiles). The kernel already supports this
path -- only the host scheduler needed changing; no assembly edits.

The if(work.partial_o_loc == -1) continue; guard in
generate_reduce_info is left in as defensive coding.

Mirrors PR #3542 ("[Triton-Gluon-MLA-GFX950] return_lse: full decode
+ merged fp32 lse"), which fixed the analogous bug in the
triton-gluon decode kernel's NUM_KV_SPLITS==1 fast path.

* fix: dont skip reduction of tiles with num_split==1

Signed-off-by: simondanielsson <[email protected]>

* fix: increase max_partial now that we support split tiles

Signed-off-by: simondanielsson <[email protected]>

* fix: compute the work and partial based on actual kv size

Signed-off-by: simondanielsson <[email protected]>

* fix: return final_lse instead of partial attn_lse from kernel wrapper

Signed-off-by: simondanielsson <[email protected]>

* test: add proper final lse validation test

Signed-off-by: simondanielsson <[email protected]>

* test: add non-causal chunk context to correctness test

Signed-off-by: simondanielsson <[email protected]>

* pass max_kvlen to correctness test

Signed-off-by: simondanielsson <[email protected]>

* fix: simplify comments

Signed-off-by: simondanielsson <[email protected]>

* fix: remove redundant comment

Signed-off-by: simondanielsson <[email protected]>

* fix: remove redundant handling of partial_o_loc=-1

Signed-off-by: simondanielsson <[email protected]>

* fix: simplify comment

Signed-off-by: simondanielsson <[email protected]>

* fix: indent

Signed-off-by: simondanielsson <[email protected]>

* fix: indentation

Signed-off-by: simondanielsson <[email protected]>

* fix: avoid running reduce when num_splits==0

Signed-off-by: simondanielsson <[email protected]>

* chore: add comment about fullgraphs

Signed-off-by: simondanielsson <[email protected]>

* fix: size without mxa kvlen

Signed-off-by: simondanielsson <[email protected]>

* chore: fix docstring

Signed-off-by: simondanielsson <[email protected]>

* fix: rename lse_ref in test

Signed-off-by: simondanielsson <[email protected]>

* fix: add need_lse flag

This avoid avoid unnecessary reduction when lse is not needed.

Signed-off-by: simondanielsson <[email protected]>

* chore: simplify comments

Signed-off-by: simondanielsson <[email protected]>

* fix: comment in get_ps_metadata_info_v1

Signed-off-by: simondanielsson <[email protected]>

* chore: restructure to minimzie diff

Signed-off-by: simondanielsson <[email protected]>

* fix: use qo_len in test when available instead of ctx_len

Signed-off-by: simondanielsson <[email protected]>

* chore: remove empty eol spaces

Signed-off-by: simondanielsson <[email protected]>

* fix: set max_partials to one per qo-tile + splits

Signed-off-by: simondanielsson <[email protected]>

* fix: set lower lse test tolerances

Signed-off-by: simondanielsson <[email protected]>

* fix: typo

Signed-off-by: simondanielsson <[email protected]>

* fix: set lse error atol to 3e-2 to be above the fp8 rounding onise

Signed-off-by: simondanielsson <[email protected]>

* chore: fix black erro

Signed-off-by: simondanielsson <[email protected]>

* fix: fill final_lse buffer with -inf (#3)

Signed-off-by: simondanielsson <[email protected]>

* fix: remove redundant asserts (#6)

Signed-off-by: simondanielsson <[email protected]>

* fix: include cassert in v1_2_host.cuh (#7)

Signed-off-by: simondanielsson <[email protected]>

* fix: add return_lse param and check that ensures final_lse is populated completely if return_lse (#3 & #4)

Signed-off-by: simondanielsson <[email protected]>

* fix: align flydsl reduce kernel with the cu variant

Signed-off-by: simondanielsson <[email protected]>

* chore: indent py bindings

Signed-off-by: simondanielsson <[email protected]>

* fix: convert asserts to AITER_CHECK

Signed-off-by: simondanielsson <[email protected]>

* fix: address comments about tests

Signed-off-by: simondanielsson <[email protected]>

* fix: add test cases to flydsl reduce to ensre parity

Signed-off-by: simondanielsson <[email protected]>

* fix: switch to int64 slot offsets

Signed-off-by: simondanielsson <[email protected]>

* fix: add test of aiter.mla.mla_prefill_ps_fwd python wrapper

Signed-off-by: simondanielsson <[email protected]>

---------

Signed-off-by: simondanielsson <[email protected]>
apinge added a commit to yicyang/aiter that referenced this pull request Sep 23, 2026
* Migrate Qwen3.5 asmjit MoE

* rename test file
zufayu pushed a commit that referenced this pull request Oct 14, 2026
…6405)

* [FlyDSL] Accelerate mxfp4 fmoe AOT tuning ~9x on gfx950

Clean replay of the fast-scan tuning fix from PR #3 onto current
upstream main, excluding the unmerged worker-policy fan-out.

- gemm_moe_tune: accuracy-aware fast scan for the FlyDSL mxfp4 a4w4
  tuner (--fast-scan): deduplicated parallel precompile, shared
  fixture/reference tensors, device-side cosine reduction, coarse
  scan -> latency finalists -> accuracy promotion -> ordered backfill,
  plus finalist summary. Non-mxfp4 tuners reject --fast-scan.
- aot/flydsl: optional start_method for the file pool; batch compile
  helpers in mxfp4_moe.
- mp_tuner: skip the 3s pid stagger when mp_num == 1.
- test_common: configurable profile_warm_iters for perftest.
- gen_instances: add GLM-5.3 / GLM-5.3-Flash / Qwen3-Coder-Next /
  Inkling / MiMo-V2.5-Pro shapes.
- Add glm53 fp4 tuned/untuned configs, fast-scan README section, and
  a CPU-only regression test for the scan funnel.

* [FlyDSL] Fix fast-scan reference clamp, drop dead funnel helper

Review fixes for the MXFP4 fast-scan tuning path:

- build the shared per-shape torch reference with the same
  AITER_MXFP4_TUNE_SWIGLU_LIMIT clamp that _run_candidate applies to the
  per-candidate reference and to the kernel launch; without it every
  candidate was rejected against an unclamped reference whenever the tuning
  limit was set
- remove the unused _rank_mxfp4_candidates timing-bucket helper (only its own
  test referenced it) and route the coarse finalist/backfill ordering through
  the tested _select_mxfp4_performance_finalists so production and tests share
  one ordering
- align the README funnel description with the actual finalist selection
- extend the CPU regression suite: shared-reference clamp propagation,
  kernel/reference clamp parity, and in-memory jobs_from_rows equivalence with
  parse_csv on the shipped GLM-5.3 tuned CSV

* [FlyDSL] Keep exact funnel error and precompile the tuned swiglu clamp

Review follow-ups on the MXFP4 fast scan:

- Prefer the raw `_err` ratio over the rounded err1/err2 percent strings when
  a finalist retime merges the coarse error, so a 1.1% display string can no
  longer round a candidate below a slower one with a true 0.01120.
- Apply AITER_MXFP4_TUNE_SWIGLU_LIMIT to the stage-1 precompile jobs, matching
  the runtime clamp. Without it every precompiled kernel missed the cache and
  the scan JITed while scoring.
- Add CPU-only regression tests for both paths and register the module in the
  tuning test split and the level 0+1 CI suite.
- Correct the README's profiler-sample and accuracy-bucket claims, and document
  the swiglu-limit contract.

* [FlyDSL] Restore repo-wide black and ruff cleanliness

The Checks workflow runs `black --check --diff .` (psf/black@stable, 26.10.1
today) and `ruff check .` (pinned 0.16.0) over the whole tree. main passes
both; this branch regressed them.

- black 26.10.1 collapses the hand-wrapped argument lists and conditions in
  gemm_moe_tune.py, mp_tuner.py and the new tuning test module, so the style
  gate failed on three files.
- ruff SIM115 flagged the conditional `open()` in parse_csv: choose the
  path-or-stream context manager inside the `with` statement instead of
  binding it first, so the file stays managed there.
- ruff SIM117 flagged two nested `with` blocks in the new tests; merge each
  pair into one multi-context `with` (identical semantics).

Validated: `black --check .` and `ruff check .` are clean at this head, and
op_tests.tuning_tests.test_fast_tuning still passes 24/24.

* Fix fast tuning test paths for direct CI execution

Signed-off-by: Qubitium <[email protected]>

---------

Signed-off-by: Qubitium <[email protected]>
echen4096 added a commit to echen4096/aiter that referenced this pull request Nov 20, 2026
…OCm#3)

Summary:

## Summary

`cvt_scalef32_2xpk16_fp6` in `csrc/kernels/mha_v4_quant.cu` now spells its vector types with two aliases, `f32x16_t` and `u32x6_t`, instead of writing `__attribute__((ext_vector_type(N)))` in its signature and body. The types and the generated code are unchanged.

## Motivation

Since ROCm#7173, `mha_v4_quant.cu` doesn't compile with the ROCm 7.0 compiler (AMD clang 20). That compiler accepts `ext_vector_type` only on a typedef or alias, so it rejects the attribute on the function's return type, its parameters and its local variable:

```
error: 'ext_vector_type' attribute only applies to typedefs
```

Newer clang accepts both forms. With the aliases, the file compiles with ROCm 7.0 as well as newer compilers. The rest of the file already declares its vector types with `using`.

## Changes

- Add `f32x16_t` and `u32x6_t` in the `__gfx950__` block and use them in `cvt_scalef32_2xpk16_fp6`.

## Testing

- Built `mha_v4_quant.cu` for gfx950 with the ROCm 7.0 compiler. It failed with the error above before this change and compiles with it.
- The types and the inline assembly are the same.

Test Plan: Built AITER for MI350 (gfx950) with the ROCm 7.0 HIP compiler and `mha_v4_quant.cu` included: it failed with "'ext_vector_type' attribute only applies to typedefs" before this change and compiles with it.

Differential Revision: D133345530
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.

2 participants