sPyNNaker icon indicating copy to clipboard operation
sPyNNaker copied to clipboard

master pop table address error

Open Christian-B opened this issue 1 year ago • 1 comments

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!

Christian-B avatar Jul 16 '24 09:07 Christian-B

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

  • Mode 1: things are as they are now, and reading back projections works as expected. If you make a lot of projections, things will slow to a crawl in evalulation, but reading back projections gets valid data.
  • Mode 2: matrices are merged and reading back any one projection results in data for all of them. If you never read back the data you won't see any issues.

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

  • When no source rows overlap, the width is the maximum of the row length of the Projections
  • When all source rows overlap, the width is the sum of the row length of the Projections
  • When there is some source-row overlap, the projections can be grouped into disjoint overlapping row groups. Each group will have a width, which is the sum of the row lengths of the Projections in the group. The width is then the maximum of the width of the groups.

rowleya avatar Jul 16 '24 13:07 rowleya