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

Switch on SLP vectorize. #6275

Merged
merged 5 commits into from Oct 14, 2020
Merged

Switch on SLP vectorize. #6275

merged 5 commits into from Oct 14, 2020

Conversation

stuartarchibald
Copy link
Contributor

As title.

@stuartarchibald
Copy link
Contributor Author

Seeing what impact this has on testing run times.

@stuartarchibald
Copy link
Contributor Author

Command: time ./runtests.py --random=0.1

Mainline does this:

Ran 995 tests in 636.697s

OK (skipped=19, expected failures=1)

real    10m42.166s
user    11m33.653s
sys     0m7.492s

This branch does this:

Ran 995 tests in 632.633s

OK (skipped=19, expected failures=1)

real    10m37.993s
user    11m38.904s
sys     0m7.392s

seems like the impact on the test suite run time is potentially small/zero.

@stuartarchibald stuartarchibald added this to the PR Backlog milestone Sep 23, 2020
@stuartarchibald
Copy link
Contributor Author

Mainline:

In [1]: %cpaste                                                                                                                 
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:from numba import njit
import numpy as np

@njit
def foo(a1, a2, b1, b2, A):
    for x in range(0, len(A), 4):
        Z = A[x:x + 4]
        Z[0] = a1*(a1 + b1)
        Z[1] = a2*(a2 + b2)
        Z[2] = a1*(a1 + b1)
        Z[3] = a2*(a2 + b2)

foo(1.2, 3.4, 5.6, 7.8, np.empty(4000))::::::::::::
:<EOF>

In [2]: G = np.empty(40000)                                                                                                     

In [3]: %timeit foo(1.2, 3.4, 5.6, 7.8, G)                                                                                      
12.9 µs ± 2.75 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

This branch:

In [1]: %cpaste                                                                                                                 
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:from numba import njit
import numpy as np

@njit
def foo(a1, a2, b1, b2, A):
    for x in range(0, len(A), 4):
        Z = A[x:x + 4]
        Z[0] = a1*(a1 + b1)
        Z[1] = a2*(a2 + b2)
        Z[2] = a1*(a1 + b1)
        Z[3] = a2*(a2 + b2)

foo(1.2, 3.4, 5.6, 7.8, np.empty(4000))::::::::::::
:<EOF>

In [2]: G = np.empty(40000)                                                                                                     

In [3]: %timeit foo(1.2, 3.4, 5.6, 7.8, G)                                                                                      
10.3 µs ± 22.8 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)

@@ -714,7 +714,8 @@ def _pass_manager_builder(self):
missed...
"""
pmb = lp.create_pass_manager_builder(
opt=config.OPT, loop_vectorize=config.LOOP_VECTORIZE)
opt=config.OPT, loop_vectorize=config.LOOP_VECTORIZE,
slp_vectorize=True)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this also get a config flag? e.g. config.SLP_VECTORIZE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can do, but I really want to move away from specific config flags for each feature in the optimiser, I think it should be in the hands of the user but also it shouldn't be spelled one at a time like this. For 0.52 shall we do a flag so it's easy to debug/turn off but this is the last one like it!?!

Copy link
Member

Choose a reason for hiding this comment

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

Ok, make it the last flag.

@sklam sklam added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Oct 13, 2020
@sklam
Copy link
Member

sklam commented Oct 14, 2020

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@stuartarchibald stuartarchibald added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Oct 14, 2020
@sklam sklam added 4 - Waiting on CI Review etc done, waiting for CI to finish 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author 4 - Waiting on CI Review etc done, waiting for CI to finish labels Oct 14, 2020
@sklam sklam merged commit 9ceac80 into numba:master Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants