Skip to content

add new complex vm functions #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 14, 2025
Merged

add new complex vm functions #86

merged 4 commits into from
Jul 14, 2025

Conversation

vtavana
Copy link
Collaborator

@vtavana vtavana commented Jul 12, 2025

Added mkl implementation for complex data-types of absolute and conjugate.

Timing measurement using:

import numpy, mkl_umath
size = 10**8
a = numpy.random.rand(size) + 1j*numpy.random.rand(size)

For absolute function:

# numpy-2.3.1
%timeit numpy.absolute(a)
# 292 ms ± 319 μs per loop (mean ± std. dev. of 7 runs, 1 loop each)

# This branch
%timeit mkl_umath.absolute(a)
# 46.4 ms ± 874 μs per loop (mean ± std. dev. of 7 runs, 1 loop each)

# Main branch
%timeit mkl_umath.absolute(a)
# 1.63 s ± 1.82 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

And for conjugate function:

# numpy-2.3.1
%timeit numpy.conjugate(a)
# 439 ms ± 303 μs per loop (mean ± std. dev. of 7 runs, 1 loop each)

# This branch
%timeit mkl_umath.conjugate(a)
# 42.9 ms ± 2.16 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

# Main branch
%timeit mkl_umath.conjugate(a)
# 441 ms ± 372 μs per loop (mean ± std. dev. of 7 runs, 1 loop each)

@vtavana vtavana self-assigned this Jul 12, 2025
@vtavana vtavana marked this pull request as ready for review July 13, 2025 20:53
Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

Thank you @vtavana, LGTM

@vtavana vtavana merged commit 35efea5 into main Jul 14, 2025
32 checks passed
@vtavana vtavana deleted the complex-funcs branch July 14, 2025 16:54
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