Skip to content

opencl memory errors during fits (Trac #1015) #1084

@pkienzle

Description

@pkienzle

The following OpenCL memory error was reported from !SasView. This may be because sasview_model.py (calculate_Iq) is allocating a new q vector each time the model is evaluated rather than reusing the same q vector across all fits. Restructuring the calculator so that the q values are held for the life of the model may fix the error.

2017-10-23 17:39:12 : Traceback (most recent call last):
 File "sas/sasgui/perspectives/fitting/fit_thread.pyc", line 82, in compute
 File "sas/sasgui/perspectives/fitting/fit_thread.pyc", line 14, in map_apply
 File "sas/sasgui/perspectives/fitting/fit_thread.pyc", line 11, in map_getattr
 File "sas/sascalc/fit/BumpsFitting.pyc", line 289, in fit
 File "sas/sascalc/fit/BumpsFitting.pyc", line 202, in theory
 File "sas/sascalc/fit/BumpsFitting.pyc", line 192, in _recalculate
 File "sas/sascalc/fit/AbstractFitEngine.pyc", line 242, in residuals
 File "/Users/lionel/.sasview/plugin_models/Cyl_CS_sphere.py", line 272, in evalDistribution
 File "/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/sasmodels/sasview_model.py", line 582, in evalDistribution
 File "/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/sasmodels/sasview_model.py", line 617, in calculate_Iq
 File "/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/sasmodels/sasview_model.py", line 638, in _calculate_Iq
 File "/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/sasmodels/kernelcl.py", line 567, in __call__
 File "/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/pyopencl/__init__.py", line 1088, in kernel_call
 File "<generated function enqueue_knl_cylinder_Iq>", line 169, in enqueue_knl_cylinder_Iq
LogicError: when processing argument #233 (1-based): clsetkernelarg failed: INVALID_MEM_OBJECT

=== Steps: 161 of 159  chisq: 70.4  ETA: -86s
  M2.p2_radius: 71.5       | M2.p2_sld_shell: -0.108     | M2.p2_thickness: 75.8      
   M1.p1_scale: 0.000499   | M1.p1_sld_solvent: 1.38       |    M1.p2_radius: 136       
M1.p2_radius.width: 0.851      |     M1.p2_scale: 0.0181     |  M1.p2_sld_core: 2.08      
M1.p2_thickness: 14.1       |    M4.p2_radius: 64.8       | M4.p2_sld_shell: -0.0451   
M4.p2_thickness: 79.6       |    M3.p2_radius: 69         | M3.p2_sld_shell: -0.199    
M3.p2_thickness: 83.7       | M3.p2_thickness.width: 0.794      |  
2017-10-23 17:42:59 : Traceback (most recent call last):
 File "sas/sascalc/data_util/calcthread.pyc", line 268, in _run
LogicError: when processing argument #233 (1-based): clsetkernelarg failed: INVALID_MEM_OBJECT

	2017-10-23 17:43:49 : ('   0.357', '   0.697')
	2017-10-23 17:43:50 : ('   0.357', '   0.697')
	2017-10-23 17:43:51 : ('   0.505', '      15')
	2017-10-23 17:43:51 : ('   0.505', '      15')
	2017-10-23 17:43:55 : ('  0.0847', '   0.268')
	2017-10-23 17:43:55 : ('  0.0847', '   0.268')
	2017-10-23 17:45:05 : Computation  completed!
	2017-10-23 17:45:07 : Computation  completed!
	2017-10-23 17:45:20 : Computation  completed!
	2017-10-23 17:45:21 : Computation  completed!
	2017-10-23 17:45:22 : Computation  completed!
	2017-10-23 17:45:25 : Computation  completed!
	2017-10-23 17:45:26 : Computation  completed!
	2017-10-23 17:45:27 : Computation  completed!
	2017-10-23 17:45:29 : Computation  completed!
	2017-10-23 17:45:40 : Computation  completed!
	2017-10-23 17:45:45 : Computation  completed!
	2017-10-23 17:46:15 : Computation  completed!
	2017-10-23 17:48:42 : Fitting is in progress...
	2017-10-23 17:48:42 : Fitting is in progress...
	2017-10-23 17:48:42 : Traceback (most recent call last):
 File "sas/sasgui/perspectives/fitting/fit_thread.pyc", line 82, in compute
 File "sas/sasgui/perspectives/fitting/fit_thread.pyc", line 14, in map_apply
 File "sas/sasgui/perspectives/fitting/fit_thread.pyc", line 11, in map_getattr
 File "sas/sascalc/fit/BumpsFitting.pyc", line 275, in fit
 File "sas/sascalc/fit/BumpsFitting.pyc", line 375, in run_bumps
AttributeError: 'FitDriver' object has no attribute 'fitter'

None 

Migrated from http://trac.sasview.org/ticket/1015

{
    "status": "new",
    "changetime": "2019-03-29T00:07:14",
    "_ts": "2019-03-29 00:07:14.288941+00:00",
    "description": "The following OpenCL memory error was reported from !SasView.  This may be because sasview_model.py (calculate_Iq) is allocating a new q vector each time the model is evaluated rather than reusing the same q vector across all fits.  Restructuring the calculator so that the q values are held for the life of the model may fix the error.\n\n{{{\n2017-10-23 17:39:12 : Traceback (most recent call last):\n File \"sas/sasgui/perspectives/fitting/fit_thread.pyc\", line 82, in compute\n File \"sas/sasgui/perspectives/fitting/fit_thread.pyc\", line 14, in map_apply\n File \"sas/sasgui/perspectives/fitting/fit_thread.pyc\", line 11, in map_getattr\n File \"sas/sascalc/fit/BumpsFitting.pyc\", line 289, in fit\n File \"sas/sascalc/fit/BumpsFitting.pyc\", line 202, in theory\n File \"sas/sascalc/fit/BumpsFitting.pyc\", line 192, in _recalculate\n File \"sas/sascalc/fit/AbstractFitEngine.pyc\", line 242, in residuals\n File \"/Users/lionel/.sasview/plugin_models/Cyl_CS_sphere.py\", line 272, in evalDistribution\n File \"/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/sasmodels/sasview_model.py\", line 582, in evalDistribution\n File \"/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/sasmodels/sasview_model.py\", line 617, in calculate_Iq\n File \"/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/sasmodels/sasview_model.py\", line 638, in _calculate_Iq\n File \"/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/sasmodels/kernelcl.py\", line 567, in __call__\n File \"/Applications/SasView 4.1.app/Contents/Resources/lib/python2.7/pyopencl/__init__.py\", line 1088, in kernel_call\n File \"<generated function enqueue_knl_cylinder_Iq>\", line 169, in enqueue_knl_cylinder_Iq\nLogicError: when processing argument #4 (1-based): clsetkernelarg failed: INVALID_MEM_OBJECT\n\n=== Steps: 161 of 159  chisq: 70.4  ETA: -86s\n  M2.p2_radius: 71.5       | M2.p2_sld_shell: -0.108     | M2.p2_thickness: 75.8      \n   M1.p1_scale: 0.000499   | M1.p1_sld_solvent: 1.38       |    M1.p2_radius: 136       \nM1.p2_radius.width: 0.851      |     M1.p2_scale: 0.0181     |  M1.p2_sld_core: 2.08      \nM1.p2_thickness: 14.1       |    M4.p2_radius: 64.8       | M4.p2_sld_shell: -0.0451   \nM4.p2_thickness: 79.6       |    M3.p2_radius: 69         | M3.p2_sld_shell: -0.199    \nM3.p2_thickness: 83.7       | M3.p2_thickness.width: 0.794      |  \n2017-10-23 17:42:59 : Traceback (most recent call last):\n File \"sas/sascalc/data_util/calcthread.pyc\", line 268, in _run\nLogicError: when processing argument #4 (1-based): clsetkernelarg failed: INVALID_MEM_OBJECT\n\n\t2017-10-23 17:43:49 : ('   0.357', '   0.697')\n\t2017-10-23 17:43:50 : ('   0.357', '   0.697')\n\t2017-10-23 17:43:51 : ('   0.505', '      15')\n\t2017-10-23 17:43:51 : ('   0.505', '      15')\n\t2017-10-23 17:43:55 : ('  0.0847', '   0.268')\n\t2017-10-23 17:43:55 : ('  0.0847', '   0.268')\n\t2017-10-23 17:45:05 : Computation  completed!\n\t2017-10-23 17:45:07 : Computation  completed!\n\t2017-10-23 17:45:20 : Computation  completed!\n\t2017-10-23 17:45:21 : Computation  completed!\n\t2017-10-23 17:45:22 : Computation  completed!\n\t2017-10-23 17:45:25 : Computation  completed!\n\t2017-10-23 17:45:26 : Computation  completed!\n\t2017-10-23 17:45:27 : Computation  completed!\n\t2017-10-23 17:45:29 : Computation  completed!\n\t2017-10-23 17:45:40 : Computation  completed!\n\t2017-10-23 17:45:45 : Computation  completed!\n\t2017-10-23 17:46:15 : Computation  completed!\n\t2017-10-23 17:48:42 : Fitting is in progress...\n\t2017-10-23 17:48:42 : Fitting is in progress...\n\t2017-10-23 17:48:42 : Traceback (most recent call last):\n File \"sas/sasgui/perspectives/fitting/fit_thread.pyc\", line 82, in compute\n File \"sas/sasgui/perspectives/fitting/fit_thread.pyc\", line 14, in map_apply\n File \"sas/sasgui/perspectives/fitting/fit_thread.pyc\", line 11, in map_getattr\n File \"sas/sascalc/fit/BumpsFitting.pyc\", line 275, in fit\n File \"sas/sascalc/fit/BumpsFitting.pyc\", line 375, in run_bumps\nAttributeError: 'FitDriver' object has no attribute 'fitter'\n\nNone \n}}}",
    "reporter": "pkienzle",
    "cc": "",
    "resolution": "",
    "workpackage": "SasView Bug Fixing",
    "time": "2017-10-24T20:05:10",
    "component": "SasView",
    "summary": "opencl memory errors during fits",
    "priority": "major",
    "keywords": "",
    "milestone": "SasView 4.3.0",
    "owner": "",
    "type": "defect"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    DefectBug or undesirable behaviourMajorBig change in the code or important change in behaviour

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions