Skip to content

Commit e81946e

Browse files
author
FT-SNN Build Service
committed
Merge remote-tracking branch 'tfs/master' into HEAD
2 parents d8f36a8 + 569bb90 commit e81946e

37 files changed

Lines changed: 731 additions & 581 deletions

File tree

README.md

Lines changed: 2 additions & 197 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ You can use Kaspersky Neuromorphic Platform to do the following:
1212

1313
- Create spiking neural networks (SNNs) and train these on various types of input data, such as telemetry, events, images, 3D data, audio, and tactile data.
1414
- Convert artificial neural networks (ANNs) into spiking networks and train these.
15-
- Optimize the structure of the loaded neural networks.
1615
- Conduct applied research in the field of input data classification and other application domains of neural networks.
1716
- Develop new neural network topologies, for example, impulse analogs of convolutional neural networks that involve convolution in space and time.
1817
- Develop new models of synaptic plasticity.
1918
- Implement new neuron models.
2019
- Implement application solutions based on neuromorphic spiking neural networks in the field of robotic manipulators, Internet of Things, unmanned systems, human-machine interaction, wearable devices, and optimization planning.
21-
- Implement application solutions on devices with low power consumption or using neuromorphic processors.
20+
- Implement application solutions on devices with low power consumption using neuromorphic processors.
2221

2322
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.
2423

@@ -93,199 +92,6 @@ To work with the platform, the following software must be installed on the devic
9392
- python3-tqdm
9493
- TensorFlow 2.13.1
9594

96-
## Installing the platform
97-
98-
For the development of application solutions on Linux, you can install the platform in one of the following ways:
99-
100-
- Install deb packages.
101-
- Install packages for the development of application solutions in Python.
102-
103-
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.
104-
105-
### Installing deb packages
106-
107-
_To install the deb packages:_
108-
109-
1. To install deb packages containing CPU and `AltAI SNN` backend binaries, run the following commands as root:
110-
111-
```
112-
dpkg -i <path-to-deb-package>/knp-cpu-single-threaded-backend_<knp_version>_amd64.deb
113-
dpkg -i <path-to-deb-package>/knp-cpu-multi-threaded-backend_<knp_version>_amd64.deb
114-
dpkg -i <path-to-deb-package>/knp-altai-backend_<motiv_version>_amd64.deb
115-
```
116-
117-
When installing the `knp-altai-backend_<motiv_version>_amd64.deb` package, accept the AltAI-1 backends and `ANN2SNN` package 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.
118-
119-
1. To install the deb package with C ++ framework binary code, run the following command as root:
120-
121-
```
122-
dpkg -i <path-to-deb-package>/knp-cpp-framework_<knp_version>_amd64.deb
123-
```
124-
125-
1. To install dev-deb packages, run the following commands as root:
126-
127-
```
128-
dpkg -i <path-to-deb-package>/knp-cpu-multi-threaded-backend-dev_<knp_version>_amd64.deb
129-
dpkg -i <path-to-deb-package>/knp-cpu-single-threaded-backend-dev_<knp_version>_amd64.deb
130-
dpkg -i <path-to-deb-package>/knp-altai-backend-dev_<motiv_version>_amd64.deb
131-
dpkg -i <path-to-deb-package>/knp-cpp-framework-dev_<knp_version>_amd64.deb
132-
```
133-
134-
When installing the `knp-altai-backend-dev_<motiv_version>_amd64.deb` package, accept the AltAI-1 backends and `ANN2SNN` package 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.
135-
136-
1. To install the deb package with a Python framework for an `AltAI SNN` backend, run the following as root:
137-
138-
```
139-
dpkg -i <path-to-deb-package>/knp-python3-framework_<knp_version>_amd64.deb
140-
```
141-
142-
1. To install the deb packages with `ANN2SNN` package and `AltAI ANN2SNN` backend binary code, run the following commands as root:
143-
144-
```
145-
dpkg -i <path-to-deb-package>/knp_ann2snn.deb
146-
```
147-
148-
When installing the `knp_ann2snn.deb` package, accept the AltAI-1 backends and `ANN2SNN` package 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.
149-
150-
1. To install the deb package with platform usage examples, run the following command as root:
151-
152-
```
153-
dpkg -i <path-to-deb-package>/knp-examples_<knp_version>_amd64.deb
154-
```
155-
156-
1. To install the deb package with the API reference guide, run the following command as root:
157-
158-
```
159-
dpkg -i <path-to-deb-package>/knp-documentation_<knp_version>_all.deb
160-
```
161-
162-
where:
163-
164-
- `<path-to-deb-package>` is the path to the deb package;
165-
- `<knp_version>` is the Kaspersky Neuromorphic Platform version.
166-
- `<motiv_version>` is the version of the backends for the AltAI-1 neuromorphic processor and the `ANN2SNN` package.
167-
168-
### Installing Python development packages
169-
170-
The following DEB or WHL packages must be installed for Python development:
171-
172-
- deb packages:
173-
- `knp-python3-framework_<knp_version>_amd64.deb`: a deb package containing a Python framework for an `AltAI SNN` backend.
174-
- `knp_ann2snn.deb`: a deb package with the `ANN2SNN` package, `AltAI ANN2SNN` backend binary code for the AltAI-1 neuromorphic processor, and a component for placing the neural network on AltAI-1.
175-
- whl packages for installing from PyPI:
176-
- `knp-<knp_version>-py3-none-any.whl`: a whl package containing a Python framework for an `AltAI SNN` backend.
177-
178-
- `knp_ann2snn_x86_64_<motiv_version>-py3-none-any.whl`: a whl package with the `ANN2SNN` package, `AltAI ANN2SNN` backend binary code for the AltAI-1 neuromorphic processor, and a component for placing the neural network on AltAI-1.
179-
180-
This package is installed on x86-based computers.
181-
182-
- `knp_ann2snn_aarch64-<motiv_version>-py3-none-any.whl`: a whl package with the `ANN2SNN` package and the `AltAI ANN2SNN` backend binary code for the AltAI-1 neuromorphic processor.
183-
184-
This package is installed on ARM-based computers.
185-
186-
where:
187-
188-
- `<knp_version>` is the version of Kaspersky Neuromorphic Platform.
189-
- `<motiv_version>` is the version of the backends for the AltAI-1 neuromorphic processor and the `ANN2SNN` package.
190-
191-
_To install deb packages for Python development:_
192-
193-
1. To install the deb package with a Python framework for an `AltAI SNN` backend, run the following as root:
194-
195-
```
196-
dpkg -i <path-to-deb-package>/knp-python3-framework_<knp_version>_amd64.deb
197-
```
198-
199-
1. To install the deb packages with `ANN2SNN` package and `AltAI ANN2SNN` backend binary code, run the following commands as root:
200-
201-
```
202-
dpkg -i <path-to-deb-package>/knp_ann2snn.deb
203-
```
204-
205-
When installing the `knp_ann2snn.deb` package, accept the AltAI-1 backends and `ANN2SNN` package 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.
206-
207-
where:
208-
209-
- `<path-to-deb-package>` is the path to the deb package;
210-
- `<knp_version>` is the Kaspersky Neuromorphic Platform version.
211-
212-
Use the `pip3` package manager to install whl packages from the PyPI platform.
213-
214-
_To install the whl packages:_
215-
216-
1. To install a whl package containing a Python framework for an `AltAI SNN` backend, run the following command:
217-
218-
```
219-
pip3 install --break-system-packages knp-<knp_version>-py3-none-any.whl
220-
```
221-
222-
1. To install a whl package containing an `ANN2SNN` package and `AltAI ANN2SNN` backend binaries, do one of the following:
223-
224-
- To install a package on an x86-based computer, run:
225-
226-
```
227-
pip3 install --break-system-packages knp_ann2snn_x86_64_<motiv_version>-py3-none-any.whl
228-
```
229-
230-
- If you need to install a package on an ARM-based computer, run:
231-
232-
```
233-
pip3 install --break-system-packages knp_ann2snn_aarch64-<motiv_version>-py3-none-any.whl.whl
234-
```
235-
236-
where:
237-
238-
- `<knp_version>` is the version of Kaspersky Neuromorphic Platform.
239-
- `<motiv_version>` is the version of the backends for the AltAI-1 neuromorphic processor and the `ANN2SNN` package.
240-
241-
### Scenario for building a platform project or an application solution
242-
243-
You can build a platform or an application solution in C++. The platform build can be used when developing the Kaspersky Neuromorphic Platform.
244-
245-
When developing application solutions, you can install the required deb packages instead of building the solution.
246-
247-
You can also use the Docker image `knp-build-image` included in the platform distribution kit to build the platform or an application.
248-
249-
A platform or application solution build script consists of the following stages:
250-
251-
1. Obtaining the platform source code
252-
253-
You can get the platform source code in one of the following ways:
254-
255-
- Download the archive with the source code from the platform repository and unpack it to the working directory.
256-
- Clone the platform repository.
257-
258-
1. Defining the Boost_ROOT setting in Windows
259-
260-
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.\
261-
You can define the path to the installed Boost library as a CMake invocation parameter using the following command:
262-
263-
```
264-
cmake -DBOOST-ROOT=<path to installed Boost library>
265-
```
266-
267-
1. Configuring the build settings for the application solution
268-
269-
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:
270-
271-
- `neuron_traits`
272-
- `synapse_traits`
273-
- `core`
274-
- `meta`
275-
- `devices`
276-
- `backends`
277-
- `framework`
278-
279-
1. Configuring a platform or an application solution build
280-
281-
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 <a href="https://cmake.org/documentation/">CMake documentation</a>.\
282-
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.\
283-
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.
284-
285-
1. Starting the build
286-
287-
Start the platform or application solution build. For more details on starting the build of projects, refer to the <a href="https://cmake.org/documentation/">CMake documentation</a> or the documentation of the integrated development environment being used.
288-
28995
## Trademark notices
29096

29197
Registered trademarks and service marks are the property of their respective owners.
@@ -307,6 +113,5 @@ This is an open source project. If you are interested in making a code contribut
307113

308114
## License
309115

310-
Copyright © 2024 AO Kaspersky Lab
116+
Copyright © 2025 AO Kaspersky Lab
311117
Licensed under the Apache 2.0 License. See the `LICENSE.txt` file in the root directory for details.
312-
.

azure-pipelines.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Starter pipeline
2+
# Start with a minimal pipeline that you can customize to build and deploy your code.
3+
# Add steps that build, run tests, deploy, and more:
4+
# https://aka.ms/yaml
5+
6+
trigger:
7+
- master
8+
9+
pool:
10+
name: FT-SNN
11+
demands: Agent.OS -equals Linux
12+
13+
steps:
14+
- script: |
15+
echo Set rebase
16+
17+
git config pull.rebase true
18+
19+
git remote add tfs -m master "https://hqrndtfs.avp.ru/tfs/DefaultCollection/FT-SNN/_git/knp_from_gh"
20+
git remote add github "git@github.com:KasperskyLab/knp.git"
21+
22+
git config user.name "FT-SNN Build Service"
23+
git config user.email "git@avp.ru"
24+
25+
git remote -v
26+
displayName: 'Change git settings'
27+
28+
- script: 'git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" fetch tfs master'
29+
displayName: 'Fetch changes from the local TFS'
30+
31+
- script: 'git merge tfs/master --allow-unrelated-histories'
32+
displayName: 'Merge local changes from TFS'
33+
34+
#- script: |
35+
# pip3 install -r requirements.txt --break-system-packages
36+
# git config --global http.version HTTP/1.1
37+
# displayName: 'Setup additional requirements and configuration hacks'
38+
# enabled: false
39+
40+
# - task: CMake@1
41+
# displayName: 'CMake GCC Configuration'
42+
# inputs:
43+
# workingDirectory: '$(Build.SourcesDirectory)'
44+
# cmakeArgs: '-DBoost_ROOT=/usr/local/boost/1.84.0/ -DKNP_BUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX="install" -DKNP_BUILD_DOCUMENTATION=ON -DKNP_ENABLE_COVERAGE=ON -DKNP_PYTHON_BUILD_WHEEL=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -B $(Build.BinariesDirectory) -S $(Build.SourcesDirectory)'
45+
# enabled: false
46+
47+
# - task: CMake@1
48+
# displayName: 'GCC Build'
49+
# inputs:
50+
# cmakeArgs: '--build $(Build.BinariesDirectory) --parallel --clean-first'
51+
# enabled: false
52+
53+
# - script: 'ctest -V --output-junit linux_tests_result.xml'
54+
# workingDirectory: '$(Build.BinariesDirectory)/knp/tests'
55+
# failOnStderr: true
56+
# displayName: 'CTest tests'
57+
# enabled: false
58+
59+
# - task: PublishTestResults@2
60+
# displayName: 'Publish Test Results'
61+
# inputs:
62+
# testResultsFiles: '$(Build.BinariesDirectory)/knp/tests/linux_tests_result.xml'
63+
# enabled: false
64+
65+
# - task: ArchiveFiles@2
66+
# displayName: 'Archive auto-generated documentation'
67+
# inputs:
68+
# rootFolderOrFile: '$(Build.BinariesDirectory)/doc_doxygen'
69+
# archiveType: 7z
70+
# sevenZipCompression: maximum
71+
# archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId)_doc.7z'
72+
# enabled: false
73+
74+
# - task: DownloadSecureFile@1
75+
# displayName: 'Download Titan1 SSH key'
76+
# inputs:
77+
# secureFile: 'titan1_service_id_rsa'
78+
79+
# - script: |
80+
# chmod 0600 $(ssh_private_key.secureFilePath) && \
81+
# ssh -o StrictHostKeyChecking=no -i $(ssh_private_key.secureFilePath) svc_ft_publisher@titan1.avp.ru "mkdir -p /data/knp2/$(Build.BuildId)/" && \
82+
# scp -r -o StrictHostKeyChecking=no -i $(ssh_private_key.secureFilePath) $(Build.BuildId)_doc.7z svc_ft_publisher@titan1.avp.ru:/data/knp2/$(Build.BuildId)/
83+
# workingDirectory: '$(Build.ArtifactStagingDirectory)'
84+
# displayName: 'Publish build to the Titan1 via SSH'
85+
# enabled: false
86+
87+
- task: DownloadSecureFile@1
88+
displayName: 'Download Github deploy key'
89+
inputs:
90+
secureFile: 'github_deploy_key'
91+
92+
- script:
93+
chmod 0600 $(github_deploy_key.secureFilePath) && \
94+
GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no -i $(github_deploy_key.secureFilePath)" git push -u github --all
95+
displayName: 'Push to Github'

examples/mnist-client/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The `visualize_network.cpp` program file contains implementations of the followi
8787
* `draw_annotated_subgraph` function that draws a network graph with inscriptions for node names or IDs.
8888
* `draw_subgraph` function that draws a connected subgraph.
8989
* `make_reverse_list` function that creates a reverse adjacency list where each node has a list of nodes to which it is adjacent.
90-
* `find_connected_set` function that fins an independent subgraph inside a network graph.
90+
* `find_connected_set` function that finds an independent subgraph inside a network graph.
9191
* `divide_graph_by_connectivity` function defined in the `visualize_network.h` file.
9292
* `print_connected_subset` function that prints the description of a network subgraph.
9393
* `print_network_description` function defined in the `visualize_network.h` file.
@@ -138,12 +138,9 @@ If you install the `knp-examples` package, the example binary file is located in
138138

139139
`$ mnist-client`
140140

141-
You can also build the example by using CMake. The example binary file will be located in the `/build/bin` directory. To execute the created binary file, run the following commands:
141+
You can also build the example by using CMake. The example binary file will be located in the `build/bin` directory. To execute the created binary file, run the following commands:
142142

143-
```
144-
$ cd /build/bin
145-
$ mnist-client
146-
```
143+
`$ build/bin/mnist-client`
147144

148145

149146
# Information about third-party code

0 commit comments

Comments
 (0)