Energy consumption

53 views
Skip to first unread message

Alfonso Yamamoto

unread,
Sep 20, 2024, 2:03:39 AM9/20/24
to SpiNNaker Users Group
Hi spinnaker team, 
I am interested on this tool,  but I could not find any other info regarding the project. Do you guys have any info on this? 

Best regards, 
Alfonso 

Andrew Rowley

unread,
Sep 20, 2024, 2:32:07 AM9/20/24
to Alfonso Yamamoto, SpiNNaker Users Group

Hi,

 

We still have the Arduino-connected board in Manchester, but we haven’t used it in a while!  I do have some code that supposedly connects to it and reads the data, but I don’t know if we have the Arduino code anywhere or if this could be extracted from the board.  Note that this is in any case attached to an older generation 48-chip SpiNNaker board, so it might be hard to replicate.  This board had more exposed circuitry as I understand it, which is what allowed it to be connected in this way.

 

The SpiNNaker software does have an energy estimation report, enabled by adding “write_energy_report = True” to the [Reports] section of a spynnaker.cfg file (or spiNNakerGraphFrontEnd.cfg file in the case of using the lower-level code).  This uses statistics gathered from various papers (including the one you mention), as well as a core on each chip to sample the other core activity, the router packet counters, and timings of algorithm execution and simulation execution to produce an estimate of the energy used in a simulation as a detailed report.  You could try that if you need to perform energy comparisons.

 

Andrew :)

 

--
You received this message because you are subscribed to the Google Groups "SpiNNaker Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spinnakeruser...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/spinnakerusers/d10790ba-268c-4658-b9b6-c6538b011803n%40googlegroups.com [groups.google.com].

Alfonso Yamamoto

unread,
Aug 12, 2025, 8:12:50 AMAug 12
to SpiNNaker Users Group
Hi Andrew, 
Now I have an unrelated issue. I can not get the energy report to work.

 Traceback (most recent call last):
  File "/home/yamamoto/work/spinnaker/slca/slca_spinn2.py", line 296, in <module>
    sim.run(simtime)
  File "/home/yamamoto/work/spinnaker/sPyNNaker/spynnaker/pyNN/__init__.py", line 689, in run
    return __pynn["run"](simtime, callbacks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/venv/lib/python3.12/site-packages/pyNN/common/control.py", line 114, in run
    return run_until(simulator.state.t + simtime, callbacks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/venv/lib/python3.12/site-packages/pyNN/common/control.py", line 96, in run_until
    simulator.state.run_until(time_point)
  File "/home/yamamoto/work/spinnaker/sPyNNaker/spynnaker/pyNN/spinnaker.py", line 171, in run_until
    self._clear_and_run(tstop - self.t)
  File "/home/yamamoto/work/spinnaker/sPyNNaker/spynnaker/pyNN/spinnaker.py", line 146, in _clear_and_run
    super(SpiNNaker, self).run(run_time, sync_time)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 445, in run
    self._run(run_time, sync_time)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 519, in _run
    self.__run(run_time, sync_time)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 621, in __run
    self._do_run(step, n_sync_steps)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 2186, in _do_run
    raise run_e
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 2177, in _do_run
    self.__do_run(n_machine_time_steps, n_sync_steps)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 2160, in __do_run
    self._do_extract_from_machine()
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 2127, in _do_extract_from_machine
    self._report_energy()
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 1988, in _report_energy
    power_used = compute_energy_used()
                 ^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/interface_functions/compute_energy_used.py", line 134, in compute_energy_used
    run_chip_active_time = _extract_cores_active_time(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/interface_functions/compute_energy_used.py", line 207, in _extract_cores_active_time
    results = numpy.frombuffer(data, dtype=numpy.uint32).reshape(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: cannot reshape array of size 18000 into shape (19)

Just for clarity, I am using my own monolith neuron implementation (just on c file), could that be the issue? If I run the simulation without trying to record everything works fine.
Also I added write_energy_report=True to my config.

Best regards,

Alfonso 

Andrew Rowley

unread,
Aug 19, 2025, 8:34:23 AMAug 19
to Alfonso Yamamoto, SpiNNaker Users Group
Hi,

This certainly looks like some sort of bug, but I am having trouble working out the issue.  When you set wrtie_energy_report = True to the configuration, it should be added a "special" core to the system that records the usage of each core.  The error you see below is where it is then supposedly reading back the data recorded.  What it doesn't do is check the "_missing" flag at this point, which should only be set if there wasn't space to do the recording... that could happen I guess if it thought it was running for a fixed time and then was actually running longer potentially?

I note that you say that this happens on your custom model.  Does it still happen when you use one of the built-in models?  If not, is it possible that your custom model writes some recorded data incorrectly that is then being read by the code?

Andrew 🙂

From: spinnak...@googlegroups.com <spinnak...@googlegroups.com> on behalf of Alfonso Yamamoto <alfyama...@gmail.com>
Sent: 12 August 2025 13:12

To: SpiNNaker Users Group <spinnak...@googlegroups.com>
Subject: Re: [SpiNNaker Mailing List] Energy consumption
 
Hi Andrew, Now I have an unrelated issue. I can not get the energy report to work. Traceback (most recent call last): File "/home/yamamoto/work/spinnaker/slca/slca_spinn2. py", line 296, in <module> sim. run(simtime) File "/home/yamamoto/work/spinnaker/sPyNNaker/spynnaker/pyNN/__init__. py",

Alfonso Yamamoto

unread,
Aug 20, 2025, 3:12:24 AMAug 20
to SpiNNaker Users Group
Hi Andrew, 
The built in models also fail. I did a git pull for all repositories just to be sure.
For example this is the output for the synfire example with the energy report set to True:  

Traceback (most recent call last):
  File "/home/yamamoto/work/spinnaker/PyNN8Examples/synfire/synfire.py", line 52, in <module>


Now, if I run the the same script just after this, with no modifications I get the following: 


2025-08-20 09:11:45 ERROR: Error on machine_generation

Traceback (most recent call last):
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 758, in _do_allocate_machine
    self._execute_machine_generator(allocator_data)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 833, in _execute_machine_generator
    machine, transceiver = machine_generator(
                           ^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/interface_functions/machine_generator.py", line 72, in machine_generator
    return txrx.get_machine_details(), txrx
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/transceiver/base_transceiver.py", line 460, in get_machine_details
    machine = get_machine_process.get_machine_details(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/processes/get_machine_process.py", line 260, in get_machine_details
    return self._fill_machine(machine)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/processes/get_machine_process.py", line 285, in _fill_machine
    machine.validate()
  File "/home/yamamoto/work/spinnaker/SpiNNMachine/spinn_machine/machine.py", line 500, in validate
    raise SpinnMachineException(
spinn_machine.exceptions.SpinnMachineException: global chip 0, 0 on 192.168.240.2 is chip 0, 0 on 192.168.240.2 has too few cores found 4
2025-08-20 09:11:45 ERROR: global chip 0, 0 on 192.168.240.2 is chip 0, 0 on 192.168.240.2 has too few cores found 4

Traceback (most recent call last):
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 758, in _do_allocate_machine
    self._execute_machine_generator(allocator_data)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 833, in _execute_machine_generator
    machine, transceiver = machine_generator(
                           ^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/interface_functions/machine_generator.py", line 72, in machine_generator
    return txrx.get_machine_details(), txrx
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/transceiver/base_transceiver.py", line 460, in get_machine_details
    machine = get_machine_process.get_machine_details(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/processes/get_machine_process.py", line 260, in get_machine_details
    return self._fill_machine(machine)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/processes/get_machine_process.py", line 285, in _fill_machine
    machine.validate()
  File "/home/yamamoto/work/spinnaker/SpiNNMachine/spinn_machine/machine.py", line 500, in validate
    raise SpinnMachineException(
spinn_machine.exceptions.SpinnMachineException: global chip 0, 0 on 192.168.240.2 is chip 0, 0 on 192.168.240.2 has too few cores found 4
Converting to JSON machine
|0%                          50%                         100%|
 2025-08-20 09:11:45 INFO: Creating transceiver for 192.168.240.2
2025-08-20 09:11:45 INFO: Working out if machine is booted
2025-08-20 09:11:45 INFO: Found board with version [Version: SC&MP 4.0.0 at SpiNNaker:0:0:0 (built Fri Nov 17 10:35:48 2023)]
2025-08-20 09:11:45 INFO: Machine communication successful
2025-08-20 09:11:45 INFO: 192.168.240.2
Reading details from 48 chips
|0%                          50%                         100%|
 ============================================================
2025-08-20 09:11:45 INFO: Machine generator exited with SpinnMachineException after 0:00:00.020967
2025-08-20 09:11:45 ERROR: Error on machine_generation

Traceback (most recent call last):
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 758, in _do_allocate_machine
    self._execute_machine_generator(allocator_data)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 833, in _execute_machine_generator
    machine, transceiver = machine_generator(
                           ^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/interface_functions/machine_generator.py", line 72, in machine_generator
    return txrx.get_machine_details(), txrx
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/transceiver/base_transceiver.py", line 460, in get_machine_details
    machine = get_machine_process.get_machine_details(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/processes/get_machine_process.py", line 246, in get_machine_details
    SpiNNManDataView.set_v_to_p_map(self._virtual_to_physical_map)
  File "/home/yamamoto/work/spinnaker/SpiNNMachine/spinn_machine/data/machine_data_view.py", line 292, in set_v_to_p_map
    raise SpinnMachineException(
spinn_machine.exceptions.SpinnMachineException: Unexpected second call to set_v_to_p_map
2025-08-20 09:11:45 ERROR: Unexpected second call to set_v_to_p_map

Traceback (most recent call last):
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 758, in _do_allocate_machine
    self._execute_machine_generator(allocator_data)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 833, in _execute_machine_generator
    machine, transceiver = machine_generator(
                           ^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/interface_functions/machine_generator.py", line 72, in machine_generator
    return txrx.get_machine_details(), txrx
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/transceiver/base_transceiver.py", line 460, in get_machine_details
    machine = get_machine_process.get_machine_details(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMan/spinnman/processes/get_machine_process.py", line 246, in get_machine_details
    SpiNNManDataView.set_v_to_p_map(self._virtual_to_physical_map)
  File "/home/yamamoto/work/spinnaker/SpiNNMachine/spinn_machine/data/machine_data_view.py", line 292, in set_v_to_p_map
    raise SpinnMachineException(
spinn_machine.exceptions.SpinnMachineException: Unexpected second call to set_v_to_p_map
============================================================
2025-08-20 09:11:45 INFO: Json machine exited with ConfigurationException after 0:00:00.033472

Traceback (most recent call last):
  File "/home/yamamoto/work/spinnaker/PyNN8Examples/synfire/synfire.py", line 52, in <module>

    sim.run(simtime)
  File "/home/yamamoto/work/spinnaker/sPyNNaker/spynnaker/pyNN/__init__.py", line 689, in run
    return __pynn["run"](simtime, callbacks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/venv/lib/python3.12/site-packages/pyNN/common/control.py", line 114, in run
    return run_until(simulator.state.t + simtime, callbacks)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/venv/lib/python3.12/site-packages/pyNN/common/control.py", line 96, in run_until
    simulator.state.run_until(time_point)
  File "/home/yamamoto/work/spinnaker/sPyNNaker/spynnaker/pyNN/spinnaker.py", line 171, in run_until
    self._clear_and_run(tstop - self.t)
  File "/home/yamamoto/work/spinnaker/sPyNNaker/spynnaker/pyNN/spinnaker.py", line 146, in _clear_and_run
    super(SpiNNaker, self).run(run_time, sync_time)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 445, in run
    self._run(run_time, sync_time)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 519, in _run
    self.__run(run_time, sync_time)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 600, in __run
    self._do_mapping(total_run_time, n_machine_time_steps)
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 1400, in _do_mapping
    self._json_machine()
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 896, in _json_machine
    write_json_machine()
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/utilities/report_functions/write_json_machine.py", line 42, in write_json_machine
    json_obj = to_json()
               ^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMachine/spinn_machine/json_machine.py", line 236, in to_json
    machine = MachineDataView.get_machine()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yamamoto/work/spinnaker/SpiNNMachine/spinn_machine/data/machine_data_view.py", line 151, in get_machine
    cls.__data._machine_generator()
  File "/home/yamamoto/work/spinnaker/SpiNNFrontEndCommon/spinn_front_end_common/interface/abstract_spinnaker_base.py", line 866, in _get_machine
    raise ConfigurationException(
spinn_front_end_common.utilities.exceptions.ConfigurationException: Not enough information provided to supply a machine
 

Best regards, 

Alfonso 

Andrew Rowley

unread,
Aug 21, 2025, 6:00:31 AMAug 21
to Alfonso Yamamoto, SpiNNaker Users Group
Hi,

I am wondering if something has got out-of-sync somewhere.  I tried this using git main / master on all branches using the PyNNExamples/synfire/synfire.py (I think this is what you are using) script and it appeared to work.

One thing to check is that if you update your git repository, that you run the SupportScripts/automatic_make.sh to rebuild all the C code.  I think there were some minor changes to this recently that could affect the results.

Let me know how it goes...

Andrew :)

Sent: 20 August 2025 08:12

To: SpiNNaker Users Group <spinnak...@googlegroups.com>
Subject: Re: [SpiNNaker Mailing List] Energy consumption
 
Hi Andrew, The built in models also fail. I did a git pull for all repositories just to be sure. For example this is the output for the synfire example with the energy report set to True: Traceback (most recent call last): File "/home/yamamoto/work/spinnaker/PyNN8Examples/synfire/synfire. py",

Alfonso Yamamoto

unread,
Aug 21, 2025, 6:45:39 AMAug 21
to SpiNNaker Users Group
Hi,
It was precisely that, thanks!

Alfonso
Reply all
Reply to author
Forward
0 new messages