Class ParamservUtils
java.lang.Object
org.apache.sysds.runtime.controlprogram.paramserv.ParamservUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ListObjectaccrueGradients(ListObject accGradients, ListObject gradients, boolean cleanup) Accumulate the given gradients into the accrued gradientsstatic ListObjectaccrueGradients(ListObject accGradients, ListObject gradients, boolean par, boolean cleanup) Accumulate the given gradients into the accrued gradientsstatic ListObjectaccrueModels(ListObject accModels, ListObject model, boolean cleanup) Accumulate the given models into the accrued accrueModelsstatic ListObjectaccrueModels(ListObject accModels, ListObject model, boolean par, boolean cleanup) Accumulate the given models into the accrued modelsstatic MatrixBlockcbindMatrix(MatrixBlock left, MatrixBlock right) static voidcleanupData(ExecutionContext ec, String varName) static voidcleanupData(ExecutionContext ec, Data data) static voidcleanupListObject(ExecutionContext ec, String lName) Clean up the list object according to its own data statusstatic voidcleanupListObject(ExecutionContext ec, String lName, boolean[] status) Clean up the list object according to the given array of data status (i.e., false => not be removed)static voidstatic voidcleanupListObject(ExecutionContext ec, ListObject lo, boolean[] status) static voidstatic List<ExecutionContext>copyExecutionContext(ExecutionContext ec, int num) static ListObjectcopyList(ListObject lo, boolean cleanup) Deep copy the list objectstatic ExecutionContextcreateExecutionContext(ExecutionContext ec, LocalVariableMap varsMap, String updFunc, String aggFunc, int k) static ExecutionContextcreateExecutionContext(ExecutionContext ec, LocalVariableMap varsMap, String updFunc, String aggFunc, int k, boolean forceExecTypeCP) static MatrixObjectstatic MatrixBlockgeneratePermutation(int numEntries, long seed) Generate the permutationstatic MatrixBlockgenerateReplicationMatrix(int nsamples, int nrows, long seed) Generates a matrix which when left multiplied with the input matrix will replicate n data rowsstatic MatrixBlockgenerateSubsampleMatrix(int nsamples, int nrows, long seed) Generates a matrix which when left multiplied with the input matrix will subsamplestatic MatrixObjectstatic MatrixObjectnewMatrixObject(MatrixBlock mb, boolean cleanup) static voidrecompileProgramBlocks(int k, List<ProgramBlock> pbs) static voidrecompileProgramBlocks(int k, List<ProgramBlock> pbs, boolean forceExecTypeCP) static MatrixObjectsliceMatrix(MatrixObject mo, long rl, long rh) Slice the matrixstatic MatrixBlocksliceMatrixBlock(MatrixBlock mb, long rl, long rh) Slice the matrix block and return a matrix block (used in spark)
-
Field Details
-
PS_FUNC_PREFIX
- See Also:
-
SEED
public static long SEED
-
-
Constructor Details
-
ParamservUtils
public ParamservUtils()
-
-
Method Details
-
copyList
Deep copy the list object- Parameters:
lo- list objectcleanup- clean up the given list object- Returns:
- a new copied list object
-
cleanupListObject
Clean up the list object according to its own data status- Parameters:
ec- execution contextlName- list var name
-
cleanupListObject
Clean up the list object according to the given array of data status (i.e., false => not be removed)- Parameters:
ec- execution contextlName- list var namestatus- data status
-
cleanupListObject
-
cleanupListObject
-
cleanupData
-
cleanupData
-
cleanupListObject
-
newMatrixObject
-
newMatrixObject
-
createShallowCopy
-
sliceMatrix
Slice the matrix- Parameters:
mo- input matrixrl- low boundaryrh- high boundary- Returns:
- new sliced matrix
-
sliceMatrixBlock
Slice the matrix block and return a matrix block (used in spark)- Parameters:
mb- input matrixrl- low boundaryrh- high boundary- Returns:
- new sliced matrix block
-
generatePermutation
Generate the permutation- Parameters:
numEntries- permutation sizeseed- seed used to generate random number- Returns:
- permutation matrix
-
generateSubsampleMatrix
Generates a matrix which when left multiplied with the input matrix will subsample- Parameters:
nsamples- number of samplesnrows- number of rows in input matrixseed- seed used to generate random number- Returns:
- subsample matrix
-
generateReplicationMatrix
Generates a matrix which when left multiplied with the input matrix will replicate n data rows- Parameters:
nsamples- number of samplesnrows- number of rows in input matrixseed- seed used to generate random number- Returns:
- replication matrix
-
createExecutionContext
public static ExecutionContext createExecutionContext(ExecutionContext ec, LocalVariableMap varsMap, String updFunc, String aggFunc, int k) -
createExecutionContext
public static ExecutionContext createExecutionContext(ExecutionContext ec, LocalVariableMap varsMap, String updFunc, String aggFunc, int k, boolean forceExecTypeCP) -
copyExecutionContext
-
recompileProgramBlocks
-
recompileProgramBlocks
-
cbindMatrix
-
accrueGradients
public static ListObject accrueGradients(ListObject accGradients, ListObject gradients, boolean cleanup) Accumulate the given gradients into the accrued gradients- Parameters:
accGradients- accrued gradients list objectgradients- given gradients list objectcleanup- clean up the given gradients list object- Returns:
- new accrued gradients list object
-
accrueGradients
public static ListObject accrueGradients(ListObject accGradients, ListObject gradients, boolean par, boolean cleanup) Accumulate the given gradients into the accrued gradients- Parameters:
accGradients- accrued gradients list objectgradients- given gradients list objectpar- parallel executioncleanup- clean up the given gradients list object- Returns:
- new accrued gradients list object
-
accrueModels
Accumulate the given models into the accrued accrueModels- Parameters:
accModels- accrued models list objectmodel- given models list objectcleanup- clean up the given models list object- Returns:
- new accrued models list object
-
accrueModels
public static ListObject accrueModels(ListObject accModels, ListObject model, boolean par, boolean cleanup) Accumulate the given models into the accrued models- Parameters:
accModels- accrued models list objectmodel- given models list objectpar- parallel executioncleanup- clean up the given models list object- Returns:
- new accrued models list object
-