summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #13368 from r-devulap/sincos-simdMatti Picus2019-08-189-52/+410
|\ | | | | ENH: Use AVX for float32 implementation of np.sin & np.cos
| * BUG: rename avx2_scalef_ps to fma_scalef_psRaghuveer Devulapalli2019-08-031-1/+1
| |
| * TEST: improving test coverage for sin/cos for input > 117435.992fRaghuveer Devulapalli2019-08-031-1/+6
| |
| * MAINT: using an enum to switch between sin/cosRaghuveer Devulapalli2019-08-033-12/+20
| |
| * BUG: eliminate unsed variables warning in cpuidRaghuveer Devulapalli2019-08-031-1/+1
| |
| * TEST: Rounding max tolerable ulp error to an intRaghuveer Devulapalli2019-08-031-4/+4
| | | | | | | | | | The assert_array_max_ulp returns only an int since it compares ULP difference between two float32 numbers.
| * BUG: AVX2 impl of sin/cos requires an FMARaghuveer Devulapalli2019-08-037-52/+76
| | | | | | | | | | | | Without an FMA, the output of AVX2 and AVX512 version differ. This changes ensures the output across implementations remains exactly the same.
| * BUG: use strides and process strided arrays using AVXRaghuveer Devulapalli2019-08-032-21/+49
| |
| * TEST: adding tests to validate AVX sin/cos implementationRaghuveer Devulapalli2019-08-032-3/+14
| |
| * BUG: sin and cos cast float16 to float32Raghuveer Devulapalli2019-08-031-0/+2
| |
| * BUG: fixing NAN handling and adding tests for sin/cosRaghuveer Devulapalli2019-08-032-4/+23
| |
| * ENH: Use AVX for float32 implementation of np.sin & np.cosRaghuveer Devulapalli2019-08-035-5/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements vectorized single precision sine and cosine using AVX2 and AVX512. Both sine and cosine are computed using a polynomial approximation which are accurate for values between [-PI/4,PI/4]. The original input is reduced to this range using a 3-step Cody-Waite's range reduction method. This method is only accurate for values between [-71476.0625f, 71476.0625f] for cosine and [-117435.992f, 117435.992f] for sine. The algorithm identifies elements outside this range and calls glibc in a scalar loop to compute their output. The algorithm is a vectorized version of the methods presented here: https://stackoverflow.com/questions/30463616/payne-hanek-algorithm-implementation-in-c/30465751#30465751 Accuracy: maximum ULP error = 1.49 Performance: The speed-up this implementation provides is dependent on the values of the input array. It performs best when all the input values are within the range specified above. Details of the performance boost are provided below. Its worst performance is when all the array elements are outside the range leading to about 1-2% reduction in performance. Three different benchmarking data are provided, each of which was benchmarked using timeit package in python. Each function is executed 1000 times and this is repeated 100 times. The standard deviation for all the runs was less than 2% of their mean value and hence not included in the data. (1) Micro-bencharking: Array size = 10000, Command = "%timeit np.cos([myarr])" |---------------+------------+--------+---------+----------+----------| | Function Name | NumPy 1.16 | AVX2 | AVX512 | AVX2 | AVX512 | | | | | | speed up | speed up | |---------------+------------+--------+---------+----------+----------| | np.cos | 1.5174 | 0.1553 | 0.06634 | 9.77 | 22.87 | | np.sin | 1.4738 | 0.1517 | 0.06406 | 9.71 | 23.00 | |---------------+------------+--------+---------+----------+----------| (2) Package ai.cs provides an API to transform spherical coordinates to cartesean system: Array size = 10000, Command = "%timeit ai.cs.sp2cart(r,theta,phi)" |---------------+------------+--------+--------+----------+----------| | Function Name | NumPy 1.16 | AVX2 | AVX512 | AVX2 | AVX512 | | | | | | speed up | speed up | |---------------+------------+--------+--------+----------+----------| | ai.cs.sp2cart | 0.6371 | 0.1066 | 0.0605 | 5.97 | 10.53 | |---------------+------------+--------+--------+----------+----------| (3) Package photutils provides an API to find the best fit of first and second harmonic functions to a set of (angle, intensity) pairs: Array size = 1000, Command = "%timeit fit_first_and_second_harmonics(E, data)" |--------------------------------+------------+--------+--------+----------+----------| | Function Name | NumPy 1.16 | AVX2 | AVX512 | AVX2 | AVX512 | | | | | | speed up | speed up | |--------------------------------+------------+--------+--------+----------+----------| | fit_first_and_second_harmonics | 1.598 | 0.8709 | 0.7761 | 1.83 | 2.05 | |--------------------------------+------------+--------+--------+----------+----------|
* | DOC:Add example to clarify "numpy.save" behavior on already open file #10445 ↵Omar Merghany2019-08-161-1/+12
| | | | | | | | | | (#14070) * DOC:Add example to clarify "numpy.save" behavior on already unclosed file
* | Merge pull request #14101 from lagru/zero_stat_lengthSebastian Berg2019-08-152-1/+31
|\ \ | | | | | | MAINT: Clearer error message while padding with stat_length=0
| * | MAINT: Clearer error while padding stat_length=0Lars Grueter2019-08-092-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | Provides a clearer error message if stat_length=0 is the cause of an exception (mean and median return nan with warnings) as well as tests covering this behavior. Note: This shouldn't change the behavior/API except for the content of the raised ValueError.
* | | ENH: Improve mismatch message of np.testing.assert_array_equal (#14203)Tim Hoffmann2019-08-152-7/+11
| | | | | | | | | | | | | | | The original message included "Mismatch: 33.3%". It's not obvious what this percentage means. This commit changes the text to "Mismatched elements: 1 / 3 (33.3%)".
* | | DOC: mention `take_along_axis` in `choose` (#14224)colinsnyder2019-08-151-7/+8
| | | | | | | | | * DOC: mention take_along_axis in choose
* | | Merge pull request #14270 from aleju/fix_exceptionCharles Harris2019-08-141-1/+1
|\ \ \ | | | | | | | | BUG: Fix formatting error in exception message
| * | | MAINT: Improve error message dtype appearancealeju2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This changes the string conversion of an expected dtype in an error message from e.g. "<class 'numpy.float64'>" to "float64".
| * | | BUG: Fix formatting error in exception messagealeju2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a simple formatting error in the generation of an exception message. The message is supposed to contain the expected vs. the actual dtype, but instead contained two times the expected dtype.
* | | | Merge pull request #14252 from maxwell-aladago/genfromtextCharles Harris2019-08-142-5/+10
|\ \ \ \ | | | | | | | | | | BUG: Fixes StopIteration error from 'np.genfromtext' for empty file with skip_header > 0
| * | | | fixes StopIteration error for empty file with skip_header > 0Maxwell Aladago2019-08-112-5/+10
| | | | |
* | | | | Merge pull request #14272 from thewtex/array-function-docsMatti Picus2019-08-141-3/+3
|\ \ \ \ \ | | | | | | | | | | | | DOC: Address typos in dispatch docs
| * | | | | DOC: Address typos in dispatch docsMatt McCormick2019-08-141-3/+3
|/ / / / /
* | | | | Merge pull request #14266 from mattip/remove-scipy.orgCharles Harris2019-08-131-1/+0
|\ \ \ \ \ | |_|/ / / |/| | | | DOC: remove scipy.org from the breadcrumb formattiong
| * | | | DOC: remove scipy.org from the breadcrumb formattiongmattip2019-08-131-1/+0
|/ / / /
* | | | DOC: Make Py3K docs C code snippets RST literal blocks (gh-14263)Peter Cock2019-08-131-20/+20
| | | |
* | | | Merge pull request #14204 from seberg/towncrier-renamingSebastian Berg2019-08-1216-89/+65
|\ \ \ \ | | | | | | | | | | DOC,MAINT: Move towncrier files and fixup categories
| * | | | DOC,MAINT: Move towncrier files and fixup categoriesSebastian Berg2019-08-1216-89/+65
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Name all categories as singular (or adjectives). Also move the fragments into an ``upcoming_changes`` folder to be more discoverable. Notes that we format some things as bullet points traditionally (right now towncrier only truly supports bullet point format, but I have a PR to fix that).
* | | | Merge pull request #14235 from mattip/link_numpyRalf Gommers2019-08-114-1/+15
|\ \ \ \ | |/ / / |/| | | DOC: add backlinks to numpy.org
| * | | DOC: add header to documentation pagesmattip2019-08-092-0/+10
| | | |
| * | | DOC: add backlinks to numpy.orgmattip2019-08-082-1/+5
| | | |
* | | | Merge pull request #14249 from rgommers/accept-nep28Ralf Gommers2019-08-101-2/+2
|\ \ \ \ | | | | | | | | | | DOC: set status of NEP 28 (website redesign) to Accepted
| * | | | DOC: set status of NEP 28 (website redesign) to AcceptedRalf Gommers2019-08-101-2/+2
|/ / / /
* | | | Merge pull request #14245 from guanqun/guanqun/typoMatti Picus2019-08-101-1/+1
|\ \ \ \ | | | | | | | | | | Doc: fix a typo in NEP21
| * | | | MAINT: fix a typoGuanqun Lu2019-08-101-1/+1
|/ / / /
* | | | Merge pull request #14073 from mattip/doc-releaseRalf Gommers2019-08-082-36/+56
|\ \ \ \ | | | | | | | | | | DOC: Doc release
| * | | | BUILD, DOC: add merge-doc target to update the numpy/doc repomattip2019-08-082-36/+56
| |/ / /
* | | | Merge pull request #14141 from KmolYuan/random_freeze_analysisCharles Harris2019-08-081-1/+6
|\ \ \ \ | | | | | | | | | | ENH: add c-imported modules for freeze analysis in np.random
| * | | | ENH: add c-imported modules for freeze analysis in np.randomYuan2019-07-281-1/+6
| | | | |
* | | | | Merge pull request #14234 from larsoner/fix-normCharles Harris2019-08-082-5/+10
|\ \ \ \ \ | |_|/ / / |/| | | | MAINT: Better error message for norm
| * | | | BUG: Better err message for normEric Larson2019-08-082-5/+10
|/ / / /
* | | | Merge pull request #14027 from rgommers/contributingRalf Gommers2019-08-081-0/+27
|\ \ \ \ | | | | | | | | | | DOC: update "Contributing to NumPy" with more activities/roles
| * | | | DOC: finish "contributing to NumPy" edits - w private list and Slack.Ralf Gommers2019-08-061-3/+5
| | | | |
| * | | | WIP: DOC: update "Contributing to NumPy" with more activities/rolesRalf Gommers2019-07-161-0/+25
| | | | |
* | | | | Merge pull request #14231 from mattip/sourceforgeRalf Gommers2019-08-084-13/+3
|\ \ \ \ \ | | | | | | | | | | | | DOC: update or remove outdated sourceforge links
| * | | | | DOC: update or remove outdated sourceforge linksmattip2019-08-084-13/+3
| | | | | |
* | | | | | Merge pull request #14069 from sameshl/doc_test_instructionsMatti Picus2019-08-082-0/+18
|\ \ \ \ \ \ | |/ / / / / |/| | | | | DOC: Emphasize the need to run tests when building from source
| * | | | | add -v for verbose which I had removed in the previous commitSamesh2019-07-241-1/+1
| | | | | |
| * | | | | change the command line argument for all testsSamesh2019-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | -v ---> -m full