Isso-W commented on code in PR #2542:
URL: https://github.com/apache/systemds/pull/2542#discussion_r3694707495


##########
src/test/java/org/apache/sysds/test/functions/unique/UniqueBatchedPathTest.java:
##########


Review Comment:
   It differs only in that the input is read in sparse format, if you consider 
that too thin a reason I am happy to drop it



##########
src/test/java/org/apache/sysds/test/functions/unique/UniqueRow.java:
##########
@@ -76,4 +76,58 @@ public void testNoDuplicatesCP() {
                double[][] expectedMatrix = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
                uniqueTest(inputMatrix, expectedMatrix, Types.ExecType.CP, 0.0);
        }
+
+       /**
+        * Large enough to take the multi-threaded path. Every row holds a 
single distinct value, so the expected result is
+        * one column and independent of any hash set iteration order.
+        */
+       @Test
+       public void testMultiThreadedCP() {
+               uniqueTestOrdered(constantRows(400, 64), 
expectedConstantRows(400), Types.ExecType.CP, 0.0);
+       }
+
+       /**
+        * Same input under a heavily reduced local memory budget. Row-wise 
workers reuse a single set that is cleared per
+        * row, so only one live set per thread is charged and the parallel 
path stays applicable; this guards against
+        * needlessly falling back to batched or sequential execution.
+        */
+       @Test
+       public void testReducedMemoryBudgetCP() {
+               uniqueTestConstrainedMemory(constantRows(400, 64), 
expectedConstantRows(400), Types.ExecType.CP, 0.0,
+                       16 * 1024 * 1024);
+       }
+
+       /**
+        * Sparse counterpart of the multi-threaded case: only every eighth row 
is populated, so the input is read in sparse
+        * format. Every row still holds a single distinct value, either its 
filler or zero, so the expected result stays
+        * one column.
+        */
+       @Test
+       public void testSparseMultiThreadedCP() {

Review Comment:
   It differs only in that the input is read in sparse format, if you consider 
that too thin a reason I am happy to drop it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to