Skip to content

Commit

Permalink
Merge branch 'MaximIntegratedAI:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanbsolak authored Feb 2, 2024
2 parents 3016000 + 2b2c2c1 commit 3f4405e
Show file tree
Hide file tree
Showing 16 changed files with 101,081 additions and 66,577 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

7 changes: 3 additions & 4 deletions assets/device-all/softmax.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved.
*
* Portions Copyright (C) 2020 Maxim Integrated Products, Inc. (now owned
* by Analog Devices, Inc.).
*
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -16,10 +19,6 @@
* limitations under the License.
*/

/*
* Portions Copyright (C) 2020 Maxim Integrated Products, Inc.
*/

/* ----------------------------------------------------------------------
* Project: NN Library
* Title: softmax.c
Expand Down
52 changes: 20 additions & 32 deletions assets/makefile/Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
# /*******************************************************************************
# * Copyright (C) 2022-2023 Maxim Integrated Products, Inc., All Rights Reserved.
# *
# * Permission is hereby granted, free of charge, to any person obtaining a
# * copy of this software and associated documentation files (the "Software"),
# * to deal in the Software without restriction, including without limitation
# * the rights to use, copy, modify, merge, publish, distribute, sublicense,
# * and/or sell copies of the Software, and to permit persons to whom the
# * Software is furnished to do so, subject to the following conditions:
# *
# * The above copyright notice and this permission notice shall be included
# * in all copies or substantial portions of the Software.
# *
# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
# * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# * OTHER DEALINGS IN THE SOFTWARE.
# *
# * Except as contained in this notice, the name of Maxim Integrated
# * Products, Inc. shall not be used except as stated in the Maxim Integrated
# * Products, Inc. Branding Policy.
# *
# * The mere transfer of this software does not imply any licenses
# * of trade secrets, proprietary technology, copyrights, patents,
# * trademarks, maskwork rights, or any other form of intellectual
# * property whatsoever. Maxim Integrated Products, Inc. retains all
# * ownership rights.
# *******************************************************************************
# */
###############################################################################
#
# Copyright (C) 2022-2023 Maxim Integrated Products, Inc. All Rights Reserved.
# (now owned by Analog Devices, Inc.),
# Copyright (C) 2023-2024 Analog Devices, Inc. All Rights Reserved. This software
# is proprietary to Analog Devices, Inc. and its licensors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###############################################################################

# ** Readme! **
# Don't edit this file! This is the core Makefile for a MaximSDK
Expand Down
1 change: 1 addition & 0 deletions gen-demos-max78000.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ python ai8xize.py --test-dir $TARGET --prefix cifar-100-mixed --checkpoint-file
python ai8xize.py --test-dir $TARGET --prefix cifar-100-simplewide2x-mixed --checkpoint-file trained/ai85-cifar100-simplenetwide2x-qat-mixed-q.pth.tar --config-file networks/cifar100-simplewide2x.yaml --softmax $COMMON_ARGS --boost 2.5 "$@"
python ai8xize.py --test-dir $TARGET --prefix cifar-100-residual --checkpoint-file trained/ai85-cifar100-residual-qat8-q.pth.tar --config-file networks/cifar100-ressimplenet.yaml --softmax $COMMON_ARGS --boost 2.5 "$@"
python ai8xize.py --test-dir $TARGET --prefix kws20_v3 --checkpoint-file trained/ai85-kws20_v3-qat8-q.pth.tar --config-file networks/kws20-v3-hwc.yaml --softmax $COMMON_ARGS "$@"
python ai8xize.py --test-dir $TARGET --prefix kws20_nas --checkpoint-file trained/ai85-kws20_nas-qat8-q.pth.tar --config-file networks/kws20-nas-hwc.yaml --softmax $COMMON_ARGS "$@"
python ai8xize.py --test-dir $TARGET --prefix faceid --checkpoint-file trained/ai85-faceid-qat8-q.pth.tar --config-file networks/faceid.yaml --fifo $COMMON_ARGS "$@"
python ai8xize.py --test-dir $TARGET --prefix cats-dogs --checkpoint-file trained/ai85-catsdogs-qat8-q.pth.tar --config-file networks/cats-dogs-hwc.yaml --fifo --softmax $COMMON_ARGS "$@"
python ai8xize.py --test-dir $TARGET --prefix camvid_unet --checkpoint-file trained/ai85-camvid-unet-large-fakept-q.pth.tar --config-file networks/camvid-unet-large-fakept.yaml $COMMON_ARGS --overlap-data --mlator --no-unload --max-checklines 8192 --new-kernel-loader "$@"
Expand Down
116 changes: 116 additions & 0 deletions networks/kws20-nas-hwc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
# HWC (big data) configuration for ai85kws20netnas

arch: ai85kws20netnas
dataset: KWS_20

# Define layer parameters in order of the layer sequence
layers:
# Conv 1D - 14 layers
# Unit-1
- data_format: HWC
operation: Conv1d
kernel_size: 1
pad: 0
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
- operation: Conv1d
kernel_size: 3
pad: 1
activate: ReLU
out_offset: 0x0000
processors: 0xffffffffffffffff
- operation: Conv1d
kernel_size: 3
pad: 1
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
# Unit-2
- max_pool: 2
pool_stride: 2
operation: Conv1d
kernel_size: 3
pad: 1
activate: ReLU
out_offset: 0x0000
processors: 0xffffffffffffffff
- operation: Conv1d
kernel_size: 1
pad: 0
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
- operation: Conv1d
kernel_size: 1
pad: 0
activate: ReLU
out_offset: 0x0000
processors: 0xffffffffffffffff
# Unit-3
- max_pool: 2
pool_stride: 2
operation: Conv1d
kernel_size: 3
pad: 1
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
- operation: Conv1d
kernel_size: 5
pad: 2
activate: ReLU
out_offset: 0x0000
processors: 0xffffffffffffffff
# Unit-4
- max_pool: 2
pool_stride: 2
operation: Conv1d
kernel_size: 5
pad: 2
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
- operation: Conv1d
kernel_size: 1
pad: 0
activate: ReLU
out_offset: 0x0000
processors: 0xffffffffffffffff
# Unit-5
- max_pool: 2
pool_stride: 2
operation: Conv1d
kernel_size: 5
pad: 2
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
- operation: Conv1d
kernel_size: 3
pad: 1
activate: ReLU
out_offset: 0x0000
processors: 0xffffffffffffffff
# Unit-6
- max_pool: 2
pool_stride: 2
operation: Conv1d
kernel_size: 5
pad: 2
activate: ReLU
out_offset: 0x2000
processors: 0xffffffffffffffff
- operation: Conv1d
kernel_size: 1
pad: 0
activate: ReLU
out_offset: 0x0000
processors: 0xffffffffffffffff
# Classification layer
- flatten: true
out_offset: 0x2000
processors: 0xffffffffffffffff
operation: MLP
output_width: 32
6 changes: 6 additions & 0 deletions scripts/gen_kws20_nas_max78000.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
DEVICE="MAX78000"
TARGET="sdk/Examples/$DEVICE/CNN"
COMMON_ARGS="--device $DEVICE --timer 0 --display-checkpoint --verbose"

python ai8xize.py --test-dir $TARGET --prefix kws20_nas --checkpoint-file trained/ai85-kws20_nas-qat8-q.pth.tar --config-file networks/kws20-nas-hwc.yaml --softmax $COMMON_ARGS "$@"
2 changes: 2 additions & 0 deletions scripts/quantize_kws20_nas.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
python quantize.py trained/ai85-kws20_nas-qat8.pth.tar trained/ai85-kws20_nas-qat8-q.pth.tar --device MAX78000 -v "$@"
Binary file added trained/ai85-kws20_nas-qat8-q.pth.tar
Binary file not shown.
Loading

0 comments on commit 3f4405e

Please sign in to comment.