| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
ENH: Use AVX for float32 implementation of np.exp & np.log
|
| | |
|
| |
| |
| |
| | |
Added a missing NPY_HAVE_SSE2_INTRINSICS guard
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1) use __builtin_cpu_supports("avx512f") only for gcc ver >= 5
2) Introduced two new macro's:
HAVE_ATTRIBUTE_TARGET_@ISA@_WITH_INTRINSICS for ensuring compiler can
compile functions that use intrinsics and are compiled with avx2/avx512f
attributes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
clang6.0 fails to compile this code:
__asm__ __volatile__ (
"vpaddd %zmm1, %zmm2, %zmm3\n\t"
);
Note that this is a known issue in clang6.0. clang7.0 and gcc does not
have this problem. This fails to set the flag HAVE_LINK_AVX512F. Hence,
the AVX512F version of exp and log doesn't get built. If AVX512F is
detected during runtime, instead of choosing to run the AVX2 version, it
will end up running scalar version.
|
| |
| |
| |
| |
| |
| |
| | |
1) Got rid of @isa@_cmp_mask helper function, since clang expects the
compare operator in _mm@vsize@_cmp_ps to be a compile time constant
2) Converted all helper functions to static functions
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit implements vectorized single precision exponential and
natural log using AVX2 and AVX512.
Accuracy:
| Function | Max ULP Error | Max Relative Error |
|----------|---------------|--------------------|
| np.exp | 2.52 | 2.1E-07 |
| np.log | 3.83 | 2.4E-07 |
Performance:
(1) Micro-benchmarks: measured execution time of np.exp and np.log 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. The
vectorized implementation was upto 7.6x faster than the scalar version.
| Function | NumPy1.16 | AVX2 | AVX512 | AVX2 speedup | AVX512 speedup |
| -------- | --------- | ------ | ------ | ------------ | -------------- |
| np.exp | 0.395s | 0.112s | 0.055s | 3.56x | 7.25x |
| np.log | 0.456s | 0.147s | 0.059s | 3.10x | 7.64x |
(2) Logistic regression: exp and log are heavily used in training neural
networks (as part of sigmoid activation function and loss function
respectively). This patch significantly speeds up training a logistic
regression model. As an example, we measured how much time it takes to
train a model with 15 features using 1000 training data points. We
observed a 2x speed up to train the model to achieve a loss function
error < 10E-04.
| Function | NumPy1.16 | AVX2 | AVX512 | AVX2 speedup | AVX512 speedup |
| -------------- | ---------- | ------ | ------ | ------------ | -------------- |
| logistic.train | 121.0s | 75.02s | 60.60s | 1.61x | 2.02x |
|
|\
| |
| | |
ENH: preserve subclasses in ufunc.outer
|
| |
| |
| |
| |
| |
| |
| |
| | |
* use an instance check to avoid
complications with the matrix subclass
* add unit test for allowing subclass
passthrough in ufunc.outer
|
| | |
|
|\ \
| | |
| | | |
ENH: Implement `np.floating.as_integer_ratio`
|
| | | |
|
| | |
| | |
| | |
| | | |
This matches the builtin `float.as_integer_ratio` and (in recent python versions) `int.as_integer_ratio`.
|
|\ \ \
| | | |
| | | | |
ENH: `isfinite` support for `datetime64` and `timedelta64`
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | | |
`datetime64` and `timedelta64`
|
| | | | |
| | | | |
| | | | |
| | | | | |
as per code review to `noobj`
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Added test: test_datetime.TestDateTime.test_isfinite.
It just checks the reverse of test_isnat.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
I am not quite sure whether this should be done somewhat more elegant
especially with the typeresolver.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
BUG: Raise when unravel_index, ravel_multi_index are given empty input
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
clarify error msg
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
TST: Added test_fftpocket.py::test_axes
|
| | |_|_|_|/
| |/| | | |
| | | | | |
| | | | | |
| | | | | | |
Test for ND transforms with axes for invariance of
permutation of axes.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
DOC: add more info to failure message
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| |_|/ / / / /
|/| | | | | | |
BUG: Make allow_pickle=False the default for loading
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
a partial mitigation of #12759.
see also https://nvd.nist.gov/vuln/detail/CVE-2019-6446
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
DOC: Add docstrings for consistency in aliases
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
BUG/MAINT: Tidy typeinfo.h and .c
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
* Add missing headers that happened to be included before this file
* Fix accidentally exported symbols
* Move registering types in `multiarray.__dict__` to the source file that creates the types
* Add missing error checking to make up for PyStructSequence_InitType2 not being available
|
|\ \ \ \ \ \ \ \ \
| |_|_|/ / / / / /
|/| | | | | | | | |
BUG: Return the coefficients array directly
|
| |\ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
DOC, BLD: fix doc build issues in preparation for the next numpydoc release
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Addresses review comment by @eric-wieser.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
2 for polyfit rankwarning, 2 for divide by zero in log10.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
These ones just generated warnings, not build failures
|
| | | | | | | | | | |
|
| | |_|/ / / / / /
| |/| | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
It used a sentence rather than an object to cross-reference.
numpydoc grew more picky (see
https://github.com/numpy/numpydoc/issues/206), so cleaning this up.
It was already not rendering correctly in html.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
BUG: Close files if an error occurs in genfromtxt
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Mostly indentation changes
Fixes gh-13200
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
DOC: Add as_ctypes_type to the documentation
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
This is mentioned in the release notes, so probably should be discoverable.
Change those mentions to links.
Fix the docstring to not cause sphinx to emit warnings.
|
|\ \ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
DOC: Added anti-diagonal examples to np.diagonal and np.fill_diagonal
|
| | | | | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \ \ \
| |_|/ / / / / / / / / /
|/| | | | | | | | | | | |
MAINT: Tidy up error message for accumulate and reduceat
|