Skip to content

[SYSTEMML-510] Generalization wcemm#93

Closed
gweidner wants to merge 3 commits intoapache:masterfrom
gweidner:wcemm-510
Closed

[SYSTEMML-510] Generalization wcemm#93
gweidner wants to merge 3 commits intoapache:masterfrom
gweidner:wcemm-510

Conversation

@gweidner
Copy link
Copy Markdown
Member

This patch adds support to wcemm for handling pattern (sum(X_log(U%_%t(V) + epsilon))).
It leverages functionality from previous PRs under SYSTEMML-510 and SYSTEMML-488 to generalize the wcemm operator with four operands. Also included are 8 new test cases to cover Dense and Sparse-Dense for CP, MR, and Spark plus reduce-side.

@gweidner
Copy link
Copy Markdown
Member Author

For reference, below are sample new instructions.

testCrossEntropyEpsDenseCP
CP wcemm _mVar1.MATRIX.DOUBLE _mVar2.MATRIX.DOUBLE _mVar3.MATRIX.DOUBLE 0.1.SCALAR.DOUBLE.true _Var4.SCALAR.DOUBLE BASIC_EPS 8

testCrossEntropyEpsDenseMR
mapper inst = MR mapwcemm 0.MATRIX.DOUBLE 1.MATRIX.DOUBLE 2.MATRIX.DOUBLE 0.1.SCALAR.DOUBLE.true 3.MATRIX.DOUBLE BASIC_EPS

testCrossEntropyEpsDenseMRRep
other inst = MR redwcemm 0.MATRIX.DOUBLE 3.MATRIX.DOUBLE 5.MATRIX.DOUBLE 0.1.SCALAR.DOUBLE.true 6.MATRIX.DOUBLE BASIC_EPS false false

testCrossEntropyEpsDenseSP
SPARK mapwcemm _mVar4.MATRIX.DOUBLE _mVar5.MATRIX.DOUBLE _mVar6.MATRIX.DOUBLE 0.1.SCALAR.DOUBLE.true _Var7.SCALAR.DOUBLE BASIC_EPS

testCrossEntropyEpsDenseSPRep
SPARK redwcemm _mVar4.MATRIX.DOUBLE _mVar5.MATRIX.DOUBLE _mVar6.MATRIX.DOUBLE 0.1.SCALAR.DOUBLE.true _Var7.SCALAR.DOUBLE BASIC_EPS false false

For pre-existing pattern (sum(X_log(U%_%t(V)))) where there is no fourth input, default -1.SCALAR.INT.true operand also generated but ignored:
testCrossEntropyDenseCP
CP wcemm _mVar1.MATRIX.DOUBLE _mVar2.MATRIX.DOUBLE _mVar3.MATRIX.DOUBLE -1.SCALAR.INT.true _Var4.SCALAR.DOUBLE BASIC 8

In addition to the unit tests, manual testing done to verify matrixMultWCeMMDense, matrixMultWCeMMSparseDense of LibMatrixMult for parallel (e.g., MatrixMultWCeTask where k=8) and single core (k=1). Also forced matrixMultWCeMMGeneric case via debugger. Included checks like (_mX==null || !_mX.sparse || scalarX) and (_mX==null || !_mX.sparse || scalarX) in matrixMultWCeMM and MatrixMultWCeTask of LibMatrixMult for consistency.

All unit tests passed in on-demand build against this branch prior to opening PR:
https://sparktc.ibmcloud.com/jenkins/job/SystemML-OnDemand/116/https://sparktc.ibmcloud.com/jenkins/job/SystemML-OnDemand/116/

@gweidner
Copy link
Copy Markdown
Member Author

All tests passed in PR build 214.
Note the branch for this PR includes all commits through March 17.

@mboehm7
Copy link
Copy Markdown
Contributor

mboehm7 commented Mar 19, 2016

Thanks @gweidner - it already looks fine. It would be nice though to simplify the runtime a little bit. Since you deal in any case with scalars (eps or 0), I would recommend to compile for type BASIC a 0 instead of the -1 into the instruction, pass it as a scalar double to libmatrixmult, and simplify the internals of libmatrixmult wcemm accordingly.

@mboehm7
Copy link
Copy Markdown
Contributor

mboehm7 commented Mar 19, 2016

also thanks for the cleanup of the lops construction of other quaternary operator types.

@gweidner
Copy link
Copy Markdown
Member Author

Thank you @mboehm7 for the review. I've simplified the scalar processing in LibMatrixMult for wcemm and updated the instruction for BASIC type, e.g.,
CP wcemm _mVar1.MATRIX.DOUBLE _mVar2.MATRIX.DOUBLE _mVar3.MATRIX.DOUBLE 0.0.SCALAR.DOUBLE.true _Var4.SCALAR.DOUBLE BASIC 8

The automated PR build 215 is in progress.

@mboehm7
Copy link
Copy Markdown
Contributor

mboehm7 commented Mar 20, 2016

LGTM

The test failures of PR build 215 are due to my last commit (tested through eclipse in a shared JVM process which has hidden thread-local initialization issues) - I'll deliver the fix tomorrow morning.

@asfgit asfgit closed this in 895ecb8 Mar 21, 2016
dusenberrymw pushed a commit to dusenberrymw/systemml that referenced this pull request Mar 24, 2016
asfgit pushed a commit that referenced this pull request Mar 27, 2020
Basic JSONL Reader Implementation.
Basic JSONL Writer Implementation.
Basic Parallel JSONL Reader/Writer Implementation.
Test Utils and WriteRead Tests

DIA project.

Closes #93.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants