Skip to content

Conversation

vtavana
Copy link
Collaborator

@vtavana vtavana commented Aug 24, 2025

add oneMKL implementation for complex loop of add, subtract, multiply, divide.

timing on : Intel(R) Xeon(R) Platinum 8480+ OpenCL 3.0 (Build 0) [2025.20.7.0.08_160000.prerelease]

On this branch:

Function: add | Dtype: complex128
      Size |   NumPy (ms) |  MKL_umath (ms)
---------------------------------------------
     10**4 |        0.008 |           0.006
     10**5 |        0.149 |           0.152
     10**6 |        1.683 |           2.380
     10**7 |       54.259 |           6.949
     10**8 |      600.946 |          75.987

Function: multiply | Dtype: complex128
      Size |   NumPy (ms) |  MKL_umath (ms)
---------------------------------------------
     10**4 |        0.005 |           0.009
     10**5 |        0.165 |           0.147
     10**6 |        1.791 |           0.155
     10**7 |       52.412 |           6.979
     10**8 |      580.478 |          76.994

Function: subtract | Dtype: complex128
      Size |   NumPy (ms) |  MKL_umath (ms)
---------------------------------------------
     10**4 |        0.008 |           0.006
     10**5 |        0.174 |           0.151
     10**6 |        1.791 |           0.198
     10**7 |       54.456 |           6.818
     10**8 |      601.015 |          77.535

Function: divide | Dtype: complex128
      Size |   NumPy (ms) |  MKL_umath (ms)
---------------------------------------------
     10**4 |        0.051 |           0.028
     10**5 |        0.580 |           0.076
     10**6 |        5.868 |           0.181
     10**7 |       82.155 |           7.180
     10**8 |      859.944 |          78.461

On the main branch:

Function: add | Dtype: complex128
      Size |   NumPy (ms) |  MKL_umath (ms)
---------------------------------------------
     10**4 |        0.005 |           0.005
     10**5 |        0.190 |           0.170
     10**6 |        1.553 |           1.522
     10**7 |       54.760 |          52.109
     10**8 |      601.168 |         569.888

Function: multiply | Dtype: complex128
      Size |   NumPy (ms) |  MKL_umath (ms)
---------------------------------------------
     10**4 |        0.005 |           0.008
     10**5 |        0.169 |           0.147
     10**6 |        1.677 |           1.455
     10**7 |       52.685 |          52.348
     10**8 |      580.261 |         570.205

Function: subtract | Dtype: complex128
      Size |   NumPy (ms) |  MKL_umath (ms)
---------------------------------------------
     10**4 |        0.005 |           0.005
     10**5 |        0.175 |           0.152
     10**6 |        1.762 |           1.509
     10**7 |       54.407 |          51.839
     10**8 |      602.048 |         570.385

Function: divide | Dtype: complex128
      Size |   NumPy (ms) |  MKL_umath (ms)
---------------------------------------------
     10**4 |        0.050 |           0.050
     10**5 |        0.574 |           0.562
     10**6 |        5.778 |           5.642
     10**7 |       82.973 |          80.582
     10**8 |      860.350 |         839.202

@vtavana vtavana self-assigned this Aug 24, 2025
@vtavana vtavana marked this pull request as ready for review August 24, 2025 21:22
Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this LGTM, thanks for updating these Vahid, the same can be done for other functions in separate PRs

at some point it may be interesting to add more tests, but since we have the numpy tests to lean on, for now it can wait

@vtavana vtavana merged commit 181f870 into main Aug 28, 2025
40 checks passed
@vtavana vtavana deleted the onemkl-complex-add branch August 28, 2025 12:21
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