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

Optimized pillow-simd needed to leverage new GPU instances #212

Open
jph00 opened this issue May 15, 2018 · 14 comments
Open

Optimized pillow-simd needed to leverage new GPU instances #212

jph00 opened this issue May 15, 2018 · 14 comments
Assignees

Comments

@jph00
Copy link

jph00 commented May 15, 2018

(Copied from https://www.kaggle.com/dansbecker/running-kaggle-kernels-with-a-gpu/code#328307 as requested by @sebbov ).

With the limited CPU available, being able to quickly read and manipulate images is important. Can I suggest you install pillow-simd with an optimized jpeg library? It will reduce CPU use by around 2-4x when training models, which will dramatically increase the utility of these new instances. The step by step instructions for installing it have been kindly provided by Soumith Chintala here (note that without these exact steps pillow-simd will not use libjpeg-turbo, even if you have it installed as your system libjpeg):

https://gist.github.com/soumith/01da3874bf014d8a8c53406c2b95d56b

I'm not familiar enough with docker to know what PR to send in exactly - hopefully this is enough info for the in-house experts to set it up.

@ghost
Copy link

ghost commented May 17, 2018

@jph00 This is great - thank you for the suggestion! After a quick glance at the step-by-step instructions, I believe there are some potential PATH conflicts with our current setup. I'll work with it and keep you updated!

@jph00
Copy link
Author

jph00 commented May 17, 2018

Terrific! @crawforc3, in the meantime, any chance you could update Kaggle kernels to use the latest version of the fastai library (0.7)? (I don't see any info about how often pip packages are updated, or if anything needs to be done to make that happen.)

Once you've done that, I can start making some fastai examples available as kaggle kernels.

@ghost
Copy link

ghost commented May 18, 2018

@jph00 As long as fastai is up-to-date in pip you are good to go. When we build our docker image, it pulls the most recent packages and we try to update our docker images at least nightly.

Sadly, the current docker image in production is about two weeks old. We ran into some problems with "updated" packages that have been preventing a stable build. However, I am delighted to say that I think we have a stable build this morning. After some testing I will try to get it pushed into production.

@ghost
Copy link

ghost commented May 18, 2018

@jph00 fastai 0.7.0 is now live in kernels. Please let us know if you run into any issues.

@jph00
Copy link
Author

jph00 commented May 18, 2018 via email

@whtahy
Copy link

whtahy commented May 25, 2018

@crawforc3 Followup re fastai: GPU kernels are currently pytorch 0.3.1 + fastai 0.6. Does the cuda branch need a pull request on this? (Should I open a new issue?) Thanks for your help!

@ghost
Copy link

ghost commented Aug 14, 2018

Closing this because we are working on merging the GPU and non-GPU images which will solve this problem.

@ghost ghost closed this as completed Aug 14, 2018
@jph00
Copy link
Author

jph00 commented Aug 14, 2018

@crawforc3 this issue is about pillow-simd which isn't directly related to that. Perhaps reopen so we can track that issue?

@ghost
Copy link

ghost commented Aug 14, 2018

That is a valid point! Re-opened :)

@ghost ghost reopened this Aug 14, 2018
@rosbo rosbo self-assigned this Aug 14, 2018
@rosbo
Copy link
Contributor

rosbo commented Oct 5, 2021

pillow-simd hasn't been updated for 2 year and is lagging behind the pillow library (3.x vs 8.x). You can install it in your notebook via pip install if you need it.

Thank you

@rosbo rosbo closed this as completed Oct 5, 2021
@jph00
Copy link
Author

jph00 commented Jun 20, 2022

@rosbo @crawforc3 I wonder if you'd consider reopening this? pillow-simd it now at version 9. It's hard and slow to install via pip - it requires using custom flags to compile with avx2 extensions, and care must be taken to ensure that it uses libjpeg-turbo (see the link I provided in the top post). In code competitions internet isn't available, making this even more complicated.

@jph00
Copy link
Author

jph00 commented Jun 20, 2022

cc @sebbov

@rosbo
Copy link
Contributor

rosbo commented Jun 21, 2022

Hi @jph00,

pillow-simd is currently at 9.0.0 while pillow is at 9.1.1.

I looked at our dependencies and they only require Pillow 8+.

I am not a PIL expert and use it only for basic use cases. @jph00, do see any changes for > 9.0.0 that are worthwhile and we would be missing? https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst

Thank you

@jph00
Copy link
Author

jph00 commented Jun 21, 2022 via email

@rosbo rosbo reopened this Jun 22, 2022
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

No branches or pull requests

3 participants