Skip to content

[AMDGPU][Docs] Introduce "lds-dma" as a symbolic scope - #4758

Open
ssahasra wants to merge 1 commit into
users/ssahasra/async-dma-barriersfrom
users/ssahasra/lds-dma-scope
Open

ssahasra wants to merge 1 commit into
users/ssahasra/async-dma-barriersfrom
users/ssahasra/lds-dma-scope

Conversation

@ssahasra

@ssahasra ssahasra commented Oct 1, 2026 •

Copy link
Copy Markdown


[This section is informational.]

The symbolic mapping of "lds-dma" scope affects how the _mutually inclusive_

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is the term "mutually inclusive" used somewhere? It looks as if it was a fixed term, but the memory model only talks about "inclusive scopes"

`Y` initiated from the same workgroup instance. On a target that performs DMA
operations at "cluster" scope, `Y` does not belong to any "workgroup" instance.
Thus `X` and `Y` do not have inclusive scope on this target even though they are
both associated with the same workgroup instance. If the same program is

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What does "associated with" here mean, is that intentionally left vague?

"workgroup".

Consider an operation `X` that specifies "workgroup" scope, and a DMA operation
`Y` initiated from the same workgroup instance. On a target that performs DMA

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should every occurrence of "DMA" in this paragraph be "LDS DMA"? (and maybe later occurrences as well?)

call @llvm.amdgcn.asyncmark()
call @llvm.amdgcn.wait.asyncmark(0)
%val = call @llvm.amdgcn.av.load.b128(%global, "lds-dma") ; <--
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe a note stating that that's not necessary for the LDS side would be helpful?


A similar pattern is required with a DMA operation that writes to global memory.

```llvm

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Interesting point: if that thread writes something to %global (program-ordered-) before the global.store.async.from.lds call, you'd also need to make that available to lds-dma scope to establish a location-order that rules out a data race between the previous write and the store part of the async operation. Or should that be implicit in the global.store.async.from.lds operation?

%val = load ptr addrspace(1) %global
```

Note how the acquire fence is used to establish visibility; it's ability to

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Note how the acquire fence is used to establish visibility; it's ability to
Note how the acquire fence is used to establish visibility; its ability to


The AMDGPU backend further refines the LLVM scopes with the following
target-defined scopes and constraints:
The AMDGPU target defines the following LLVM scopes:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
The AMDGPU target defines the following LLVM scopes:
The AMDGPU target defines the following scopes:

- If `S1` is a subscope of `S2`, then every instance `I1` of `S1` is a subset of
some instance `I2` of `S2`. `I1` is said to be a *subscope instance* of `I2`.
- If two scope instances `I1` and `I2` intersect, then their intersection is
the smaller of `I1` and `I2`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like that these are now presented as general properties of scopes.

Comment on lines +107 to +108
to*, as well as every scope instance `I2` such that `I1` is a *subscope
instance* of `I2`.

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 part about subscope instances is redundant with the subscope instance definition above, right?

This affects how operations are related in *inclusive scopes* when determining
availability and visibility. For example, {ref}`DMA
operations<amdgpu-dma-memmodel>` require {ref}`explicit availability and
visibility<amdgpu-dma-visibility>` operations at scopes below the corresponding

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why "below"? Depending on how you interpret that sentence, "above" would make more sense. But maybe "...at the corresponding "lds-dma" scope." would be clearer?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants