Class CLALibMMChain

java.lang.Object
org.apache.sysds.runtime.compress.lib.CLALibMMChain

public final class CLALibMMChain extends Object
Support compressed MM chain operation to fuse the following cases :

XtXv == (t(X) %*% (X %*% v))

XtwXv == (t(X) %*% (w * (X %*% v)))

XtXvy == (t(X) %*% ((X %*% v) - y))

  • Method Details

    • mmChain

      public static MatrixBlock mmChain(CompressedMatrixBlock x, MatrixBlock v, MatrixBlock w, MatrixBlock out, MapMultChain.ChainType ctype, int k)
      Support compressed MM chain operation to fuse the following cases :

      XtXv == (t(X) %*% (X %*% v))

      XtwXv == (t(X) %*% (w * (X %*% v)))

      XtXvy == (t(X) %*% ((X %*% v) - y))

      Note the point of this optimization is that v and w always are vectors. This means in practice the all the compute is faster if the intermediates are exploited.
      Parameters:
      x - Is the X part of the chain optimized kernel
      v - Is the mandatory v part of the chain
      w - Is the optional w port of t the chain
      out - The output to put the result into. Can also be returned and in some cases will not be used.
      ctype - either XtwXv, XtXv or XtXvy
      k - the parallelization degree
      Returns:
      The result either in the given output or a new allocation