DynapCNN power prob...
 
Notifications
Clear all

DynapCNN power probing issue

13 Posts
4 Users
0 Likes
814 Views
1
Topic starter

I have an issue when trying to probe the power consumption of the DynapCNN during inference as can be seen in the screenshot and summarized in the following:

  • I only get power events for Idle mode, and it is suggested that I might need to update the firmware (current version is: Fx3=0.11.5, FPGA=1.3.0).
  • The power events are in the range of Watts, perhaps it is not the same unit as for Speck?
  • It is not clear what the three channels (0,1,4) correspond to (IO, RAM, Logic).

Thank you very much for your time and help!

4 Answers
0

Hey, could you please provide us a bare-minimum script of how you do the power measurement? 
- Do you mean you would like to know to to upgrade the firmware of the DynapCNN devkit?

- The unit of the power events of Speck is Watt as well if my memory is correct. See this example: https://synsense.gitlab.io/sinabs-dynapcnn/getting_started/notebooks/power_monitoring.html   We multiply the power events value with 1e6 to convert them into micro-watt.

- Channel (0, 1, 4) represent the Ram, Logic, IO respectively for the DynapCNN, and it only has those 3 power track id (we will update this for the documentation)

Lyes Khacef Lyes Khacef Topic starter 31/08/2023 6:38 pm

@yalun thanks for your reply. - I use the same script as in the tutorial you shared, as you can see in this screenshot.

dynapcnn power issue

. The problem is that all the power events timestamps are zeros, so it is suggested that I update the firmware (but I recently did). - The same code works fine with Speck, where I get an Idle power of about 1mW in total (including the DVS). With DynapCNN, I get about 1600mW as you can see it in this screenshot

dynapcnn power issue

, which does not make sense. This issue is perhaps related to the first one described above.

0

Hi @Lyes, there might be some hardware problem on your board. Can you try this code? 

 

import samna
import time

d = samna.device.get_unopened_devices()
dk = samna.device.open_device(d[0])
power = dk.get_power_monitor()
buf = samna.BasicSinkNode_unifirm_modules_events_measurement()
graph = samna.graph.EventFilterGraph()
graph.sequential([power.get_source_node(), buf])
graph.start()

io = dk.get_io_module()

input_node = samna.graph.source_to(dk.get_model_sink_node())

time.sleep(1)

def measure_power():
    print("Auto power measurement test:")
    power.start_auto_power_measurement(100)
    time.sleep(5)
    power.stop_auto_power_measurement()
    ps = buf.get_events()

    for p in ps:
        print(p)

measure_power()
Lyes Khacef Lyes Khacef Topic starter 05/09/2023 7:45 pm

@yudi thanks for your answer, here are the results with sleep time of 0.1 (more power events with sleep time of 5 but similar values with same timestamp=0):

Auto power measurement test:
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.201250, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.197500, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.471250, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=-0.002500, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.013672, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.198750, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.200000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=-0.002500, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.003906, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.471250, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=0.003750, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.011719, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.198750, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.003906, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.200000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=0.002500, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.003906, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.472500, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=-0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.009766, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.200000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.195000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=-0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.003906, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.473750, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=0.002500, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.009766, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.202500, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=0.002500, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.005860, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.197500, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=-0.002500, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.472500, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=0.002500, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.007813, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.200000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=0.002500, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.003906, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.198750, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=-0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.475000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.005860, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.201250, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.200000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.473750, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.007813, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.201250, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.003906, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.198750, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=-0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.003906, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.472500, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.007813, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.198750, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=-0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.007813, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.197500, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.475000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=-0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.009766, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=0, value=1.201250, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=0, value=-0.001250, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.005860, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=1, value=1.200000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=1, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.001953, timestamp=0)
unifirm::modules::events::VoltageMeasurement(channel=4, value=2.475000, timestamp=0)
unifirm::modules::events::CurrentMeasurement(channel=4, value=0.000000, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.007813, timestamp=0)

Avatar Yudi 06/09/2023 9:57 am

Hi @Lyes, sorry it looks like the board has problems on measuring the power. Could you try on Speck Dev Kit?

Lyes Khacef Lyes Khacef Topic starter 06/09/2023 10:43 pm

@yudi sure, here is what I get with Speck, where the numbers make sense but the timestamp = 0 (although it does work correctly with non-zero timestamps when I probe the idle power with the code you provide in the tutorial):

Auto power measurement test:
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000027, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000075, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000345, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000086, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000028, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000581, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000069, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000345, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000075, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000030, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000593, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000069, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000340, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000069, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000031, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000581, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000075, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000345, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000069, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000027, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000581, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000086, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000334, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000081, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000030, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000575, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000075, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000345, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000092, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000025, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000581, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000081, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000345, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000086, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000029, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000587, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000081, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000340, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000081, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000029, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000570, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000063, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000345, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000075, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=0, value=0.000028, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=4, value=0.000581, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=1, value=0.000063, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=2, value=0.000345, timestamp=0)
unifirm::modules::events::PowerMeasurement(channel=3, value=0.000081, timestamp=0)

0

Hi @Lyes, yes these values make sense. Sorry I didn't include the enable of the timestamp in the previous code, you could do it through:

import samna
import time

d = samna.device.get_unopened_devices()
dk = samna.device.open_device(d[0])
power = dk.get_power_monitor()
buf = samna.BasicSinkNode_unifirm_modules_events_measurement()
graph = samna.graph.EventFilterGraph()
graph.sequential([power.get_source_node(), buf])
graph.start()



io = dk.get_io_module()

input_node = samna.graph.source_to(dk.get_model_sink_node())

time.sleep(1)

# enable timestamp
sw = dk.get_stop_watch()
sw.set_enable_value(True)

def measure_power():
    print("Auto power measurement test:")
    power.start_auto_power_measurement(100)
    time.sleep(5)
    power.stop_auto_power_measurement()
    ps = buf.get_events()

    for p in ps:
        print(p)

measure_power()
0
Topic starter

Hi @Yudi, thanks for the update, indeed the timestamps are now non-zero with Speck. A couple of questions:

- how can I use it with DynapCNN since "'samna.dynapcnnDevKit.DynapcnnDevKit' object has no attribute 'get_stop_watch'"?

- what should we do to solve the power proving issue of DynapCNN?

Avatar Yudi 08/09/2023 10:39 am

Hi @lyes_khacef, for DynapCNN it is different, you can enable it via: dk.get_io_module().write_config(0x0003, 1) and disable it via dk.get_io_module().write_config(0x0003, 0).

You could send the board to us to have a check on the hardware, but I do recommend to use the Speck dev kit because it has the same SNN resource as the DynapCNN, but with an extra DVS and more user friendly API

Lyes Khacef Lyes Khacef Topic starter 13/09/2023 1:47 am

Thanks @Yudi. To give some more context, we were using the hand gesture demo as a reference, you can the screenshot here:

dynapcnn demo

We use it with previous versions of the software libraries (samna==0.14.27.0, sinabs-dynapcnn==0.3.0, sinabs==0.3.3). So, I tried to run the script you sent me with these older versions, but the results are similar (and do not make sense, at least compared to Speck):

Auto power measurement test:
VoltageMeasurement channel 0, value 1.201250
CurrentMeasurement channel 0, value 0.003750
PowerMeasurement channel 0, value 0.003906
VoltageMeasurement channel 1, value 1.196250
CurrentMeasurement channel 1, value -0.001250
PowerMeasurement channel 1, value 0.001953
VoltageMeasurement channel 4, value 2.476250
CurrentMeasurement channel 4, value 0.000000
PowerMeasurement channel 4, value 0.005860
VoltageMeasurement channel 0, value 1.201250
CurrentMeasurement channel 0, value 0.000000
PowerMeasurement channel 0, value 0.003906
VoltageMeasurement channel 1, value 1.198750
CurrentMeasurement channel 1, value -0.003750
PowerMeasurement channel 1, value 0.005860
VoltageMeasurement channel 4, value 2.476250
CurrentMeasurement channel 4, value 0.001250
PowerMeasurement channel 4, value 0.007813
VoltageMeasurement channel 0, value 1.201250
CurrentMeasurement channel 0, value 0.000000
PowerMeasurement channel 0, value 0.001953
VoltageMeasurement channel 1, value 1.196250
CurrentMeasurement channel 1, value 0.000000
PowerMeasurement channel 1, value 0.001953
VoltageMeasurement channel 4, value 2.475000
CurrentMeasurement channel 4, value -0.002500
PowerMeasurement channel 4, value 0.009766
VoltageMeasurement channel 0, value 1.201250
CurrentMeasurement channel 0, value 0.000000
PowerMeasurement channel 0, value 0.001953
VoltageMeasurement channel 1, value 1.200000
CurrentMeasurement channel 1, value -0.002500
PowerMeasurement channel 1, value 0.003906
VoltageMeasurement channel 4, value 2.477500
CurrentMeasurement channel 4, value 0.002500
PowerMeasurement channel 4, value 0.009766
VoltageMeasurement channel 0, value 1.200000
CurrentMeasurement channel 0, value 0.001250
PowerMeasurement channel 0, value 0.003906
VoltageMeasurement channel 1, value 1.200000
CurrentMeasurement channel 1, value 0.001250
PowerMeasurement channel 1, value 0.005860
VoltageMeasurement channel 4, value 2.473750
CurrentMeasurement channel 4, value 0.000000
PowerMeasurement channel 4, value 0.009766
VoltageMeasurement channel 0, value 1.201250
CurrentMeasurement channel 0, value 0.001250
PowerMeasurement channel 0, value 0.001953
VoltageMeasurement channel 1, value 1.198750
CurrentMeasurement channel 1, value -0.002500
PowerMeasurement channel 1, value 0.005860
VoltageMeasurement channel 4, value 2.475000
CurrentMeasurement channel 4, value -0.003750
PowerMeasurement channel 4, value 0.009766
VoltageMeasurement channel 0, value 1.201250
CurrentMeasurement channel 0, value 0.001250
PowerMeasurement channel 0, value 0.005860
VoltageMeasurement channel 1, value 1.197500
CurrentMeasurement channel 1, value 0.000000
PowerMeasurement channel 1, value 0.003906
VoltageMeasurement channel 4, value 2.473750
CurrentMeasurement channel 4, value 0.002500
PowerMeasurement channel 4, value 0.009766
VoltageMeasurement channel 0, value 1.201250
CurrentMeasurement channel 0, value -0.001250
PowerMeasurement channel 0, value 0.001953
VoltageMeasurement channel 1, value 1.198750
CurrentMeasurement channel 1, value 0.000000
PowerMeasurement channel 1, value 0.003906
VoltageMeasurement channel 4, value 2.473750
CurrentMeasurement channel 4, value 0.000000
PowerMeasurement channel 4, value 0.003906
VoltageMeasurement channel 0, value 1.202500
CurrentMeasurement channel 0, value 0.000000
PowerMeasurement channel 0, value 0.003906
VoltageMeasurement channel 1, value 1.198750
CurrentMeasurement channel 1, value -0.002500
PowerMeasurement channel 1, value 0.003906
VoltageMeasurement channel 4, value 2.473750
CurrentMeasurement channel 4, value 0.001250
PowerMeasurement channel 4, value 0.013672
VoltageMeasurement channel 0, value 1.198750
CurrentMeasurement channel 0, value -0.001250
PowerMeasurement channel 0, value 0.003906
VoltageMeasurement channel 1, value 1.198750
CurrentMeasurement channel 1, value -0.002500
PowerMeasurement channel 1, value 0.003906
VoltageMeasurement channel 4, value 2.472500
CurrentMeasurement channel 4, value 0.001250
PowerMeasurement channel 4, value 0.009766

Lyes Khacef Lyes Khacef Topic starter 13/09/2023 1:50 am

So, I agree that the best solution is to send you the devkit so that you can take a deeper look and identify/fix the issue if possible. Can you please give me the address to which I need to send it?

Share:
Close
Back To