Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup Big FromListConnector #1095

Merged
merged 9 commits into from
Jul 7, 2021
Merged

Speedup Big FromListConnector #1095

merged 9 commits into from
Jul 7, 2021

Conversation

Christian-B
Copy link
Member

@Christian-B Christian-B commented Jun 24, 2021

Depends on:
SpiNNakerManchester/PACMAN#398
tested by:
SpiNNakerManchester/IntegrationTests#64

BUG FIX: SynapseIORowBased
Now asks splitters for the slices!

Method could_connect changed to use vertexes
This allows __split_conn_list to be used!

__split_conn_list now maps only pairs of slices that connect
Instead of checking if not none and then length of item can now just check in

_split_connections
always sets _split_connections to a dict even if empty
Only maps if len(indices) > 0
exit because slices seen is most common so moved first

create_synaptic_block
exit fast if not in __split_conn_list which includes the not len(self.__sources) case

tests show partitioner time cut by over 80 in large fromLists
for example:
import numpy
import spynnaker8 as sim

n_sources = 100000
n_targets = 100000
n_connections = 10000000
sources = numpy.random.randint(0, n_sources, n_connections)
targets = numpy.random.randint(0, n_targets, n_connections)
connection_list = numpy.dstack((sources, targets))[0]

sim.setup(timestep=1.0)
sim.set_number_of_neurons_per_core(sim.IF_curr_exp, 100)

pop_1 = sim.Population(n_sources, sim.IF_curr_exp(), label="pop_1")
input = sim.Population(n_targets, sim.SpikeSourceArray(spike_times=[0]), label="input")
input_proj = sim.Projection(input, pop_1, sim.FromListConnector(connection_list),
synapse_type=sim.StaticSynapse(weight=5, delay=1))
simtime = 10
sim.run(simtime)

In Master:
0:04:43.446246 taken by SpYNNakerSplitterPartitioner
This PR:
0:00:38.930407 taken by SpYNNakerSplitterPartitioner

Copy link
Contributor

@andrewgait andrewgait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me and worth having in, just one minor spelling mistake

self.splitter = MockSplitter(slices)


class MockMachieVertex(object):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MockMachieVertex -> MockMachineVertex

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@andrewgait andrewgait merged commit f44d2b3 into master Jul 7, 2021
@andrewgait andrewgait deleted the slice_fix branch July 7, 2021 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Do not release when one of these is open! enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants