v4.2 release. (#2587)
* Fix default cluster callback values to 1 to avoid profiler failure when these values are not set in command line. * v4.2 release.
This commit is contained in:
@@ -153,7 +153,6 @@ For example,
|
||||
|
||||
To compute the strides of the strided layout, the residues of the above operation are used to scale the strides of `A`. For instance, the last example `(3,6,2,8):(w,x,y,z) / 72` with strides `(w,x,y,z)` produces `(3*w,6*x,2*x,2*z)` as the strides of the strided layout.
|
||||
|
||||
|
||||
As you may have noticed, we can only divide shapes by certain values and get a sensible result. This is called the **stride divisibility condition** and is statically checked in CuTe when possible.
|
||||
|
||||
2. Keep the first `s` elements of the newly strided `A` so that the result has a compatible shape with `B`. This can be computed by "modding out" the first `s` elements from the shape of `A` starting from the left.
|
||||
@@ -175,11 +174,8 @@ Again, this operation must satisfy a **shape divisibility condition** to yield a
|
||||
From the above examples, we can construct the composition `(3,6,2,8):(w,x,y,z) o 16:9 = (1,2,2,4):(3*w,3*x,y,z)`.
|
||||
|
||||
---
|
||||
|
||||
#### Example 1 -- Worked Example of Calculating a Composition
|
||||
|
||||
We provide a more complex example of composition, where both operand layouts are multi-modal to illustrate the concepts introduced above.
|
||||
|
||||
```
|
||||
Functional composition, R := A o B
|
||||
R(c) := (A o B)(c) := A(B(c))
|
||||
@@ -223,7 +219,6 @@ Putting this together and coalescing each mode, we obtain the result
|
||||
R = A o B
|
||||
= ((2, 2), 3): ((24, 2), 8)
|
||||
```
|
||||
|
||||
#### Example 2 -- Reshape a layout into a matrix
|
||||
|
||||
`20:2 o (5,4):(4,1)`. Composition formulation.
|
||||
|
||||
@@ -138,13 +138,15 @@ In principle, layout strides may be any integer-module.
|
||||
CuTe's basis elements live in the header file `cute/numeric/arithmetic_tuple.hpp`.
|
||||
To make it easy to create `ArithmeticTuple`s that can be used as strides, CuTe defines normalized basis elements using the `E` type alias. "Normalized" means that the scaling factor of the basis element is the compile-time integer 1.
|
||||
|
||||
| C++ object | Description | String representation |
|
||||
| --- | --- | --- |
|
||||
| `E<>{}` | `1` | `1` |
|
||||
| `E<0>{}` | `(1,0,...)` | `1@0` |
|
||||
| `E<1>{}` | `(0,1,0,...)` | `1@1` |
|
||||
| `E<0,1>{}` | `((0,1,0,...),0,...)` | `1@1@0` |
|
||||
| `E<1,0>{}` | `(0,(1,0,...),0,...)` | `1@0@1` |
|
||||
| C++ object | Description | String representation |
|
||||
| --- | --- | --- |
|
||||
| `E<>{}` | `1` | `1` |
|
||||
| `E<0>{}` | `(1,0,...)` | `1@0` |
|
||||
| `E<1>{}` | `(0,1,0,...)` | `1@1` |
|
||||
| `E<0,0>{}` | `((1,0,...),0,...)` | `1@0@0` |
|
||||
| `E<0,1>{}` | `((0,1,0,...),0,...)` | `1@1@0` |
|
||||
| `E<1,0>{}` | `(0,(1,0,...),0,...)` | `1@0@1` |
|
||||
| `E<1,1>{}` | `(0,(0,1,0,...),0,...)` | `1@1@1` |
|
||||
|
||||
The "description" column in the above table
|
||||
interprets each basis element as an infinite tuple of integers,
|
||||
@@ -155,7 +157,9 @@ For example, `E<1>{}` has a 1 in position 1: `(0,1,0,...)`.
|
||||
|
||||
Basis elements can be *nested*.
|
||||
For instance, in the above table, `E<0,1>{}` means that
|
||||
in position 0 there is a `E<1>{}`: `((0,1,0,...),0,...)`.
|
||||
in position 0 there is a `E<1>{}`: `((0,1,0,...),0,...)`. Similarly,
|
||||
`1@1@0` means that `1` is lifted to position 1 to create `1@1`: `(0,1,0,...)`
|
||||
which is then lifted again to position 0.
|
||||
|
||||
Basis elements can be *scaled*.
|
||||
That is, they can be multiplied by an integer *scaling factor*.
|
||||
|
||||
Reference in New Issue
Block a user