11.9 PROJECTION OPERATION USING THE LINEAR PROJECTION OPERATOR

In Section 11.8, we discussed how we can associate a time step value to each point in the computation domain x1D49F_EuclidMathOne_10n_000100. In this section, we discuss how we can assign a task to each point in the computation domain x1D49F_EuclidMathOne_10n_000100. This task could later be assigned to a thread for the case of multithreaded software implementation, or the task could be assigned to a PE for the case of hardware systolic implementation. It is a waste of resources (number of processors or number of threads) to associate a unique processor or thread to each point in the computation domain x1D49F_EuclidMathOne_10n_000100. The main reason is that each point is active only for one time instant and is idle the rest of the time. The basic idea then is to allocate one processor or thread to several points of x1D49F_EuclidMathOne_10n_000100. There are basically three ways of doing this:

1. Use linear projection operator matrix P to reduce the dimensions of x1D49F_EuclidMathOne_10n_000100 to produce a new computation domain c11ue005 whose dimensions k < n. Matrix P has dimensions k × n and its rank is k. For our matrix multiplication example, x1D49F_EuclidMathOne_10n_000100 was 3-D. The linear projection operation would produce a computation domain c11ue006 that is 2-D or 1-D.

2. Use a nonlinear operator to reduce the size of the computation domain x1D49F_EuclidMathOne_10n_000100, but keep its dimension n fixed. For our matrix multiplication example, the size of x1D49F_EuclidMathOne_10n_000100 is a I × J × K cube in 3-D space. The nonlinear operator would produce a new 3-D cube, c11ue007, whose size is now I′ × J′ × K′, where I′ < I, J′ < J and K′ < K.

3. Use both linear and nonlinear operators to reduce both the size and dimension of the computation domain.

We explain here the first approach since it is the one most used to for design space exploration.

A subtle point to be noticed in the projection operation is that it controls the amount of workload assigned to each software thread for a multithreaded implementation or the workload assigned to each PE for a systolic array implementation. Just like affine scheduling, affine projection affords us little control over the workload assigned to a thread or a PE. However, nonlinear projection operations will give us very good control over the workload assigned to each thread or PE.

11.9.1 The Projection Matrix P

We define a linear projection operation for multithreading as the projection matrix P that maps a point in domain x1D49F_EuclidMathOne_10n_000100 (of dimension n) to point c11ue008 in the k-dimensional computational domain c11ue009 according to the equation

(11.81) c11e081

The following theorem places a value on the rank of the projection matrix in relation to the dimension of the projected domain.

Theorem 11.4

Given the dimension of x1D49F_EuclidMathOne_10n_000100 is n and the dimension of c11ue010 is k and rank(P) is r. Then we must have r = k, that is rank(P) = k, if P is to be a valid projection matrix.

Proof:

P has dimension k × n with k < n. The definition of the rank of a matrix indicates that the rank could not exceed the smaller of n or k. Thus we conclude that rk.

Now assume that the rank of P is smaller than k. If r < k, then we have r linearly independent rows and kr rows that are a linear combination of the r rows. Thus, the linear equation given by

(11.82) c11e082

is a system of linear equations in k unknowns, and the number of equations is less than the unknowns. Thus, we have an infinity of solutions. This contradicts our assertion that the mapping matrix maps any point in x1D49F_EuclidMathOne_10n_000100 to a unique point in c11ue011.

Therefore, we conclude that we must have the rank of P equal to k; that is, r = k.

Now the projection matrix P maps two points p1 and p2 in x1D49F_EuclidMathOne_10n_000100 associated with a particular output variable instance v(c) to the point c11ue012. Thus, we can write

(11.83) c11e083

But from Theorem 11.1 and Eq. 11.27, we can write the expression

(11.84) c11e084

where e is a nullvector associated with the output variable. We conclude therefore that the nullvectors of the projection matrix P are also the nullvectors associated with the output variable v. The following theorem relates the rank of the projection matrix to

Theorem 11.5

Assume the dimension of x1D49F_EuclidMathOne_10n_000100 is n. If output variable v has r orthogonal nullvectors, then the dimension of c11ue013 is k = n − r and the rank of the projection matrix P is k.

Proof:

The nullvectors of P are the r nullvectors. Thus, the rank of P is given by

(11.85) c11e085

But we proved in Theorem 11.4 that the rank of P is equal to k. Thus, we must have

(11.86) c11e086

Based on this theorem, if our variable had only one nullvector, then the dimension of c11ue014 will be n − 1. If the variable had two nullvectors, then the dimension of c11ue015 would be n − 2, and so on.

11.9.2 The Projection Direction

A projection matrix is required to effect the projection operation described by Eq. 11.81. However, the projection operation is typically defined in terms of a projection direction, or directions, d. Knowing the desired projection directions helps in finding the corresponding projection matrix P.

Definition 11.1

The projection direction is defined such that any two distinct points, p1 and p2, in x1D49F_EuclidMathOne_10n_000100 will be projected to the same point in c11ue016 if it satisfies the relation

(11.87) c11e087

where α ≠ 0 is some constant. In other words, the vector connecting p1 and p2 is parallel to d.

Theorem 11.6

The projection direction d is in the nullspace of the projection matrix P.

Proof:

From Definition 11.1, we can write

(11.88) c11e088

(11.89) c11e089

Subtracting the above two equations, we get

(11.90) c11e090

11.9.3 Choosing Projection Direction d

One guideline for choosing a projection direction is the presence of extremal ray r in domain x1D49F_EuclidMathOne_10n_000100. An extremal ray is a direction vector in x1D49F_EuclidMathOne_10n_000100 where the domain extends to infinity or a large value of the indices. The projection matrix should have those rays in its nullspace; that is,

(11.91) c11e091

This is just a recommendation to ensure that the dimension of the projected domain x1D49F_EuclidMathOne_10n_000100 is finite. However, the projection directions do not necessarily have to include the extremal ray directions to ensure a valid multiprocessor. Our 3-D matrix multiplication algorithm deals with matrices of finite dimensions. As such, there are no extremal ray directions. However, we impose two requirements on our multiprocessor.

A valid scheduling function cannot be orthogonal to any of the projection directions, a condition of Eq. 11.61. Therefore, the projection directions impose restrictions on valid scheduling functions or vice versa. For our matrix multiplication algorithm, we obtained a scheduling function in Eq. 11.73 as

(11.92) c11e092

Possible projection directions that are not orthogonal to s are

(11.93) c11e093

(11.94) c11e094

(11.95) c11e095

In the next section, we will show how matrix P is determined once the projection vectors are chosen.

11.9.4 Finding Matrix P Given Projection Direction d

We present here an algorithm to get the projection matrix assuming we know our projection directions. We start first with the simple case when we have chosen only one projection direction d.

Step 1

Choose the projection directions. In our case, we choose only one projection direction with the value

(11.96) c11e096

This choice will ensure that all points along the i-axis will map to one point in c11ue017.

Step 2

Here we determine the basis vectors for x1D49F_EuclidMathOne_10n_000100, such that one of the basis vectors is along d and the other two basis vectors are orthogonal to it. In our case, we have three basis vectors:

(11.97) c11e097

(11.98) c11e098

(11.99) c11e099

Equation 11.97 implies that the i-axis will be eliminated after the projection operation since our choice implies that Pb0 = 0.

Step 3

Choose the basis vectors for c11ue018. In this case, we have two basis vectors since the dimension of c11ue019 is two. We choose the basis vectors as

(11.100) c11e100

(11.101) c11e101

The above two equations imply that the j-axis will map to c11ue020 and the k-axis will map to c11ue021. These become the c11ue022- and c11ue023-axes for c11ue024, respectively.

Step 4

Associate each basis vector c11ue025 with a basis vector b. Based on that, we can write

(11.102) c11e102

Step 5

We now have a sufficient number of equations to find all the elements of the 2 × 3 projection matrix P:

(11.103) c11e103

(11.104) c11e104

The first Equation is a set of two equations. The second Equation is a set of 2 × 2 equations. In all, we have a set of 2 × 3 equations in 2 × 3 unknowns, which are the elements of the projection matrix P.

For our case, we can write the above equations in a compact form as

(11.105) c11e105

Explicitly, we can write

(11.106) c11e106

The solution to the above Equation is simple and is given by

(11.107) c11e107

Thus, a point c11ue026 maps to point c11ue027.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.165.115