Skip to content

Add SVML AVX512 FP16 content#2

Merged
r-devulap merged 4 commits into
numpy:mainfrom
r-devulap:fp16
Mar 9, 2023
Merged

Add SVML AVX512 FP16 content#2
r-devulap merged 4 commits into
numpy:mainfrom
r-devulap:fp16

Conversation

@r-devulap

@r-devulap r-devulap commented Mar 8, 2023

Copy link
Copy Markdown
Member

Open sourcing new content for FP16 umath functions based on AVX-512 FP16 ISA on Intel Sapphire Rapids. These were measured to be 140x faster than the scalar counterpart in NumPy (which required conversion to FP32 and back). These have max ULP error of 3.05 (detailed ULP error listed here: numpy/numpy#23351 (comment)).

FP16 Ufunc scalar FP16 (ms) AVX512 FP16 SVML (μs) Speed up on AVX-512 FP16 SPR
arctanh 8.58 31.5 272.4
tanh 7.38 27.1 272.3
cbrt 6.76 30.5 221.6
arcsinh 8.05 43.7 184.2
arctan 5.18 29.2 177.4
arccosh 7.41 48.2 153.7
arccos 4.94 33.3 148.3
cosh 5.02 34.2 146.8
arcsin 4.39 31.6 138.9
sinh 7.22 54.8 131.8
log10 4.11 31.7 129.7
sin 3.43 29.1 117.9
log1p 5.1 43.3 117.8
cos 3.38 32.2 105.0
log 2.63 29.8 88.3
tan 5.78 68.9 83.9
log2 2.31 30.3 76.2
expm1 4.89 65.0 75.2
exp 2.14 28.9 74.0
exp2 2.08 28.8 72.2

@r-devulap r-devulap requested a review from seberg March 8, 2023 20:08
@r-devulap

Copy link
Copy Markdown
Member Author

@seberg Any objection to adding these new content?

@seberg seberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to add (please go ahead if it helps with the other PR), seems "small" compared to the rest anyway. The NumPy PR should be the one where to discuss.

I am slightly hesitant about the order of things, but probably it doesn't matter. I.e. it would be nice to have have basic support for faster half before adding AVX512.

@seberg

seberg commented Mar 9, 2023

Copy link
Copy Markdown
Member

Ah, nvm. I didn't realize we already did other speedups here anyway.

@r-devulap

Copy link
Copy Markdown
Member Author

Sounds good, thanks.

@r-devulap r-devulap merged commit 86f9647 into numpy:main Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants