Stochastic & Neuromorphic Computing  /  Reference  /  FAQ

Frequently asked questions

Short answers to the questions people actually ask — about the ideas, and about using SC-NeuroCore. Start typing to filter.

No question matches that filter.

Getting started

Do I need a GPU?

No. SC-NeuroCore runs on CPU by default. GPU acceleration is optional — via CuPy (pip install sc-neurocore[gpu]) or PyTorch for surrogate-gradient training (pip install sc-neurocore[training]).

Do I need the native accelerated engine?

No. Pure Python is the reference path and every feature works on it. The acceleration is polyglot — the same neuron and network kernels have Rust, Julia, Go and Mojo backends (plus a GPU path via CuPy/JAX and MPI for distribution), selected per workload; the Python bridge to the native engine is called sc_neurocore_engine. It exists for throughput on large networks. Where a speed-up is quoted it is tied to a committed benchmark artefact with its own parity boundary, so treat those figures as evidence-bounded rather than headline numbers; see the benchmarks page.

Which Python versions are supported?

Python 3.10 through 3.14. Continuous integration tests every supported version on each commit.

Why is the first import slow?

Neuron-model modules are lazy-loaded on first access, so the initial import takes a few seconds; subsequent imports in the same process are effectively instant.

Stochastic computing

Why use stochastic computing at all?
  • Multiplication is one AND gate — versus roughly a hundred look-up tables for a fixed-point multiplier.
  • Fault tolerance — a stuck bit shifts a value by only 1/L, not by half.
  • Noise tolerance — inherent to a probabilistic representation.
  • Area efficiency — thousands of simple units per FPGA.

The trade is precision: error falls as O(1/√L) in the stream length L. For about 1% error you need L ≈ 2,500 with a plain Bernoulli source, or L ≈ 100 with a low-discrepancy Sobol source. The full treatment is on the stochastic computing page.

Unipolar or bipolar — when do I use which?
  • Unipolar [0,1]: an AND gate multiplies. Use for non-negative weights.
  • Bipolar [−1,1]: an XNOR gate multiplies. Use for signed weights.

Models & networks

How do I define a custom neuron model?

Write the dynamics as ODE strings (Brian2-style) and build a neuron from them:

from sc_neurocore.neurons.equation_builder import from_equations

neuron = from_equations(
    "dv/dt = -(v - E_L)/tau_m + I/C",
    threshold="v > -50",
    reset="v = -65",
    params=dict(E_L=-65.0, tau_m=10.0, C=1.0),
    init=dict(v=-65.0),
)

The same equation object can then be compiled to Verilog. See the spiking networks page and the notebooks.

What neuron models are available?

A large library, from the one-line leaky integrate-and-fire up to biophysical Hodgkin–Huxley and discrete-map neurons, each validated against its published source dynamics. Browse them in the neuron atlas; the families are explained on the spiking networks page.

FPGA & hardware

How do I compile a neuron to an FPGA?
from sc_neurocore.compiler.equation_compiler import compile_to_verilog

verilog = compile_to_verilog(neuron, module_name="my_lif")

The output is synthesisable Q8.8 signed fixed-point Verilog. The full path — co-simulation, synthesis and formal proof — is on the neuromorphic hardware page.

What FPGA boards are supported?

SC-NeuroCore generates Verilog RTL, not board-specific bitstreams, so any board its synthesis targets reach is fair game:

TargetToolchainStatus
iCE40Yosys + nextpnrtested (CI)
ECP5Yosys + nextpnrtested
GowinYosyspartial
Artix-7Vivadotested
ZynqVivadoproject TCL
How many neurons fit on an FPGA?

Rough, conservative estimates for a single LIF neuron at Q8.8 — actual density depends on connectivity, stream length and DSP use:

FPGALUTsLIF neurons (est.)
iCE40 HX8K7,680~150
ECP5 85K84,000~1,600
Artix-7 100T63,400~1,200
Zynq 702053,200~1,000

Troubleshooting

ImportError: cannot import name 'sc_neurocore_engine'

The optional Rust engine is not installed. Either build the local bridge from a checkout with maturin develop --release, install a matching release wheel, or simply use the Python backend: net.run(backend="python").

SCEncodingError: probability p must be in [0,1]

An input to the bitstream encoder is outside [0,1] — usually a weight or activation that has not been normalised. Clamp or rescale before encoding.

"CuPy not available" warning

Informational only. GPU acceleration needs CuPy (pip install sc-neurocore[gpu]); without it, CPU computation continues normally.