[PATCH] D124981: [AMDGPU] Enable WQM if demotes and softwqm are combined

Ruiling, Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 19:56:19 PDT 2022


ruiling added a comment.

In D124981#3501190 <https://reviews.llvm.org/D124981#3501190>, @nhaehnle wrote:

> softwqm is used by our implementation of subgroup operations: **if** helper invocations are there, **then** subgroup operations must interact with them.
>
> Helper invocations exist in one of two cases:
>
> 1. There are "hardwqm" instructions (e.g. sampler).
> 2. Invocations are explicitly demoted.

There are possible two sources of helper invocations:

1. A quad may have pixels not covered by current primitive
2. An active invocation is demoted into helper invocation.

Normally we don't activate helper invocations to optimize for memory bandwidth/power. But if graphics specification require implementation has defined behavior that need helper invocation's participation for certain shader operations, then we have to turn on the helper invocations, we need to place a non-soft wqm. My understanding of the working logic is: it is the observer(image sample, derivative, subgroupQuad operation) to decide whether we should turn on the helper invocations for a quad with at least one active invocation. My understanding of soft_wqm (a kind of weak observer) is let other strong observer to decide whether we should turn on wqm. I guess we are making this change to fix subgroupQuad*** issue, under which I believe we need a non-soft wqm. I did not follow all the details of how demote was implemented, so please correct me if I misread the change. But I still think that if there is no strong observer (hard-wqm), don't enable wqm. If an operation really need to be executed under wqm, then it should use hard-wqm.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124981/new/

https://reviews.llvm.org/D124981



More information about the llvm-commits mailing list