[llvm] [Docs] Improve the description of convergence (PR #89038)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 06:34:11 PDT 2024


================
@@ -10,34 +10,61 @@ Convergence And Uniformity
 Introduction
 ============
 
-Some parallel environments execute threads in groups that allow
-communication within the group using special primitives called
-*convergent* operations. The outcome of a convergent operation is
-sensitive to the set of threads that executes it "together", i.e.,
-convergently.
-
-A value is said to be *uniform* across a set of threads if it is the
-same across those threads, and *divergent* otherwise. Correspondingly,
-a branch is said to be a uniform branch if its condition is uniform,
-and it is a divergent branch otherwise.
-
-Whether threads are *converged* or not depends on the paths they take
-through the control flow graph. Threads take different outgoing edges
-at a *divergent branch*. Divergent branches constrain
+In some environments, groups of threads execute the same program in parallel,
+where efficient communication within a group is established using special
+primitives called :ref:`convergent operations<convergent_operations>`. The
+outcome of a convergent operation is sensitive to the set of threads that
+participate in it.
+
+The intuitive picture of *convergence* is built around threads executing in
+"lock step" --- a set of threads is thought of as *converged* if they are all
+executing "the same sequence of instructions together". Such threads may
+*diverge* at a *divergent branch*, and they may later *reconverge* at some
+common program point.
+
+In this intuitive picture, when converged threads execute an instruction, the
+resulting value is said to be *uniform* if it is the same in those threads, and
----------------
ssahasra wrote:

No, "it" here means the resulting value. In the introduction, we just want to talk about "what is a uniform value", and not how it is computed. The uniformity of a result does not always depend on the operands. For example, the result of a readfirstlane is always uniform although its operands maybe divergent. That is explained later in the part that defines uniformity. 

https://github.com/llvm/llvm-project/pull/89038


More information about the llvm-commits mailing list