Skip to content

refactor(expr): move buffer_ops and split gfx1250 mcast policy to kernels.common#880

Merged
coderfeli merged 2 commits into
ROCm:mainfrom
Phil-amd:lhc/refactor-expr
Jul 23, 2026
Merged

refactor(expr): move buffer_ops and split gfx1250 mcast policy to kernels.common#880
coderfeli merged 2 commits into
ROCm:mainfrom
Phil-amd:lhc/refactor-expr

Conversation

@Phil-amd

Copy link
Copy Markdown
Member
- move expr/buffer_ops.py -> expr/rocdl/buffer_ops.py, drop root lazy alias
- migrate all call sites to `from flydsl.expr.rocdl import buffer_ops`
- split compute_mcast_masks() out of rocdl/cluster.py into kernels/common/gfx1250_cluster.py
- update optional-rocdl test, docs, and import paths

Co-Authored-By: Feng Shijie <Shijie.Feng@amd.com>

@Phil-amd
Phil-amd force-pushed the lhc/refactor-expr branch 2 times, most recently from 7273ad8 to bfe30ce Compare July 23, 2026 05:35
@Phil-amd Phil-amd changed the title refactor(expr): move buffer_ops to expr.rocdl; split gfx1250 mcast policy to kernels.common refactor(expr): move buffer_ops to kernel.common; split gfx1250 mcast policy to kernels.common Jul 23, 2026
@Phil-amd Phil-amd changed the title refactor(expr): move buffer_ops to kernel.common; split gfx1250 mcast policy to kernels.common refactor(expr): move buffer_ops and split gfx1250 mcast policy to kernels.common Jul 23, 2026
@Phil-amd
Phil-amd force-pushed the lhc/refactor-expr branch from bfe30ce to faac4f1 Compare July 23, 2026 07:00
Phil-amd and others added 2 commits July 23, 2026 16:20
… remove expr/vector.py

Reconcile ROCm/FlyDSL PR ROCm#853 onto current main: relocate buffer_ops to
kernels.common, delete expr/vector.py with a full vector migration to raw
_mlir.dialects.vector + as_ir_value, adopt the tdm_ops raw-vector cleanup, and
update __init__/docs/tests. Also covers upstream-added/relocated files ROCm#853's
stale base missed (flash_attn_utils, rmsnorm_bwd_kernel, common/mma helpers).

Co-Authored-By: Feng Shijie <Shijie.Feng@amd.com>
…250_cluster

Move the gfx1250 MCAST workgroup-mask policy out of expr/rocdl/cluster.py into
kernels/common/gfx1250_cluster.py (it is kernel policy, not a ROCDL primitive)
and point the gfx1250 gemm/moe call sites and tdm tests at the new module.
@Phil-amd
Phil-amd force-pushed the lhc/refactor-expr branch 2 times, most recently from ab5aa59 to be5a37b Compare July 23, 2026 08:45
@Phil-amd Phil-amd closed this Jul 23, 2026
@Phil-amd Phil-amd reopened this Jul 23, 2026
@coderfeli
coderfeli merged commit 7dac082 into ROCm:main Jul 23, 2026
16 of 20 checks passed
coderfeli pushed a commit that referenced this pull request Jul 24, 2026
#880 moved buffer_ops out of flydsl.expr into kernels.common; the fused
mxfp_moe kernels (added after #880) still imported it from flydsl.expr,
breaking a fresh-build import (CI). Point mxfp4_gemm_common at
kernels.common.buffer_ops (same API: get_element_ptr /
create_buffer_resource_from_addr). Local venv is pre-#880 so this was
masked locally.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xudoyuan added a commit that referenced this pull request Jul 24, 2026
PR #880 moved buffer_ops to kernels/common and dropped the flydsl.expr alias, so
neither fx.buffer_ops nor 'from flydsl.expr import buffer_ops' resolves on main.
Write outputs with plain tensor subscripting (Out[i] = val), matching the other
system tests (e.g. test_while_e2e) and dropping the buffer_ops dependency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
loctxmoreh added a commit to loctxmoreh/FlyDSL that referenced this pull request Jul 24, 2026
Upstream 0.3.0 (19 commits, ROCm#893 version bump). Conflicts, all resolved keeping
the gfx90a logic:

- flash_attn_generic.py / flash_attn_utils.py: upstream added a gfx942 async-DMA
  opt-in and re-widened `has_lds_load_b128` to `not gfx942`. Kept the gfx90a-correct
  `startswith("gfx950")` test (b128 buffer_load_dwordx4_lds is CDNA4-only; on gfx90a
  it aborts the AMDGPU backend) and layered upstream's gfx942 opt-in on top, so
  gfx90a takes neither path.
- hgemm_splitk.py / splitk_hgemm.py: import-only conflict; kept `is_cdna4` alongside
  upstream's relocated `kernels.common.buffer_ops`.

One non-conflict fixup the merge required: ROCm#880 moved `expr/buffer_ops.py` to
`kernels.common`, which `expr/rocdl/atomic.py` imported for `extract_base_index`.
`expr/` must not import from `kernels/`, so the base-address extraction is now
inlined in `atomic.py` using the same fly/memref primitives `expr/rocdl/tdm_ops.py`
already uses.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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