libffcv / ffcv

FFCV: Fast Forward Computer Vision (and other ML workloads!)
https://ffcv.io
Apache License 2.0
2.86k stars 180 forks source link

Add MacOS support #65

Closed javirk closed 2 years ago

javirk commented 2 years ago

Edit: Resolves #51

Attempt to fix OSError in MacOS: OSError: dlopen(libc.so.6, 0x0006): tried: '/Users/**/opt/anaconda3/envs/ffcv/lib/python3.9/lib-dynload/../../libc.so.6' (no such file), '/Users/**/opt/anaconda3/envs/ffcv/bin/../lib/libc.so.6' (no such file), 'libc.so.6' (no such file), '/usr/local/lib/libc.so.6' (no such file), '/usr/lib/libc.so.6' (no such file), '/Users/**/libc.so.6' (no such file), '/usr/local/lib/libc.so.6' (no such file), '/usr/lib/libc.so.6' (no such file)

GuillaumeLeclerc commented 2 years ago

Thanks! looks good to me but I'll ask @andrewilyas or @lengstrom to just check that it works for them (I don't have a MacOs machine)

GuillaumeLeclerc commented 2 years ago

Hi, thank you for the pull request! Is it still cross compatible with with linux or does it only work on MacOS (Sorry I'm not in front of a computer to try myself)

GuillaumeLeclerc commented 2 years ago

@Hadisalman Do you have some cycles to try this branch since you have fresh installs available through docker now ?

Hadisalman commented 2 years ago

The fix works fine on MacOS and Linux. Though on MacOS, I am getting some errors when testing some example codes (e.g. cifar10 example code).

@javirk did you test beyond installing/importing ffcv?

javirk commented 2 years ago

Hello, I didn't test beyond the installation. Now I see I also have problems with the multiprocessing in cifar10 example code. I will look at it in the following days and see if I can fix it.

GuillaumeLeclerc commented 2 years ago

@javirk I think the problem might come from the fact that pread call to libc has a different signature. Unfortunately it will fail silently as there is no type checking when calling ABIs

GuillaumeLeclerc commented 2 years ago

I don't have a Mac so I won't be able to make it work. I'll close this until someone is able to troubleshoot the bugs.