Skip to content

Bug: network_run profile handling checks stale parameter instead of resolved value #167

Description

@ItzDEXX

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

  1. Call set_device('genn', ..., profile=False) — stores False in build_options
  2. Set deprecated preference prefs.devices.genn.kernel_timing = True
  3. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions