GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — ENH, SIMD: Optimize the hyperbolic implementation based on Highway wr… by ixgbe · Pull Request #29211 · numpy/numpy Conversation
|
| Change | Before [4cbc8003] <main~1> | After [bbe89a87] | Ratio | Benchmark (Parameter) |
|---|---|---|---|---|
| - | 1.10±0.3ms | 664±10μs | 0.6 | bench_ufunc.TanhSpecific.time_DOUBLE_tanh |
| - | 944±300μs | 226±30μs | 0.24 | bench_ufunc.TanhSpecific.time_FLOAT_tanh |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…apper Signed-off-by: Wang Yang <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Review based on just the first glance. AFAIK: we need HWY_ATTR for all the functions that use highway ops. From highway docs: each function that calls Highway ops (such as Load) must either be prefixed with HWY_ATTR...
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| [ | ||
| AVX512_SKX, [AVX2, FMA3], | ||
| VSX4, VSX2, | ||
| VSX2, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why remove VSX4?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
During the build process on PPC64LE, the compiler command for the VSX4 dispatch target contains conflicting CPU flags. The build system seems to be appending the target-specific -mcpu=power10 flag without overriding the base -mcpu=power9 flag that was likely set for the baseline build. This results in a command with mutually exclusive options (-mcpu=power9 and -mcpu=power10), which causes the compiler to fail with a target specific option mismatch error during function inlining. Could you please confirm if this is a known issue or a bug in the Meson build configuration for ppc64le?Thanks !
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why remove VSX4?
Hi, @r-devulap
Before my modification, NPY_SIMD_F64 was used to control DOUBLE_tanh. For VSX4, the macro NPY_SIMD_F64 evaluates to 0, so DOUBLE_tanh was implemented using scalar code. Therefore, no compilation error occurred.
After my modification, I switched to using NPY_HWY_F64 to control DOUBLE_tanh. For VSX4, NPY_HWY_F64 evaluates to 1, so DOUBLE_tanh is implemented using vectorized code. However, when compiling on a Power9 system (with -mcpu=power9), calling hwy::N_PPC10 functions leads to a compilation error due to target-specific option mismatches.
Therefore, removing VSX4 from numpy/_core/meson.build results in behavior consistent with the original implementation before my change.

https://www.ibm.com/support/pages/node/7155156
CI use gcc11.4 now , however processor is Power9 used by CI.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
As per below points:
So, I try to explicitly limit dispatch to Power9-compatible features in #27402
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| HWY_ATTR NPY_FINLINE vtype | ||
| load_vector(type_t* src, npy_intp ssrc, npy_intp len){ | ||
| auto D = hn::DFromV<vtype>(); | ||
| HWY_INLINE vtype load_vector(type_t* src, npy_intp ssrc, npy_intp len){ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it require HWY_ATTR?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| HWY_ATTR NPY_FINLINE void | ||
| store_vector(vtype vec, type_t* dst, npy_intp sdst, npy_intp len){ | ||
| auto D = hn::DFromV<vtype>(); | ||
| HWY_INLINE void store_vector(vtype vec, type_t* dst, npy_intp sdst, npy_intp len){ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same here: don't we need HWY_ATTR?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.