Hardware Mapping

Hello,
I am trying to map MNIST example into the Akida Hardware. I have installed hardware in my PC. According to the example my workflow is
Data load------> Create Keras Network--------> train the network in keras------->Quantize it
Then
from cnn2snn import convert, set_akida_version, AkidaVersion
with set_akida_version(AkidaVersion.v2):
model_akida = convert(model_quantized)
set version and convert it to akida model.
to map the model in the hardware
import akida
devices = akida.devices()
print(f’Available devices: {[dev.desc for dev in devices]}')
assert len(devices), “No device found, this example needs an Akida NSoC_v2 device.”
device = devices[0]
assert device.version == akida.NSoC_v2, “Wrong device found, this example needs an Akida NSoC_v2.”

model_akida.map(device)

Check model mapping: NP allocation and binary size

model_akida.summary()

but it showed an error.

RuntimeError Traceback (most recent call last)
Cell In[17], line 1
----> 1 model_akida.map(device)
3 # Check model mapping: NP allocation and binary size
4 model_akida.summary()

RuntimeError: The IP version of the model and device must be identical.
Can anyone help me out?
Thank You.

1 Like

Hi @Rashedul

It looks like you are trying to use this on an incompatible device what Brainchip hardware are you using?

akida.NSoC_v2, “Wrong device found, this example needs an Akida NSoC_v2.”

@mateusz @davidtischler_edgeim any experience with this error?

Best

Eoin

@Rashedul @Eoin
Currently Edge Impulse is supporting only NSoC_v1, as the 2nd generation of the Akida is not yet released AFAIK.
What hardware did you install in your PC? Is it an accelerator based on AKD1000?

Kind regards,
Mateusz

@Eoin @mateusz thank you for your reply.
I have installed [PCIe/NSoC_v2/0] in my PC.

Actually the error was
RuntimeError: The IP version of the model and device must be identical.

That’s what my AKD1000 device shows up as, also:

Last login: Fri Mar  8 11:07:31 2024
david@ubuntu:~$ akida devices
Available devices:
PCIe/NSoC_v2/0

But I am not too sure about that error, perhaps @mateusz will know more. :crossed_fingers:

@davidtischler_edgeim Thanks.
As far as I’m aware, there are two types of Keras model conversion: Akida1 and Akida 2. Do you know which type of model conversion your hardware supports?

@Rashedul
Sorry for my mistake. Indeed, AKD1000 is reporting itself as NSoC_v2. Answering your question, you need to set AkidaVersion.v1 according to BrainChip’s documentation.
I see it is somewhat confusing that the device is NSoC_v2, but the Akida version is v1. I guess the NSoC is a version of the SoC, while the version set by set_akida_version is the IP version.

Kind regards,
Mateusz

2 Likes

@mateusz Thank you. So my Model should be compatible for version 1

Hi. Can you give me a download address for the accelerator
I haven’t installed hardware in my PC and I can’t find it :face_holding_back_tears:

Hello Luchen,
I think you can follow these:
Akida_pdf
github_link
Akida_driver

OK, thanks for much!

Sorry to bother you, I have followed the install steps
but when typing the “lspci | grep Co-processor”, I can’t get the expected reply “Device 1e7c:bca1 (rev 01)”
My chip is installed and it’s glowing as in the video, so I don’t know what is the problem
image

Sorry. I am also a beginner. I am not familiar with the error.

OK, thank you
I have asked my senior and he thinks it’s because the pcie channel can’t be used by virtual machine.
Solution is to modify relational settings or install Linux on the physical machine(I used the latter, solved)