Skip to content

Commit 7ed1334

Browse files
committed
DRAFT compiler support U24.04
on-going draft with compiler support U24.04 Signed-off-by: SaeHie Park <[email protected]>
1 parent c926396 commit 7ed1334

File tree

12 files changed

+95
-91
lines changed

12 files changed

+95
-91
lines changed

.github/workflows/run-onecc-build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ jobs:
4545
strategy:
4646
matrix:
4747
type: [ Debug, Release ]
48-
ubuntu_code: [ focal, jammy ]
48+
ubuntu_code: [ focal, jammy ] #, noble ]
4949
include:
5050
- ubuntu_code: focal
5151
ubuntu_ver: 20.04
5252
- ubuntu_code: jammy
5353
ubuntu_ver: 22.04
54+
#- ubuntu_code: noble
55+
# ubuntu_ver: 24.04
5456
runs-on: one-x64-linux
5557
container:
5658
image: samsungonedev.azurecr.io/nnfw/one-devtools:${{ matrix.ubuntu_code }}
@@ -67,9 +69,15 @@ jobs:
6769
# dalgona uses pybind11, but pybind11 cannot bind packages in virtualenv.
6870
# So we need to install packages for dalgona-test globally.
6971
- name: Install required packages
72+
if: ${{ matrix.ubuntu_code == 'focal' || matrix.ubuntu_code == 'jammy' }}
7073
run: |
7174
python3 -m pip install numpy h5py==3.11.0 flatbuffers==23.5.26
7275
76+
- name: Install required packages
77+
if: ${{ matrix.ubuntu_code == 'noble' }}
78+
run: |
79+
apt-get install -y python3-numpy python3-h5py python3-flatbuffers
80+
7381
- name: Caching externals
7482
uses: actions/cache@v4
7583
with:

.github/workflows/run-onert-android-build.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ on:
2121
- master
2222
- release/*
2323
paths:
24-
- '.github/workflows/run-onert-android-build.yml'
25-
- 'nn*'
26-
- 'Makefile.template'
27-
- 'infra/buildtool/**'
28-
- 'infra/cmake/**'
29-
- 'infra/nncc/**'
30-
- 'infra/nnfw/**'
3124
- 'runtime/**'
3225
- '!runtime/contrib/**'
3326
- '!**/*.md'

.github/workflows/run-onert-cross-build.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ on:
2121
- master
2222
- release/*
2323
paths:
24-
- '.github/workflows/run-onert-cross-build.yml'
25-
- 'nn*'
26-
- 'Makefile.template'
27-
- 'infra/buildtool/**'
28-
- 'infra/cmake/**'
29-
- 'infra/nncc/**'
30-
- 'infra/nnfw/**'
3124
- 'runtime/**'
3225
- '!runtime/contrib/**'
3326
- '!**/*.md'

.github/workflows/run-onert-gbs-build.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ on:
2424
- master
2525
- release/*
2626
paths:
27-
- '.github/workflows/run-onert-gbs-build.yml'
28-
- 'nncc'
29-
- 'nnfw'
30-
- 'compiler/luci/**'
31-
- 'compiler/loco/**'
32-
- 'compiler/logo/**'
33-
- 'compute/**'
34-
- 'infra/nnfw/**'
35-
- 'infra/cmake/**'
3627
- 'runtime/**'
3728
- '!runtime/contrib/**'
3829
- 'packaging/**'

.github/workflows/run-onert-native-build.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ on:
2121
- master
2222
- release/*
2323
paths:
24-
- '.github/workflows/run-onert-native-build.yml'
25-
- 'nn*'
26-
- 'Makefile.template'
27-
- 'infra/buildtool/**'
28-
- 'infra/cmake/**'
29-
- 'infra/nncc/**'
30-
- 'infra/nnfw/**'
3124
- 'runtime/**'
3225
- '!runtime/contrib/**'
3326
- '!**/*.md'

compiler/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set(ONE_UBUNTU_CODENAME "focal")
44
find_program(LSB_RELEASE_EXEC lsb_release)
55
if(LSB_RELEASE_EXEC)
6-
# output should be one of 'bionic', 'focal', 'jammy'
6+
# output should be one of 'bionic', 'focal', 'jammy', 'noble'
77
# others are not tested
88
execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --codename
99
OUTPUT_VARIABLE ONE_UBUNTU_CODENAME
@@ -14,6 +14,10 @@ endif()
1414

1515
if(${ONE_UBUNTU_CODENAME} STREQUAL "bionic")
1616
set(ONE_UBUNTU_CODENAME_BIONIC TRUE)
17+
elseif(${ONE_UBUNTU_CODENAME} STREQUAL "focal")
18+
set(ONE_UBUNTU_CODENAME_FOCAL TRUE)
19+
elseif(${ONE_UBUNTU_CODENAME} STREQUAL "jammy")
20+
set(ONE_UBUNTU_CODENAME_JAMMY TRUE)
1721
elseif(${ONE_UBUNTU_CODENAME} STREQUAL "noble")
1822
set(ONE_UBUNTU_CODENAME_NOBLE TRUE)
1923
endif()

compiler/one-cmds/CMakeLists.txt

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Ubuntu18.04; explictly installed python3.8 (default is python3.6)
33
# Ubuntu20.04; default python3.8
44
# Ubuntu22.04; default python3.10
5-
# Ubuntu24.04; explicitly installed python3.8 (default is python3.12)
5+
# Ubuntu24.04; default python3.12
66
# refer https://github.com/Samsung/ONE/issues/9962
77
if(CMAKE_VERSION VERSION_LESS 3.12)
88
find_package(PythonInterp 3.8 QUIET)
@@ -24,10 +24,10 @@ else()
2424
endif()
2525

2626
# tensorflow 2.12.1 supports Python 3.8 ~ 3.11
27-
if(Python_VERSION VERSION_GREATER_EQUAL 3.12)
28-
message(STATUS "Build one-cmds: FALSE (Python version 3.12 or higher is not supported yet)")
29-
return()
30-
endif()
27+
#if(Python_VERSION VERSION_GREATER_EQUAL 3.12)
28+
# message(STATUS "Build one-cmds: FALSE (Python version 3.12 or higher is not supported yet)")
29+
# return()
30+
#endif()
3131
if(Python_VERSION VERSION_LESS 3.8)
3232
message(STATUS "Build one-cmds: FAILED (Install Python version 3.8 or 3.10)")
3333
return()
@@ -67,17 +67,7 @@ if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
6767
# and install build/../one-prepare-venv file
6868
list(APPEND ONE_COMMAND_FILES one-prepare-venv.aarch64)
6969
else(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
70-
if(ONE_UBUNTU_CODENAME_BIONIC)
71-
# NOTE copy one-prepare-venv.u1804 as build/../one-prepare-venv
72-
# and install build/../one-prepare-venv file
73-
list(APPEND ONE_COMMAND_FILES one-prepare-venv.u1804)
74-
elseif(ONE_UBUNTU_CODENAME_NOBLE)
75-
# NOTE copy one-prepare-venv.u2404 as build/../one-prepare-venv
76-
# and install build/../one-prepare-venv file
77-
list(APPEND ONE_COMMAND_FILES one-prepare-venv.u2404)
78-
else()
79-
list(APPEND ONE_COMMAND_FILES one-prepare-venv)
80-
endif()
70+
list(APPEND ONE_COMMAND_FILES one-prepare-venv)
8171
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
8272

8373
# pytorch importer is an experimental feature, it is not used in default configuration

compiler/one-cmds/one-import-onnx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ import os
2424
import sys
2525
import tempfile
2626
import onnx
27-
import onnx_tf
27+
28+
# onnx_tf may not exist for latest python
29+
try:
30+
import onnx_tf
31+
_onnx_tf_enabled = True
32+
except ImportError:
33+
_onnx_tf_enabled = False
2834

2935
# ONNX legalizer is an optional feature
3036
# It enables conversion of some operations, but in experimental phase for now
@@ -124,6 +130,10 @@ class TidyIONames:
124130
self.onnx_model.graph.output[i].name = self.remap_outputs[idx]
125131

126132

133+
def _check_onnx_tf():
134+
import onnx
135+
136+
127137
def get_driver_cfg_section():
128138
return "one-import-onnx"
129139

@@ -330,6 +340,9 @@ def _convert(args):
330340
if _force_ext(args):
331341
run_default_import = False
332342

343+
if not _onnx_tf_enabled:
344+
run_default_import = False
345+
333346
res_conv = -1
334347
if run_default_import:
335348
if _force_ext(args):

compiler/one-cmds/one-prepare-venv

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ source /etc/lsb-release
5454
# - https://github.com/onnx/onnx/blob/master/docs/Versioning.md
5555
# - https://github.com/onnx/onnx-tensorflow/blob/master/Versioning.md
5656

57+
# default version values
5758
VER_TENSORFLOW=2.12.1
5859
VER_TF_PROB=0.20.1
5960
VER_TF_ADON=0.20.0
@@ -63,18 +64,31 @@ VER_ONNX_TF=1.10.0
6364
VER_PYDOT=1.4.2
6465
VER_TORCH="2.1.2+cpu"
6566
VER_PROTOBUF=4.23.3
66-
67-
# Install tensorflow
67+
VER_NUMPY=1.24.3
6868

6969
echo "Setting version for '$DISTRIB_CODENAME'"
7070
if [[ "$DISTRIB_CODENAME" == "bionic" ]]; then
71-
: # use as is
71+
: # use default
7272
elif [[ "$DISTRIB_CODENAME" == "focal" ]]; then
73-
: # use as is
73+
: # use default
7474
elif [[ "$DISTRIB_CODENAME" == "jammy" ]]; then
75-
: # TODO change vesions
75+
:
76+
#VER_TENSORFLOW=2.19.0
77+
#VER_TF_PROB=0.25.0
78+
#VER_TF_ADON=0.23.0
79+
#VER_ONNX=1.17.0
80+
#VER_ONNXRUNTIME=1.21.1
81+
#VER_TORCH="2.7.0+cpu"
82+
#VER_NUMPY=1.24.4
7683
elif [[ "$DISTRIB_CODENAME" == "noble" ]]; then
77-
: # TODO change vesions
84+
VER_TENSORFLOW=2.19.0
85+
VER_TF_PROB=0
86+
VER_TF_ADON=0 # EOL, don't exist in python3.12~
87+
VER_ONNX=1.17.0
88+
VER_ONNXRUNTIME=1.21.0
89+
VER_ONNX_TF=0
90+
VER_TORCH="2.7.0+cpu"
91+
VER_NUMPY=1.26.4
7892
else
7993
echo "Error one-prepare-venv: Unsupported codename $DISTRIB_CODENAME"
8094
exit -1
@@ -97,15 +111,18 @@ if [[ ! -z "$ONE_PREPVENV_PIP_OPTION" ]]; then
97111
fi
98112

99113
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade pip setuptools
100-
if [ -n "${EXT_TENSORFLOW_WHL}" ]; then
101-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install ${EXT_TENSORFLOW_WHL}
102-
else
103-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow-cpu==${VER_TENSORFLOW}
114+
115+
PYTHON_PACKAGES="tensorflow-cpu==${VER_TENSORFLOW} "
116+
117+
PYTHON_PACKAGES+="Pillow "
118+
119+
if [[ "$VER_TF_PROB" != "0" ]]; then
120+
# Fix version to that of TF release date
121+
PYTHON_PACKAGES+="tensorflow_probability==${VER_TF_PROB} "
122+
fi
123+
if [[ "$VER_TF_ADON" != "0" ]]; then
124+
PYTHON_PACKAGES+="tensorflow_addons==${VER_TF_ADON} "
104125
fi
105-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install Pillow
106-
# Fix version to that of TF release date
107-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_probability==${VER_TF_PROB}
108-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_addons==${VER_TF_ADON}
109126

110127
# Install PyTorch and ONNX related
111128
# NOTE set ONE_PREPVENV_TORCH_SOURCE to override options for source URL.
@@ -115,24 +132,26 @@ if [[ ! -z "$ONE_PREPVENV_TORCH_SOURCE" ]]; then
115132
fi
116133
# TODO remove torch message
117134
echo "Torch from '${ONE_PREPVENV_TORCH_SOURCE}' -> '${TORCH_SOURCE_OPTION}'"
118-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install torch==${VER_TORCH} ${TORCH_SOURCE_OPTION}
135+
PYTHON_PACKAGES+="torch==${VER_TORCH} "
119136

120-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnx==${VER_ONNX}
137+
PYTHON_PACKAGES+="onnx==${VER_ONNX} "
121138

122-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnxruntime==${VER_ONNXRUNTIME}
139+
PYTHON_PACKAGES+="onnxruntime==${VER_ONNXRUNTIME} "
123140

124-
# Provide install of custom onnx-tf
125-
if [ -n "${EXT_ONNX_TF_WHL}" ]; then
126-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install ${EXT_ONNX_TF_WHL}
127-
else
128-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnx-tf==${VER_ONNX_TF}
141+
if [[ "$VER_ONNX_TF" != "0" ]]; then
142+
PYTHON_PACKAGES+="onnx-tf==${VER_ONNX_TF} "
129143
fi
130144

131145
# Fix version to that of TF release date
132-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade protobuf==${VER_PROTOBUF}
146+
PYTHON_PACKAGES+="protobuf==${VER_PROTOBUF} "
133147

134-
# Fix version with fsspec error on U20.04
135-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade fsspec==2024.6.1
148+
# Fix version with fsspec error
149+
PYTHON_PACKAGES+="fsspec==2024.6.1 "
136150

137151
# Install pydot for visq
138-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install pydot==${VER_PYDOT}
152+
PYTHON_PACKAGES+="pydot==${VER_PYDOT} "
153+
154+
# Install numpy 1.x
155+
PYTHON_PACKAGES+="numpy==${VER_NUMPY} "
156+
157+
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade ${PYTHON_PACKAGES} ${TORCH_SOURCE_OPTION}

compiler/one-cmds/one-prepare-venv.u2404

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ VENV_PYTHON=${DRIVER_PATH}/venv/bin/python
2626

2727
if [ ! -f ${VENV_ACTIVATE} ]; then
2828
# Create python virtual enviornment
29-
python3.8 -m venv "${DRIVER_PATH}/venv"
29+
python3 -m venv "${DRIVER_PATH}/venv"
3030
fi
3131

3232
# NOTE version
3333
# - https://github.com/onnx/onnx/blob/master/docs/Versioning.md
3434
# - https://github.com/onnx/onnx-tensorflow/blob/master/Versioning.md
3535

36-
VER_TENSORFLOW=2.12.1
37-
VER_ONNX=1.16.0
38-
VER_ONNXRUNTIME=1.18.0
39-
VER_ONNX_TF=1.10.0
36+
VER_TENSORFLOW=2.19.0 # 2025-03-12
37+
VER_ONNX=1.17.0
38+
VER_ONNXRUNTIME=1.20.1
39+
#VER_ONNX_TF=1.10.0
4040
VER_PYDOT=1.4.2
41-
VER_TORCH="2.1.2+cpu"
41+
VER_TORCH="2.6.0+cpu"
4242

4343
# Install tensorflow
4444

@@ -66,8 +66,8 @@ else
6666
fi
6767
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install Pillow
6868
# Fix version to that of TF release date
69-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_probability==0.20.1
70-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_addons==0.20.0
69+
#${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_probability==0.25.0
70+
#${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_addons==0.23.0
7171

7272
# Install PyTorch and ONNX related
7373
# NOTE set ONE_PREPVENV_TORCH_SOURCE to override options for source URL.
@@ -84,14 +84,14 @@ ${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnx==${VER_ONNX}
8484
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnxruntime==${VER_ONNXRUNTIME}
8585

8686
# Provide install of custom onnx-tf
87-
if [ -n "${EXT_ONNX_TF_WHL}" ]; then
88-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install ${EXT_ONNX_TF_WHL}
89-
else
90-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnx-tf==${VER_ONNX_TF}
91-
fi
87+
#if [ -n "${EXT_ONNX_TF_WHL}" ]; then
88+
# ${VENV_PYTHON} -m pip ${PIP_OPTIONS} install ${EXT_ONNX_TF_WHL}
89+
#else
90+
# ${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnx-tf==${VER_ONNX_TF}
91+
#fi
9292

9393
# Fix version to that of TF release date
94-
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade protobuf==4.23.3
94+
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade protobuf==5.29.4
9595

9696
# Install pydot for visq
9797
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install pydot==${VER_PYDOT}

0 commit comments

Comments
 (0)