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 gpu test on osx #667

Closed
wants to merge 8 commits into from
Closed

add gpu test on osx #667

wants to merge 8 commits into from

Conversation

wxchan
Copy link
Contributor

@wxchan wxchan commented Jul 1, 2017

@wxchan
Copy link
Contributor Author

wxchan commented Jul 1, 2017

@guolinke @huanzhang12 all the test case fail with error lightgbm.basic.LightGBMError: b'Invalid Work Group Size'. Do you know how to fix it?

@huanzhang12
Copy link
Contributor

@wxchan On OSX, for the CPU target, Apple's OpenCL implementation only supports a trivial work group size of [1,1,1]. The GPU kernels in LightGBM requires a work group size of [1,1,256], thus it is impossible to run them on the CPU target using Apple's OpenCL. Apple has no intention to fix this.

One possible way to automatically test the GPU code is to install pocl on OSX, as suggested here:
clMathLibraries/clFFT#84

@guolinke
Copy link
Collaborator

guolinke commented Jul 9, 2017

@wxchan any plan to fix this ?

@wxchan
Copy link
Contributor Author

wxchan commented Jul 9, 2017

@guolinke didn't figure out how to fix it yet. The same procedure works on my mac.

@huanzhang12
Copy link
Contributor

@wxchan On a real Mac, OpenCL can run on a real GPU (intel/nvidia), so it works. But in travisCI, there is no real GPU; only the CPU OpenCL device can be used. Apple's default OpenCL CPU driver is very limited and is not compatible with the GPU code.

You can try to install pocl (an open source OpenCL implementation for CPU device) on your Mac and see if that works. If it works, you can try to put it into travis.

@wxchan
Copy link
Contributor Author

wxchan commented Jul 13, 2017

@huanzhang12 thanks for explanation. Do you know how to use installed pocl instead of origin OpenCL? It still uses default /System/Library/Frameworks/OpenCL.framework.

@huanzhang12
Copy link
Contributor

@wxchan I have no idea on how it works on OSX. However I think in general we should link lightgbm against the newly compiled pocl instead of system OpenCL, and probably set up environment variable like DYLD_LIBRARY_PATH before running.

@wxchan
Copy link
Contributor Author

wxchan commented Jul 16, 2017

I don't have much time working on this recently. Close it for now.

I think it's a little complex to use pocl, it requires installing several dependencies. The total test time is often over 20 mins before running test cases.

@wxchan wxchan closed this Jul 16, 2017
@Laurae2 Laurae2 mentioned this pull request Oct 1, 2017
@huanzhang12 huanzhang12 mentioned this pull request Aug 15, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Mar 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants