louislepage commented on PR #1849:
URL: https://github.com/apache/systemds/pull/1849#issuecomment-1608898251

   Thanks for the feedback @phaniarnab !
   
   Since the boolean denseblocks are in an early stage and not yet usable via 
DML, I wrote a simple java program that creates the matrices and runs the 
operators on them.  It runs the operators on two randomly generated double 
matrices of a predefined size. In my example, I took the average of 25 
computations with random matrices. The time was taken using javas 
`Instant.now()` and then calculated as milli seconds, which were stored in a 
LongSummaryStatistics object to compute averages etc.:
   
   ```
           Instant start = Instant.now();
           mb1.binaryOperations(op, mb2, ret);
           Instant finish = Instant.now();
           long timeElapsed = Duration.between(start, finish).toMillis();
           timeStatistics.accept(timeElapsed);
   ```
   As described 
[here](https://github.com/apache/systemds/pull/1849#issuecomment-1606228945), 
the tool can be found [in this 
repo](https://github.com/louislepage/systemds-boolean-matrix-evaluation). It 
should be public. 
   
   The main reason for this approach is that I did not yet want to add full 
support for boolean matrices since I can not tell if that might break things in 
other places. 
   However, I think it should be fine to use boolean matrices whenever running 
unsafeBinary with operators that are Comparision functions. If the data of 
dense blocks are only accessed using the get() functions, we can always return 
the double versions of the boolean values there to maintain compatibility with 
the FP64 implementation. To access the values as boolean in the future, I added 
a getBoolean() function to the boolean denseblocks.
   
   Let me know if I should add this support for boolean matrices by using 
translations to doubles in the get() method to maintain compatibility.
   
   But first I should test which kind of boolean implementation performs 
better, boolean array or bitset.


-- 
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