MATLAB Answers

Can I process 'fit' with a GPU?

35 views (last 30 days)
Just tried running a test.
gX = randi(100,10,1,'gpuArray');
gY = randi(100,10,1,'gpuArray');
[a,b] = fit(gX,gY,'exp1');
gather(a,b);
and all I get is the error...
LSQCURVEFIT requires the following inputs to be of data type double: 'X0','YDATA'.
Is there any way to run 'fit' on the GPU (GTX 1080)?
Thanks.

Accepted Answer

Joss Knight
Joss Knight on 8 Dec 2018
No, there isn't, but other options may be adaptable to your problem.
  1 Comment
Kris Hoffman
Kris Hoffman on 8 Dec 2018
Will this become a feature in future iterations of MATLAB?

Sign in to comment.

More Answers (1)

Joss Knight
Joss Knight on 9 Dec 2018
We plan to accelerate the rate at which we provide improved coverage for gpuArray support in MATLAB Toolboxes, including Stats and Optim. Since these features are customer requested, they will be higher priority.
  10 Comments
Adrian Bondy
Adrian Bondy on 13 Oct 2019
It's pretty embarrassing that essentially none of the fitting functions in matlab (for doing regression, generalized linear models, gradient descent, etc) support gpuArray inputs. gpuArrays have been part of Matlab for many years and there is no reason these functions couldn't support this input. It took me literally fifteen minutes to make glmfit support gpuArray input and it speeds up fitting by a factor of 5. The core computation for fitting linear models is a QR decomposition which is ALREADY supported to gpuArrays. SMH.

Sign in to comment.

Products


Release

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!