Hi @mstimberg and @thesamovar,
Following up on the discussion in #1729 regarding Dan's idea of an "Auto-Switch" or "Smart Heuristic" for backend selection, I have drafted a preliminary technical proposal for GSoC 2026.
The Core Concept
I propose building a ComplexityCrawler that runs inside Network.before_run(). It inspects the computational cost of the network (neuron count, synapse sparsity, duration) and serves two functions:
- Runtime Optimization: Automatically selects the most efficient Runtime target (
numpy, cython, or the upcoming cppyy) based on startup cost vs. execution speed.
- Scalability Advisor: Detects when a simulation is too heavy for any Python-driven runtime (due to the
Network.run loop overhead) and explicitly warns the user to switch to set_device('cpp_standalone') for massive speedups.
The Draft Proposal
I have outlined the technical mechanism, the "Tiered Cost Model", and implementation phases here:
https://gist.github.com/ayush4874/d2bf639b772049bd3465951bfea8c307
Technical Note
My initial idea considered "seamlessly swapping" to cpp_standalone automatically. However, swapping to Standalone mode inside before_run (after objects are already initialized in Python) is likely architecturally unsafe.
Therefore, this proposal focuses on advising for Standalone mode (Tier 3) via warnings, while reserving automatic switching for the Runtime targets (Tier 1 & 2) where it is safe to do so.
I’ve prototyped the "Scoring" logic locally (prototype_v2_crawler.py) and it successfully distinguishes between "toy", "standard", and "heavy" networks. I would love your feedback on this architecture.
Hi @mstimberg and @thesamovar,
Following up on the discussion in #1729 regarding Dan's idea of an "Auto-Switch" or "Smart Heuristic" for backend selection, I have drafted a preliminary technical proposal for GSoC 2026.
The Core Concept
I propose building a
ComplexityCrawlerthat runs insideNetwork.before_run(). It inspects the computational cost of the network (neuron count, synapse sparsity, duration) and serves two functions:numpy,cython, or the upcomingcppyy) based on startup cost vs. execution speed.Network.runloop overhead) and explicitly warns the user to switch toset_device('cpp_standalone')for massive speedups.The Draft Proposal
I have outlined the technical mechanism, the "Tiered Cost Model", and implementation phases here:
https://gist.github.com/ayush4874/d2bf639b772049bd3465951bfea8c307
Technical Note
My initial idea considered "seamlessly swapping" to
cpp_standaloneautomatically. However, swapping to Standalone mode insidebefore_run(after objects are already initialized in Python) is likely architecturally unsafe.Therefore, this proposal focuses on advising for Standalone mode (Tier 3) via warnings, while reserving automatic switching for the Runtime targets (Tier 1 & 2) where it is safe to do so.
I’ve prototyped the "Scoring" logic locally (
prototype_v2_crawler.py) and it successfully distinguishes between "toy", "standard", and "heavy" networks. I would love your feedback on this architecture.