SpiNNakerManchester / sPyNNaker

The SpiNNaker implementation of the PyNN neural networking language
Apache License 2.0
100 stars 42 forks source link

master pop table address error #1468

Open Christian-B opened 1 month ago

Christian-B commented 1 month ago

found with: import pyNN.spiNNaker as sim

n_neurons = 10000 simtime = 1000

sim.setup(timestep=1.0, min_delay=1.0)

spikeArray = {'spike_times': [[0]]} stimulus = sim.Population(1, sim.SpikeSourceArray, spikeArray, label='stimulus') pop = sim.Population(n_neurons, sim.IF_curr_exp, {}, label='chain') pop.record("spikes")

pop.record(["spikes", "v"])

sim.Projection(stimulus, pop, sim.OneToOneConnector(), sim.StaticSynapse(weight=5, delay=1)) sim.Projection(pop[n_neurons - 1], pop[0], sim.OneToOneConnector(), sim.StaticSynapse(weight=5, delay=1)) for i in range(n_neurons-1): sim.Projection(pop[i], pop[i+1], sim.OneToOneConnector(), sim.StaticSynapse(weight=5, delay=1))

sim.run(simtime) neo = pop.get_data(variables=["spikes"]) spikes = neo.segments[0].spiketrains print(spikes) sim.end()


File "/home/brenninc/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 925, in _execute_splitter_partitioner self._data_writer.set_n_chips_in_graph(splitter_partitioner()) ^^^^^^^^^^^^^^^^^^^^^^ File "/home/brenninc/spinnaker/PACMAN/pacman/operations/partition_algorithms/splitter_partitioner.py", line 36, in splitter_partitioner vertex.splitter.create_machine_vertices(chip_counter) File "/home/brenninc/spinnaker/sPyNNaker/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_abstract_pop_vertex_fixed.py", line 82, in create_machine_vertices all_syn_block_sz = app_vertex.get_synapses_size( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/brenninc/spinnaker/sPyNNaker/spynnaker/pyNN/models/neuron/abstract_population_vertex.py", line 1293, in get_synapses_size addr = self.add_matrix_size(addr, proj, n_post_atoms) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/brenninc/spinnaker/sPyNNaker/spynnaker/pyNN/models/neuron/abstract_population_vertex.py", line 1324, in add_matrix_size MasterPopTableAsBinarySearch.get_next_allowed_address( File "/home/brenninc/spinnaker/sPyNNaker/spynnaker/pyNN/models/neuron/master_pop_table.py", line 422, in get_next_allowed_address raise SynapticConfigurationException( spynnaker.pyNN.exceptions.SynapticConfigurationException: Address 0x10000020 is out of range for this population table!

rowleya commented 1 month ago

OK, so the reason for this is because every incoming Projection into a Population makes a fully independent matrix. We do this because we want to allow the reading back of Projection data, which is easier if that data is kept separately for each Projection. In the case where there are then 1000 projections incoming into a Population there are 1000 matrices, and when using one-to-one connectors, each is 1 x number of source neurons in size, so 10,000 bytes in this case. With 1,000 x 10,000 bytes, things will start to overflow the space allocated!

A solution to this is to have two modes

In the second mode, additional consideration needs to be taken for the matrix width: