[SasView Users] Issue fitting with a GPU in SasView 5.0.5

Stephen King - STFC UKRI via users users at lists.sasview.org
Fri Sep 2 11:44:26 EDT 2022


Dear SasView Users,

We have become aware of an issue in the latest SasView 5.0.5 with the new Levenberg-Marquardt (LM) optimiser - the default optimiser - when you are fitting with a GPU enabled. Specifically, if the model you are fitting against contains C code, either embedded in the Python model file or in an ancillary C model file, then nothing happens when you click Fit! The parameters in the FitPage do not update and the fit to the data does not change. You must specifically enable GPU computations, if required, else they are performed on the CPU. So this is a very obvious bug and the chances that you have obtained incorrect results as a consequence are very low.

In contrast, if you are only using the CPU (the default condition), or if the model you are fitting is a pure Python model, then this new LM optimiser still works as expected. And if you are using an earlier version of SasView then the old LM optimiser works with a GPU.

But if you need to use a GPU for your fitting in SasView 5.0.5 then the workaround is simply to select a different optimiser from Fitting > Fit Algorithms. See https://www.sasview.org/docs/user/qtgui/Perspectives/Fitting/optimizer.html for more information.

For the technically-minded, this issue has arisen because we changed the source library for the LM optimiser from SciPy to MPFit. We did this because the SciPy version did not respect parameter bounds during fitting; something which several of you had complained about! Unfortunately, the fact that the MPFit version did not support parallelisation escaped our notice!

To tell if your model uses C code, go to https://github.com/SasView/sasmodels/tree/master/sasmodels/models. If there are .py and .c files with the same filename then the model will be affected by this bug. This is, unfortunately, the majority of the library models.


The SasView Development Team


This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sasview.org/pipermail/users/attachments/20220902/d930292f/attachment-0001.html>


More information about the users mailing list