Bug Description
In GeNNDevice.network_run() (device.py, line 1884), the deprecated preference fallback checks the original profile function parameter instead of the resolved self.kernel_timings value. This means an explicit profile=False passed via set_device() can be incorrectly overridden by the deprecated devices.genn.kernel_timing preference.
Steps to Reproduce
- Call
set_device('genn', ..., profile=False) — stores False in build_options
- Set deprecated preference
prefs.devices.genn.kernel_timing = True
- Call run() without an explicit
profile argument (i.e. profile=None)
Expected Behavior
self.kernel_timings should resolve to False (from build_options), and the deprecated preference should not override it.
Actual Behavior
self.kernel_timings ends up as True because line 1884 checks the stale profile parameter (still None) instead of the already-resolved self.kernel_timings (which is False), so the deprecated pref fires and overwrites it.
Root Cause
self.kernel_timings = profile # None
if profile is None:
self.kernel_timings = self.build_options.pop("profile", None) # Now False
if profile is None and prefs.devices.genn.kernel_timing: # BUG: stale check
self.kernel_timings = True # Wrongly overrides
Bug Description
In
GeNNDevice.network_run()(device.py, line 1884), the deprecated preference fallback checks the originalprofilefunction parameter instead of the resolvedself.kernel_timingsvalue. This means an explicitprofile=Falsepassed viaset_device()can be incorrectly overridden by the deprecateddevices.genn.kernel_timingpreference.Steps to Reproduce
set_device('genn', ..., profile=False)— storesFalseinbuild_optionsprefs.devices.genn.kernel_timing = Trueprofileargument (i.e.profile=None)Expected Behavior
self.kernel_timingsshould resolve toFalse(frombuild_options), and the deprecated preference should not override it.Actual Behavior
self.kernel_timingsends up asTruebecause line 1884 checks the staleprofileparameter (stillNone) instead of the already-resolvedself.kernel_timings(which isFalse), so the deprecated pref fires and overwrites it.Root Cause