1 of 7

TEST OF SMATRIXGPU IMPLEMENTATION AND NUMERICAL FLUCTUATIONS

DONE BY: MAKSYM KIZITSKYI

SUPERVISOR: MATTEO CONCAS

CERN, 7 AUGUST 2024

2 of 7

GOALS OF THE WORK

  • Primary Objective:

Evaluate the implementation of SMatrixGPU to detect any numerical fluctuations during its operation.

  • Relevance:

These tests are crucial for identifying and addressing potential errors due to fluctuations that can occur during matrix operations, ensuring the reliability and accuracy of computations.

3 of 7

APPROACH

  • Matrix Initialization:

Initialize matrices with random floating-point values.

  • Operations Execution:

Perform basic matrix operations (inversion, copying, and multiplication) on both CPU and GPU.

  • Result Comparison:

Compare the results of CPU and GPU computations to verify the correctness and identify any discrepancies.

4 of 7

IMPLEMENTATION

  • Tested Operations:

Conducted inversion, copying, and multiplication tests on both symmetrical and general matrices.

  • Verification Method:

Verified results by printing matrices in both decimal and binary formats.

  • Tolerance Handling:

Applied a tolerance level of 1e-5 for by-element comparisons in cases where numerical fluctuations occurred.

5 of 7

RESULTS

Without fast math

With fast math on

6 of 7

CONCLUSIONS

  • Numerical Fluctuations:

Tests revealed small numerical fluctuations (approximately 1e-7) in GPU operations, affecting an average of 3 out of 9 elements. The remaining elements were identical to the CPU results.

  • Optimization:

Disabling fast math operations can minimize these fluctuations.

  • Recommendations:

For high-precision tasks, it is advisable to turn off fast math operations. If calculation speed is prioritized and an error margin of 1e-7 is acceptable, fast math can remain enabled.

7 of 7

THANK YOU FOR YOUR ATTENTION!