KasperskyLab / knp

Kaspersky Neuromorphic Platform
Apache License 2.0
11 stars 4 forks source link
cpp machine-learning ml neural-network python spiking

Kaspersky Neuromorphic Platform

Platform for the spiking neural network execution.

Logo

The Kaspersky Neuromorphic Platform ("KNP" or "platform") is a software platform for developing, training and executing spiking neural networks on a variety of computers.

You can use Kaspersky Neuromorphic Platform to do the following:

You can use the C++ and Python languages to accomplish these tasks. The platform supports CPUs as well as the AltAI-1 neuromorphic processor unit designed for energy-efficient execution of neural networks in various types of intelligent devices.

For information on the platform concepts and architecture, installation instructions and platform use cases, see Kaspersky Neuromorphic Platform Help.

Hardware and software requirements

For Kaspersky Neuromorphic Platform operation, the computer must meet the following minimum requirements.

Minimum hardware requirements:

Supported operating systems:

You can use the device running any other operating system from the Linux family, if the operating system distribution kit contains the Boost library version 1.83 or later.

To work with the platform, the following software must be installed on the device:

Installing the platform

For the development of application solutions on Linux, you can install the platform in the following ways:

When working with the platform source code on Linux or Windows, you can build the platform or an application solution using C++. The platform build can be used to develop the Kaspersky Neuromorphic Platform.

Installing deb packages

We recommend using the dpkg package manager to install deb packages.

To install the deb packages:

  1. To install the deb packages with backend binary code, run the following commands as root:

    dpkg -i <path-to-deb-package>/knp-cpu-single-threaded-backend_<version 1>_amd64.deb
    dpkg -i <path-to-deb-package>/knp-cpu-multi-threaded-backend_<version 1>_amd64.deb
    dpkg -i <path-to-deb-package>/knp-altai-backend_<version 2>_amd64.deb

    When installing the knp-altai-backend_<version 2>_amd64.deb package, accept the AltAI-1 backends and ANN2SNN library Terms of Use. Your acceptance of the Terms of Use is a prerequisite for installing the package. The package installation process will be interrupted unless you accept the Terms of Use.

  2. To install the deb package with C ++ framework binary code, run the following command as root:

    dpkg -i <path-to-deb-package>/knp-cpp-framework_<version 1>_amd64.deb
  3. To install dev-deb packages, run the following commands as root:

    dpkg -i <path-to-deb-package>/knp-cpu-multi-threaded-backend-dev_<version 1>_amd64.deb
    dpkg -i <path-to-deb-package>/knp-cpu-single-threaded-backend-dev_<version 1>_amd64.deb
    dpkg -i <path-to-deb-package>/knp-altai-backend-dev_<version 2>_amd64.deb
    dpkg -i <path-to-deb-package>/knp-cpp-framework-dev_<version 1>_amd64.deb

    When installing the knp-altai-backend-dev_<version 2>_amd64.deb package, accept the AltAI-1 backends and ANN2SNN library Terms of Use. Your acceptance of the Terms of Use is a prerequisite for installing the package. The package installation process will be interrupted unless you accept the Terms of Use.

  4. To install the deb package with the Python framework without ANN2SNN library, run the following command as root:

    dpkg -i <path-to-deb-package>/knp-python3-framework_<version 1>_amd64.deb
  5. To install the deb package with ANN2SNN library, run the following as root:

    dpkg -i <path-to-deb-package>/knp_ann2snn.deb

    When installing the knp_ann2snn.deb package, accept the AltAI-1 backends and ANN2SNN library Terms of Use. Your acceptance of the Terms of Use is a prerequisite for installing the package. The package installation process will be interrupted unless you accept the Terms of Use.

  6. To install the deb package with platform usage examples, run the following command as root:

    dpkg -i <path-to-deb-package>/knp-examples_<version 1>_amd64.deb
  7. To install the deb package with the API reference guide, run the following command as root:

    dpkg -i <path-to-deb-package>/knp-documentation_<version 1>_all.deb

where:

Installing Python development packages

The following DEB or WHL packages must be installed for Python development:

where:

We recommend using the dpkg package manager to install the deb package.

To install deb packages for Python development:

  1. To install the deb package with a Python framework without ANN2SNN library, run the following as root:

    dpkg -i <path-to-deb-package>/knp-python3-framework_<version 1>_amd64.deb
  2. To install the deb package with ANN2SNN library, run the following as root:

    dpkg -i <path-to-deb-package>/knp_ann2snn.deb

    When installing the knp_ann2snn.deb package, accept the AltAI-1 backends and ANN2SNN library Terms of Use. Your acceptance of the Terms of Use is a prerequisite for installing the package. The package installation process will be interrupted unless you accept the Terms of Use.

where:

Use the pip3 package manager to install whl packages from the PyPI platform.

To install the whl packages:

  1. To install a whl package with a Python framework without ANN2SNN library, run:

    pip3 install --break-system-packages knp-<version 1>-py3-none-any.whl
  2. To install a whl package with ANN2SNN library, do one of the following:

    • To install a package on an x86-based computer, run:

      pip3 install --break-system-packages knp_ann2snn_x86_64_<version 2>-py3-none-any.whl
    • If you need to install a package on an ARM-based computer, run:

      pip3 install --break-system-packages knp_ann2snn_aarch64-<version 2>-py3-none-any.whl.whl

where:

Scenario for building a platform project or an application solution

You can build a platform or an application solution in C++. The platform build can be used when developing the Kaspersky Neuromorphic Platform.

When developing application solutions, you can install the required deb packages instead of building the solution.

You can also use the Docker image knp-build-image included in the platform distribution kit to build the platform or an application.

A platform or application solution build script consists of the following stages:

  1. Obtaining the platform source code

    You can get the platform source code in one of the following ways:

    • Download the archive with the source code from the platform repository and unpack it to the working directory.
    • Clone the platform repository.
  2. Defining the Boost_ROOT setting in Windows

    In Windows, define the Boost_ROOT setting. To do this, create an environment variable or specify the path to the installed Boost library in the CMakePresets.json file located in the root directory with the platform source code.\ You can define the path to the installed Boost library as a CMake invocation parameter using the following command:\

    cmake -DBOOST-ROOT=<path to installed Boost library>
  3. Configuring the build settings for the application solution

    In case of an application solution build, describe the build process in the CMakeLists.txt file. Specify the directory with the application to be built using the add_subdirectory function, specify the executable file using the add_executable function, and specify the platform libraries to be connected to the project using the target_link_libraries function. You can use the following libraries:

    • neuron_traits
    • synapse_traits
    • core
    • meta
    • devices
    • backends
    • framework
  4. Configuring a platform or an application solution build

    If you are building a platform or an application solution on Linux, configure the build using the CMake build system. For more details on configuring a build using CMake, refer to the CMake documentation.\ If you are building the platform or application solution in Windows, configure the build in Visual Studio. To do this, open the platform or application project by selecting the required CMakeLists.txt file and configure the cache. In case of an application solution build, select the CMakeLists.txt file of the application solution. In case of a platform build, select the CMakeLists.txt file located in the root directory with the platform source code.\ The first build configuration with CMake may take too long to complete and fail with network errors. If network errors occur, please run the build configuration again.

  5. Starting the build

    Start the platform or application solution build. For more details on starting the build of projects, refer to the CMake documentation or the documentation of the integrated development environment (IDE) being used.

Trademark notices

Registered trademarks and service marks are the property of their respective owners.

Ubuntu and LTS are registered trademarks of Canonical Ltd.\ Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries. Docker, Inc. and other parties may also have trademark rights in other terms used herein.\ TensorFlow and any associated designations are trademarks of Google LLC.\ Intel and Core are trademarks of Intel Corporation in the U.S. and/or other countries.\ Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.\ Microsoft, Visual Studio and Windows are trademarks of the Microsoft group of companies.\ JavaScript is a registered trademark of Oracle and/or its affiliates.\ Python is a trademark or registered trademark of the Python Software Foundation.\ Debian is a registered trademark of Software in the Public Interest, Inc.

Contribution

This is an open source project. If you are interested in making a code contribution, please see CONTRIBUTING.md for more information.

License

Copyright © 2024 AO Kaspersky Lab Licensed under the Apache 2.0 License. See the LICENSE.txt file in the root directory for details.