Skip to content

[LinalgExt] Rename map_gather/map_scatter -> map_load/map_store#23481

Merged
Groverkss merged 2 commits intoiree-org:mainfrom
Groverkss:map_loadmap_store
Feb 24, 2026
Merged

[LinalgExt] Rename map_gather/map_scatter -> map_load/map_store#23481
Groverkss merged 2 commits intoiree-org:mainfrom
Groverkss:map_loadmap_store

Conversation

@Groverkss
Copy link
Contributor

@Groverkss Groverkss commented Feb 16, 2026

"gather" "scatter" are wrong names for these ops. These are just mapped load/stores.

Map Gather / Scatter do something like:

for i in range(0, M):
  for j in range(0, N):
    read[i, j] = mem[fun(i, j)]

Where fun is a mapping from the iteration space to the memory domain. This is not a gather.

A gather / scatter is:

for i in range(0, M):
  for j in range(0, N):
    read[i, j] = mem[idx0[i, j], idx1[i, j]]

The main difference is that map_gather/map_scatter define a static mapping from the iteration space to the memory domain. gather/scatter actually represent a dynamic mapping (passed as input).

The naming change is done so we can eventually have proper mapped gather / mapped scatter loads:

for i in range(0, M):
  for j in range(0, N):
    s0 = idx0[i, j]
    s1 = idx1[i, j]
    read[i, j] = mem[fun(i, j, s0, s1)]

Allowing us to do partially statically mapped and partially dynamically mapped loads.

Co-Authored-By: Claude Opus 4.6 [email protected]

@Groverkss Groverkss marked this pull request as ready for review February 16, 2026 12:13
@ScottTodd ScottTodd removed their request for review February 16, 2026 19:13
@hanhanW
Copy link
Contributor

hanhanW commented Feb 22, 2026

I'm happy to approve if you can point me to the discussion and the conclusion. (I'm back from vacation and slowly catching up the things.)

@Groverkss
Copy link
Contributor Author

I'm happy to approve if you can point me to the discussion and the conclusion. (I'm back from vacation and slowly catching up the things.)

Discussion: https://discord.com/channels/689900678990135345/1254843174111678555/1471278955800825959

Copy link
Contributor

@hanhanW hanhanW left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

cc @Abhishek-Varma who works on map_load ops.

@Groverkss Groverkss enabled auto-merge (squash) February 24, 2026 06:43
@Groverkss Groverkss merged commit 047bde7 into iree-org:main Feb 24, 2026
52 of 56 checks passed
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.

5 participants