Skip to content

Conversation

@NicolasHug
Copy link
Member

No description provided.

@NicolasHug
Copy link
Member Author

NicolasHug commented Jun 4, 2021

From the logs it looks like linux is using jpeg-9b-h024ee3a_2, macos is using jpeg-9b-he5867d9_2 and windows is using jpeg-9b-hb83a4c4_2.

So they're all 9b versions clearly, but looking at https://anaconda.org/anaconda/jpeg/files?sort=time&sort_order=desc&version=9b the windows binary is 1.5 years older than the linux and the macos ones... which seems a bit fishy. It's possible that the linux/macos versions contains patches or fixes that the windows version doesn't have.

CC @fmassa , any thought?

@NicolasHug
Copy link
Member Author

That being said I still don't know how to verify which version is used by torchvision and by PIL 🤔

@fmassa
Copy link
Member

fmassa commented Jun 4, 2021

From the logs it looks like linux is using jpeg-9b-h024ee3a_2, macos is using jpeg-9b-he5867d9_2 and windows is using jpeg-9b-hb83a4c4_2.

Thanks for checking this!

the windows binary is 1.5 years older than the linux and the macos ones... which seems a bit fishy

that is interesting. Yeah, that definitely looks suspicious.

That being said I still don't know how to verify which version is used by torchvision and by PIL 🤔

We could probably add a method like

int64_t cuda_version() {
#ifdef WITH_CUDA
return CUDA_VERSION;
#else
return -1;
#endif
that prints the jpeg version.

Something like

torchvision.io._print_jpeg_version()

But there might be an easier way if we ssh into the CI

EDIT: Looks like we might want to use JPEG_LIB_VERSION

@NicolasHug
Copy link
Member Author

NicolasHug commented Jun 4, 2021

Thanks a lot for the help @fmassa . As we suspected, the libjpeg version on Windows CI jobs is different for PIL and for torchvision:

python -c "from PIL import _imaging; print(_imaging.jpeglib_version)"
8.0
python -c "import torch; import torchvision; print(torch.ops.torchvision._jpeg_version())"
90

on the linux job, it is the same:

(/root/project/env) [root@4d1d2d6edd3d project]# python -c "from PIL import _imaging; print(_imaging.jpeglib_version)"
9.0
(/root/project/env) [root@4d1d2d6edd3d project]# python -c "import torch; import torchvision; print(torch.ops.torchvision._jpeg_version())"
90

EDIT: interestingly enough: In both windows and linux we get the exact same pil version

conda list | grep pil
pillow                    8.2.0                    pypi_0    pypi

So the same pil 8.2.0 version uses a different libjpeg backend version for linux and for windows

@fmassa
Copy link
Member

fmassa commented Jun 4, 2021

Awesome, thanks for the investigation @NicolasHug !

This means that we are consistent on our side. Maybe we can open an issue in PIL to mention that they use different versions of libjpeg depending on the OS?

@NicolasHug
Copy link
Member Author

Oh:

On windows:

python -c "from PIL import features; print(features.check_feature('libjpeg_turbo'))"
True

On linux:

python -c "from PIL import features; print(features.check_feature('libjpeg_turbo'))"
False

@NicolasHug
Copy link
Member Author

Closing this, I followed up in #3913

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants