Skip to content

Commit 8494275

Browse files
Update internal ovxlib to release/1.2.22 (#706)
* Update internal ovxlib to release/1.2.22 Signed-off-by: Feiyue.Chen <[email protected]> * Refine yaml file for blocking tfhub model tests Signed-off-by: Feiyue.Chen <[email protected]> --------- Signed-off-by: Feiyue.Chen <[email protected]>
1 parent 1498348 commit 8494275

File tree

94 files changed

+9470
-3889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+9470
-3889
lines changed

.github/workflows/cmake_x86_vsim.yml

+53-53
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
run: |
125125
git config --global user.email "[email protected]"
126126
git config --global user.name "xiang.zhang"
127-
git clone https://github.com/tensorflow/tensorflow.git ${{github.workspace}}/3rd-party/tensorflow && cd ${{github.workspace}}/3rd-party/tensorflow/ && git checkout v2.10.0
127+
git clone https://github.com/tensorflow/tensorflow.git ${{github.workspace}}/3rd-party/tensorflow && cd ${{github.workspace}}/3rd-party/tensorflow/ && git checkout v2.16.1
128128
git clone https://github.com/VeriSilicon/tflite-vx-delegate.git ${{github.workspace}}/vx-delegate
129129
cmake -B ${{github.workspace}}/vx-delegate/build -S ${{github.workspace}}/vx-delegate -DFETCHCONTENT_SOURCE_DIR_TENSORFLOW=${{github.workspace}}/3rd-party/tensorflow -DTIM_VX_INSTALL=${{github.workspace}}/tim-vx.install.dir/ -DTFLITE_ENABLE_NNAPI=OFF -DTFLITE_ENABLE_XNNPACK=OFF
130130
cmake --build ${{github.workspace}}/vx-delegate/build --config ${{env.BUILD_TYPE}}
@@ -283,61 +283,61 @@ jobs:
283283
# chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
284284
# ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/tfhub.movenet.multipose.tflite
285285

286-
tfhub-efficientdet-lite0:
287-
runs-on: ubuntu-latest
288-
needs: [vx-delegate-build, tim-vx-unit-test]
289-
steps:
290-
- name: download test binary
291-
uses: actions/download-artifact@v3
292-
- name: download model
293-
run: |
294-
wget https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/efficientdet/lite0/detection/metadata/1.tflite
295-
- name: benchmark-model
296-
run: |
297-
chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
298-
${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/1.tflite
286+
# tfhub-efficientdet-lite0:
287+
# runs-on: ubuntu-latest
288+
# needs: [vx-delegate-build, tim-vx-unit-test]
289+
# steps:
290+
# - name: download test binary
291+
# uses: actions/download-artifact@v3
292+
# - name: download model
293+
# run: |
294+
# wget https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/efficientdet/lite0/detection/metadata/1.tflite
295+
# - name: benchmark-model
296+
# run: |
297+
# chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
298+
# ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/1.tflite
299299

300-
tfhub-efficientdet-lite1:
301-
runs-on: ubuntu-latest
302-
needs: [vx-delegate-build, tim-vx-unit-test]
303-
steps:
304-
- name: download test binary
305-
uses: actions/download-artifact@v3
306-
- name: download model
307-
run: |
308-
wget https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/efficientdet/lite1/detection/metadata/1.tflite
309-
- name: benchmark-model
310-
run: |
311-
chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
312-
${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/1.tflite
300+
# tfhub-efficientdet-lite1:
301+
# runs-on: ubuntu-latest
302+
# needs: [vx-delegate-build, tim-vx-unit-test]
303+
# steps:
304+
# - name: download test binary
305+
# uses: actions/download-artifact@v3
306+
# - name: download model
307+
# run: |
308+
# wget https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/efficientdet/lite1/detection/metadata/1.tflite
309+
# - name: benchmark-model
310+
# run: |
311+
# chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
312+
# ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/1.tflite
313313

314-
tfhub-efficientdet-lite2:
315-
runs-on: ubuntu-latest
316-
needs: [vx-delegate-build, tim-vx-unit-test]
317-
steps:
318-
- name: download test binary
319-
uses: actions/download-artifact@v3
320-
- name: download model
321-
run: |
322-
wget https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/efficientdet/lite2/detection/metadata/1.tflite
323-
- name: benchmark-model
324-
run: |
325-
chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
326-
${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/1.tflite
314+
# tfhub-efficientdet-lite2:
315+
# runs-on: ubuntu-latest
316+
# needs: [vx-delegate-build, tim-vx-unit-test]
317+
# steps:
318+
# - name: download test binary
319+
# uses: actions/download-artifact@v3
320+
# - name: download model
321+
# run: |
322+
# wget https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/efficientdet/lite2/detection/metadata/1.tflite
323+
# - name: benchmark-model
324+
# run: |
325+
# chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
326+
# ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/1.tflite
327327

328-
tfhub-efficientdet-lite3:
329-
runs-on: ubuntu-latest
330-
needs: [vx-delegate-build, tim-vx-unit-test]
331-
steps:
332-
- name: download test binary
333-
uses: actions/download-artifact@v3
334-
- name: download model
335-
run: |
336-
wget https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/efficientdet/lite2/detection/metadata/1.tflite
337-
- name: benchmark-model
338-
run: |
339-
chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
340-
${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/1.tflite
328+
# tfhub-efficientdet-lite3:
329+
# runs-on: ubuntu-latest
330+
# needs: [vx-delegate-build, tim-vx-unit-test]
331+
# steps:
332+
# - name: download test binary
333+
# uses: actions/download-artifact@v3
334+
# - name: download model
335+
# run: |
336+
# wget https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/efficientdet/lite2/detection/metadata/1.tflite
337+
# - name: benchmark-model
338+
# run: |
339+
# chmod u+x ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model
340+
# ${{github.workspace}}/vx-delegate-bin/_deps/tensorflow-build/tools/benchmark/benchmark_model --num_runs=1 --external_delegate_path=${{github.workspace}}/vx-delegate-bin/libvx_delegate.so --graph=${{github.workspace}}/1.tflite
341341

342342
# acuity-yolov3-608-quant:
343343
# runs-on: ubuntu-latest

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.14
1+
1.2.22

src/tim/vx/internal/include/custom/custom_node_type.def

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ DEF_NODE_TYPE(custom_sample)
99
DEF_NODE_TYPE(custom_tiny_yolov4_postprocess)
1010
DEF_NODE_TYPE(custom_tiny_yolov4_postprocess_confidence)
1111
DEF_NODE_TYPE(custom_tiny_yolov4_postprocess_box)
12+
DEF_NODE_TYPE(custom_letterbox)

src/tim/vx/internal/include/custom/custom_ops.def

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ DEF_OP(CUSTOM_SAMPLE)
99
DEF_OP(CUSTOM_TINY_YOLOV4_POSTPROCESS)
1010
DEF_OP(CUSTOM_TINY_YOLOV4_POSTPROCESS_CONFIDENCE)
1111
DEF_OP(CUSTOM_TINY_YOLOV4_POSTPROCESS_BOX)
12+
DEF_OP(CUSTOM_LETTERBOX)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/****************************************************************************
2+
*
3+
* Copyright (c) 2020 Vivante Corporation
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a
6+
* copy of this software and associated documentation files (the "Software"),
7+
* to deal in the Software without restriction, including without limitation
8+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
* and/or sell copies of the Software, and to permit persons to whom the
10+
* Software is furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in
13+
* all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21+
* DEALINGS IN THE SOFTWARE.
22+
*
23+
*****************************************************************************/
24+
#ifndef _VSI_NN_OP_CUSTOM_LETTERBOX_H
25+
#define _VSI_NN_OP_CUSTOM_LETTERBOX_H
26+
27+
#include "vsi_nn_types.h"
28+
29+
#ifdef __cplusplus
30+
extern "C" {
31+
#endif
32+
33+
typedef struct _vsi_nn_custom_letterbox_param
34+
{
35+
struct _custom_letterbox_local_data_t* local;
36+
int32_t new_shape_w;
37+
int32_t new_shape_h;
38+
vx_bool auto_bool;
39+
vx_bool scaleFill;
40+
vx_bool scaleup;
41+
int32_t stride;
42+
vx_bool center;
43+
float mean_r;
44+
float mean_g;
45+
float mean_b;
46+
float scale_r;
47+
float scale_g;
48+
float scale_b;
49+
int32_t pad_value_r;
50+
int32_t pad_value_g;
51+
int32_t pad_value_b;
52+
vx_bool reverse_channel;
53+
} vsi_nn_custom_letterbox_param;
54+
_compiler_assert(offsetof(vsi_nn_custom_letterbox_param, local) == 0, \
55+
vsi_nn_custom_lertterbox_h );
56+
57+
#ifdef __cplusplus
58+
}
59+
#endif
60+
61+
#endif

src/tim/vx/internal/include/custom/vsi_nn_custom_node_type.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@
3434
#include "custom/ops/vsi_nn_op_custom_tiny_yolov4_postprocess.h"
3535
#include "custom/ops/vsi_nn_op_custom_tiny_yolov4_postprocess_confidence.h"
3636
#include "custom/ops/vsi_nn_op_custom_tiny_yolov4_postprocess_box.h"
37+
#include "custom/ops/vsi_nn_op_custom_letterbox.h"
3738

3839
#endif

src/tim/vx/internal/include/interface/ops.def

+1
Original file line numberDiff line numberDiff line change
@@ -203,3 +203,4 @@ DEF_OP(BITCAST)
203203
DEF_OP(GROUPED_CONV3D)
204204
DEF_OP(COL2IM)
205205
DEF_OP(L1_LAYER_NORM)
206+
DEF_OP(ROPE)

src/tim/vx/internal/include/ops/vsi_nn_op_pre_process_rgb.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ typedef struct _vsi_nn_pre_process_rgb_param
8080
float g_scale;
8181
float b_scale;
8282
/* pre process rgb layer local data structure */
83-
vsi_nn_pre_process_rgb_lcl_data local;
83+
vsi_nn_pre_process_rgb_lcl_data *local;
8484
} vsi_nn_pre_process_rgb_param;
8585

8686
#ifdef __cplusplus
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/****************************************************************************
2+
*
3+
* Copyright (c) 2020 Vivante Corporation
4+
*
5+
* Permission is hereby granted, free of charge, to any person obtaining a
6+
* copy of this software and associated documentation files (the "Software"),
7+
* to deal in the Software without restriction, including without limitation
8+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
* and/or sell copies of the Software, and to permit persons to whom the
10+
* Software is furnished to do so, subject to the following conditions:
11+
*
12+
* The above copyright notice and this permission notice shall be included in
13+
* all copies or substantial portions of the Software.
14+
*
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21+
* DEALINGS IN THE SOFTWARE.
22+
*
23+
*****************************************************************************/
24+
25+
#ifndef _VSI_NN_OP_ROPE_H
26+
#define _VSI_NN_OP_ROPE_H
27+
28+
#include "vsi_nn_types.h"
29+
30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
34+
typedef struct _vsi_nn_rope_param
35+
{
36+
struct _rope_local_data_t* local;
37+
// Add parameters here
38+
int32_t axis;
39+
vsi_bool interleaved;
40+
} vsi_nn_rope_param;
41+
_compiler_assert(offsetof(vsi_nn_rope_param, local) == 0, \
42+
vsi_nn_rope_h );
43+
44+
#ifdef __cplusplus
45+
}
46+
#endif
47+
48+
#endif
49+

src/tim/vx/internal/include/ops/vsi_nn_op_topk.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ typedef struct _vsi_nn_topk_param
3434
{
3535
uint32_t k;
3636
int32_t axis;
37+
struct _topk_local_data_t* local;
3738
} vsi_nn_topk_param;
3839

3940
#ifdef __cplusplus

src/tim/vx/internal/include/utils/vsi_nn_dtype_util_prv.h

+4-12
Original file line numberDiff line numberDiff line change
@@ -384,25 +384,17 @@ static VSI_INLINE_API float fp16_to_fp32
384384

385385
static VSI_INLINE_API float bfp16_to_fp32
386386
(
387-
int16_t in
387+
uint16_t in
388388
)
389389
{
390-
uint32_t t1, t2, t3;
391390
float out;
392391
fp32_bit_cast_t fp32_bit_cast;
393392

394-
t1 = in & 0x00FF; // Mantissa
395-
t2 = in & 0xFF00; // Sign bit + Exponent
396-
t3 = in & 0x7F00; // Exponent
397-
398-
t1 <<= 16;
399-
t2 <<= 16; // Shift (sign + Exponent) bit into position
400-
t1 |= t2; // Re-insert (sign + Exponent) bit
393+
fp32_bit_cast.data = (uint32_t)(in << 16);
401394

402-
fp32_bit_cast.data = t1;
403395
out = fp32_bit_cast.val;
404396

405-
return t3 == 0 ? 0.0f : out;
397+
return out;
406398
} /* bfp16_to_fp32() */
407399

408400
static VSI_INLINE_API uint16_t fp32_to_fp16
@@ -720,7 +712,7 @@ static VSI_INLINE_API vsi_status dtype_to_float32
720712
*dst = fp16_to_fp32( *(int16_t *)src );
721713
break;
722714
case VSI_NN_TYPE_BFLOAT16:
723-
*dst = bfp16_to_fp32( *(int16_t *)src );
715+
*dst = bfp16_to_fp32( *(uint16_t *)src );
724716
break;
725717
case VSI_NN_TYPE_FLOAT8_E4M3:
726718
*dst = fp8_e4m3_to_fp32(*(int8_t*)src, src_dtype->scale);

0 commit comments

Comments
 (0)