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

Add SIMD support by turning on/off global option #5791

Closed
jjangga0214 opened this issue Oct 23, 2021 · 6 comments
Closed

Add SIMD support by turning on/off global option #5791

jjangga0214 opened this issue Oct 23, 2021 · 6 comments

Comments

@jjangga0214
Copy link

jjangga0214 commented Oct 23, 2021

Hi!

I know pillow deliberately has not included SIMD, as pillow is used from various architectures, and selectively compiling is hard.

What if, even if the package size can become larger, pillow provides a (programmatic or env var) global option which can be turned on/off in runtime. Users should turn on/off by their own explicit decision by understanding their own system.

This way, the library does not have to care if the system is compatible or not. The decision would be up to the user.

How do you think?

Thanks.

@radarhere
Copy link
Member

Hi. I know this doesn't explicitly answer your question, but just to check, you are aware of https://github.com/uploadcare/pillow-simd / https://pypi.org/project/Pillow-SIMD ?

@jjangga0214
Copy link
Author

jjangga0214 commented Oct 24, 2021

@radarhere yeah I am. The package is no longer maintained(already 1 major version behind), and the maintainer does not respond.

And I am negative to drop-in replacement-style package, as overriding transitive dependency would be hard.

For instance, let's say we use a package named foo and it transitively depends on pillow.

foo -> bar -> pillow 7.1.2

To enhance performance, we should replace the pillow with pillow-simd of the same version(7.1.2)(or at least ^7.1.2 in case of semver).
Not only is manually doing so cumbersome, automatic replacement would be hard to be elegant (As far as I know, popular package managers(e.g. pipenv, poetry, pdm, pyflow) do not have such a feature.)

That's why I want a global switch option (programmatic and/or env var).

@radarhere radarhere changed the title feat: add simd support by turning on/off global option Add SIMD support by turning on/off global option Nov 1, 2021
@radarhere
Copy link
Member

Just looping in @homm on this one, since he is the expert.

@homm
Copy link
Member

homm commented Nov 10, 2021

Many including me would like to have SIMD support in Pillow out of the box, but there is still no solution which could suit everyone. Discussion: uploadcare#8

The package is no longer maintained(already 1 major version behind)

There are some problems with applying SIMD patches atop of the current Pillow versions, the biggest of them is massive C code reformatting happened in latest Pillow versions. So it needs several days of my work, but eventually, it will happen.

As far as I know, popular package managers(e.g. pipenv, poetry, pdm, pyflow) do not have such a feature.

So this is the real issue at this point? Is there any discussion in any of this repositories?

@radarhere
Copy link
Member

radarhere commented Jan 17, 2022

Fyi, Pillow SIMD is no longer a version behind.

Oh, and see also https://github.com/uploadcare/pillow-simd#why-do-not-contribute-simd-to-the-original-pillow

@radarhere
Copy link
Member

I think this matter is better served by the issue in Pillow SIMD - uploadcare#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants