Skip to content

Commit

Permalink
Merge pull request #87 from sony/feature/20231122-add-exclude-funcset
Browse files Browse the repository at this point in the history
Sync API level with filtering out Einsum
  • Loading branch information
YukioOobuchi authored Nov 30, 2023
2 parents ecd5ad2 + 1190e46 commit 8ca090d
Show file tree
Hide file tree
Showing 13 changed files with 557 additions and 6 deletions.
4 changes: 2 additions & 2 deletions VERSION.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NNABLA_VERSION: 1.34.0.dev1
NNABLA_VERSION: 1.38.0.dev1
C_RUNTIME_VERSION: 1.2.0.dev1_c1
NNB_MINIMUM_VERSION: 2
NNB_VERSION: 3
API_LEVEL: 44
API_LEVEL: 45
129 changes: 129 additions & 0 deletions build-tools/code-generator/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2943,6 +2943,26 @@ Array Manipulation:
id: 85
func_type:
- ALL
Trilu:
snake_name: trilu
inputs:
x: {}
arguments:
k:
type: int64
default: '0'
upper:
type: bool
default: 'True'
outputs:
y: {}
c_runtime: support
function_ids:
iB: 360
uniq_name: Trilu_iB
id: 360
func_type:
- ALL
Meshgrid:
snake_name: meshgrid
inputs:
Expand Down Expand Up @@ -4720,3 +4740,112 @@ Unsupported, Special Use:
id: 280
func_type:
- ALL
Unique:
snake_name: unique
inputs:
x: {}
arguments:
flatten:
type: bool
default: 'True'
axis:
type: int64
default: None
sorted:
type: bool
default: 'True'
with_index:
type: bool
default: 'False'
with_inverse:
type: bool
default: 'False'
with_counts:
type: bool
default: 'False'
outputs:
y: {}
indices: {}
inverse_indices: {}
counts: {}
c_runtime: not support
function_ids:
BiBBBB: 358
uniq_name: Unique_BiBBBB
id: 358
func_type:
- ALL
EyeLike:
snake_name: eye_like
inputs:
x: {}
arguments:
k:
type: int64
default: '0'
outputs:
y: {}
c_runtime: not support
function_ids:
i: 354
uniq_name: EyeLike_i
id: 354
func_type:
- ALL
Mod2:
snake_name: mod2
inputs:
x0: {}
x1: {}
arguments:
fmod:
type: bool
default: 'False'
outputs:
y: {}
c_runtime: not support
function_ids:
B: 355
uniq_name: Mod2_B
id: 355
func_type:
- ALL
BitShift:
snake_name: bit_shift
inputs:
x: {}
shift: {}
arguments:
direction:
type: string
available_values:
- LEFT
- RIGHT
default: '''LEFT'''
outputs:
y: {}
c_runtime: not support
function_ids:
i: 356
uniq_name: BitShift_i
id: 356
func_type:
- ALL
Einsum:
snake_name: einsum
inputs:
x:
variadic: true
arguments:
equation:
type: string
default: ''
outputs:
y: {}
c_runtime: not support
function_ids:
i: 359
uniq_name: Einsum_i
id: 359
func_type:
- None
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def generate(filename, info):
'/// @defgroup {} {}'.format(cn.split(',').pop().replace(' ', ''), cn.split(',').pop()))
defines.append('/// @{')
for fn, func in cat.items():
if func['func_type'] == ['None']:
continue
defines.append('')
defines.append('/// @defgroup {0} {0}'.format(fn))
defines.append('/// @{')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ def generate(filename, info):
dump = []
for cn, cat in info.items():
for fn, func in cat.items():
if func['func_type'] == ['None']:
continue
printname.append(
' case NN_FUNCTION_{}: {{ // {}'.format(func['snake_name'].upper(), fn))
printname.append(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def generate(filename, info):
l = []
for cn, cat in info.items():
for fn, func in cat.items():
if func['func_type'] == ['None']:
continue
l.append('#ifdef CONFIG_{}'.format(fn.upper()))
for n, f in enumerate(func['function_ids'].items()):
l += _generate_context_code(fn, func, n, f[0], f[1])
Expand Down
2 changes: 1 addition & 1 deletion build-tools/make/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ nnabla-c-runtime-check-copyright:
ifneq ("$(NNABLA_DIRECTORY)","")
.PHONY: nnabla-c-runtime-update-function-info
nnabla-c-runtime-update-function-info: nnabla-install
@nnabla_cli function_info -o $(NNABLA_C_RUNTIME_DIRECTORY)/build-tools/code-generator/functions.yaml
@nnabla_cli function_info -x Einsum -o $(NNABLA_C_RUNTIME_DIRECTORY)/build-tools/code-generator/functions.yaml
@sed -i -e "s/\(NNABLA_VERSION: \).*/\1$(NNABLA_VERSION)/" $(NNABLA_C_RUNTIME_DIRECTORY)/VERSION.txt
@sed -i -e "s/API_LEVEL:.*/$(API_LEVEL)/" $(NNABLA_C_RUNTIME_DIRECTORY)/VERSION.txt

Expand Down
12 changes: 9 additions & 3 deletions doc/SUPPORT_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

# Implement status

Total 62/222
Total 63/228


## Neural Network Layer
Expand Down Expand Up @@ -196,7 +196,7 @@ Count 6/24
| Erf | no | - | - |

## Array Manipulation
Count 11/33
Count 11/34

| Function | Available | float | generic |
|------------------------------|--------------|--------------|--------------|
Expand All @@ -217,6 +217,7 @@ Count 11/33
| Shape | no | - | - |
| MatrixDiag | yes | yes | yes |
| MatrixDiagPart | yes | yes | yes |
| Trilu | no | - | - |
| Meshgrid | no | - | - |
| BatchDet | no | - | - |
| BatchInv | no | - | - |
Expand Down Expand Up @@ -321,7 +322,7 @@ Count 0/3
| ConfusionMatrix | no | - | - |

## Unsupported, Special Use
Count 0/7
Count 1/12

| Function | Available | float | generic |
|------------------------------|--------------|--------------|--------------|
Expand All @@ -332,4 +333,9 @@ Count 0/7
| ONNXNonMaxSuppression | no | - | - |
| MaxPoolingBackward | no | - | - |
| PatchCorrelation | no | - | - |
| Unique | no | - | - |
| EyeLike | no | - | - |
| Mod2 | no | - | - |
| BitShift | no | - | - |
| Einsum | yes | ? | ? |

25 changes: 25 additions & 0 deletions include/nnablart/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@
#define CONFIG_BINARYWEIGHTCONVOLUTION_FIXED8 1
#define CONFIG_BINARYWEIGHTCONVOLUTION_FLOAT32 1
#define CONFIG_BINARYWEIGHTCONVOLUTION_GENERIC 1
#define CONFIG_BITSHIFT 1
#define CONFIG_BITSHIFT_FIXED16 1
#define CONFIG_BITSHIFT_FIXED8 1
#define CONFIG_BITSHIFT_FLOAT32 1
#define CONFIG_BITSHIFT_GENERIC 1
#define CONFIG_BOOLFILL 1
#define CONFIG_BOOLFILL_FIXED16 1
#define CONFIG_BOOLFILL_FIXED8 1
Expand Down Expand Up @@ -348,6 +353,11 @@
#define CONFIG_EXP_FIXED8 1
#define CONFIG_EXP_FLOAT32 1
#define CONFIG_EXP_GENERIC 1
#define CONFIG_EYELIKE 1
#define CONFIG_EYELIKE_FIXED16 1
#define CONFIG_EYELIKE_FIXED8 1
#define CONFIG_EYELIKE_FLOAT32 1
#define CONFIG_EYELIKE_GENERIC 1
#define CONFIG_FFT 1
#define CONFIG_FFT_FIXED16 1
#define CONFIG_FFT_FIXED8 1
Expand Down Expand Up @@ -663,6 +673,11 @@
#define CONFIG_MISH_FIXED8 1
#define CONFIG_MISH_FLOAT32 1
#define CONFIG_MISH_GENERIC 1
#define CONFIG_MOD2 1
#define CONFIG_MOD2_FIXED16 1
#define CONFIG_MOD2_FIXED8 1
#define CONFIG_MOD2_FLOAT32 1
#define CONFIG_MOD2_GENERIC 1
#define CONFIG_MUL2 1
#define CONFIG_MUL2_FIXED16 1
#define CONFIG_MUL2_FIXED8 1
Expand Down Expand Up @@ -1088,6 +1103,16 @@
#define CONFIG_TRANSPOSE_FIXED8 1
#define CONFIG_TRANSPOSE_FLOAT32 1
#define CONFIG_TRANSPOSE_GENERIC 1
#define CONFIG_TRILU 1
#define CONFIG_TRILU_FIXED16 1
#define CONFIG_TRILU_FIXED8 1
#define CONFIG_TRILU_FLOAT32 1
#define CONFIG_TRILU_GENERIC 1
#define CONFIG_UNIQUE 1
#define CONFIG_UNIQUE_FIXED16 1
#define CONFIG_UNIQUE_FIXED8 1
#define CONFIG_UNIQUE_FLOAT32 1
#define CONFIG_UNIQUE_GENERIC 1
#define CONFIG_UNLINK 1
#define CONFIG_UNLINK_FIXED16 1
#define CONFIG_UNLINK_FIXED8 1
Expand Down
Loading

0 comments on commit 8ca090d

Please sign in to comment.