Hi everybody,

I've been thinking a bit about dynamically zero-padding viennacl::matrix<>
for full hardware use ( best bandwidth for BLAS1, BLAS2, best performance
for BLAS3).

Basically, the big problem arising is that the blocking-parameter is not
dependent on the hardware or the matrix, but rather on the operation, ie :
x = prod(A,y)
C0 = prod(A,B0)
C1 = prod(trans(A), B1)
C2 = prod(B2, A)
all use the same matrix A but require different padding sizes. If we want
to handle all these cases properly, it seems like we will need an
intelligence layer to dynamically update the matrix A.

However, I believe that resizing A to fit the right padding sizes is not an
option, because the corresponding overhead would outweigh the benefits of
padding for the bandwidth-limited kernel.

Another option would be to pad A with the biggest block size required. ie,
if on the current hardware:
BLAS1 Matrix[**] requires padding 4*4
GEMM AA requires LHS padded by 32*128, RHS by 128*16
GEMM TA requires LHS padded by 16*256, RHS by 256*64
... etc..
then each matrix would be zero-padded 256*128, so that it can fit all the
context.

After that, at each operation, internal_size*() would be updated to fit the
correct block sizes. Are we really sure that the initial zeros of the
padding will remain zeros throughout the whole execution process?


[**]I've come to the conclusion that having a specific BLAS1 kernel for
matrix was necessary, in order to allow maximum bandwidth on operations
such as :
A = B + repmat(x, 1, traits::size2(B));
A = B + eye(size1,size2)...
These operations are not implemented yet, though, but the most difficult
part is precisely to have a kernel using vector4 for these operations, for
example.
Do you agree or do you think we should use a 1D kernel for matrix blas1
too? Since both views are equivalent, the autotuner should also be able to
find bandwidth-optimal 2D parameters.

Best regards,
Philippe
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to