Skip to content
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

Parallelize JIT functions #440

Merged
merged 3 commits into from
Dec 9, 2022
Merged

Parallelize JIT functions #440

merged 3 commits into from
Dec 9, 2022

Conversation

mhostetter
Copy link
Owner

@mhostetter mhostetter commented Nov 30, 2022

Improves performance for #439.

Matrix multiplication

In [1]: import galois

In [2]: GF = galois.GF(2**16, compile="jit-calculate")

In [3]: A = GF.Random((500, 500), seed=1)

In [4]: A = GF.Random((300, 400), seed=1)

In [5]: B = GF.Random((400, 500), seed=2)

# Before
In [6]: %timeit A @ B
1.49 s ± 14.7 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

# After
In [7]: %timeit A @ B
152 ms ± 732 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)

Polynomial evaluation

In [1]: import galois

In [2]: GF = galois.GF(2**16, compile="jit-calculate")

In [3]: f = galois.Poly.Random(100, seed=1, field=GF)

In [4]: x = GF.Random(100_000, seed=1)

# Before
In [6]: %timeit f(x)
220 ms ± 745 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)

# After
In [6]: %timeit f(x)
31.3 ms ± 1.03 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

@mhostetter mhostetter added the performance Affects speed/performance label Nov 30, 2022
@codecov
Copy link

codecov bot commented Nov 30, 2022

Codecov Report

Base: 96.38% // Head: 96.38% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (25cfcf9) compared to base (153614a).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@              Coverage Diff               @@
##           release/0.3.x     #440   +/-   ##
==============================================
  Coverage          96.38%   96.38%           
==============================================
  Files                 42       42           
  Lines               5529     5533    +4     
==============================================
+ Hits                5329     5333    +4     
  Misses               200      200           
Impacted Files Coverage Δ
src/galois/_domains/_function.py 97.00% <100.00%> (+0.03%) ⬆️
src/galois/_domains/_linalg.py 95.55% <100.00%> (+0.01%) ⬆️
src/galois/_polys/_dense.py 96.80% <100.00%> (+0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mhostetter mhostetter changed the base branch from release/0.2.x to release/0.3.x December 9, 2022 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Affects speed/performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant