Skip to content

Commit b94d79c

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 64bd697 commit b94d79c

File tree

15 files changed

+133
-89
lines changed

15 files changed

+133
-89
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/common-artifacts/CMakeLists.txt

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ else()
3232
return()
3333
endif()
3434

35+
# NOTE does not check for non python 3.9 or python 3.11
36+
if(Python_VERSION VERSION_LESS 3.8.99)
37+
set(PYTHON_VERSION_MINOR 8)
38+
elseif(Python_VERSION VERSION_LESS 3.10.99)
39+
set(PYTHON_VERSION_MINOR 10)
40+
elseif(Python_VERSION VERSION_LESS 3.12.99)
41+
set(PYTHON_VERSION_MINOR 12)
42+
else()
43+
# TODO support higher version
44+
message(STATUS "Build common-artifacts: FAILED (Unsupported python: ${Python_VERSION})")
45+
return()
46+
endif()
47+
3548
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
3649
endif()
3750

@@ -59,18 +72,55 @@ if(DEFINED ENV{ONE_PIP_OPTION_TRUST_HOST})
5972
endif()
6073

6174
set(PY_PKG_LIST )
62-
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
63-
# NOTE `tensorflow-cpu` package is not available for aarch64, so we use `tensorflow` package.
64-
list(APPEND PY_PKG_LIST "tensorflow==2.12.1")
65-
else(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
66-
list(APPEND PY_PKG_LIST "tensorflow-cpu==2.12.1")
67-
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
68-
list(APPEND PY_PKG_LIST "flatbuffers==23.5.26")
69-
list(APPEND PY_PKG_LIST "protobuf==4.23.3")
70-
list(APPEND PY_PKG_LIST "pydot==1.4.2")
71-
list(APPEND PY_PKG_LIST "pytest==7.4.3")
72-
list(APPEND PY_PKG_LIST "h5py==3.11.0")
73-
list(APPEND PY_PKG_LIST "cffi==1.16.0")
75+
if (PYTHON_VERSION_MINOR EQUAL 8)
76+
# python3.8; Ubuntu 18.04, 20.04
77+
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
78+
# NOTE `tensorflow-cpu` package is not available for aarch64, so we use `tensorflow` package.
79+
list(APPEND PY_PKG_LIST "tensorflow==2.12.1")
80+
else(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
81+
list(APPEND PY_PKG_LIST "tensorflow-cpu==2.12.1")
82+
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
83+
list(APPEND PY_PKG_LIST "flatbuffers==23.5.26")
84+
list(APPEND PY_PKG_LIST "protobuf==4.23.3")
85+
list(APPEND PY_PKG_LIST "pydot==1.4.2")
86+
list(APPEND PY_PKG_LIST "pytest==7.4.3")
87+
list(APPEND PY_PKG_LIST "h5py==3.11.0")
88+
list(APPEND PY_PKG_LIST "cffi==1.16.0")
89+
elseif (PYTHON_VERSION_MINOR EQUAL 10)
90+
# python 3.10; Ubuntu 22.04
91+
# TF2.19.0 release at 2025-03-12
92+
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
93+
# NOTE `tensorflow-cpu` package is not available for aarch64, so we use `tensorflow` package.
94+
list(APPEND PY_PKG_LIST "tensorflow==2.19.0")
95+
else(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
96+
list(APPEND PY_PKG_LIST "tensorflow-cpu==2.19.0")
97+
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
98+
list(APPEND PY_PKG_LIST "flatbuffers==24.3.25")
99+
list(APPEND PY_PKG_LIST "protobuf==4.23.3")
100+
list(APPEND PY_PKG_LIST "pydot==1.4.2")
101+
list(APPEND PY_PKG_LIST "pytest==7.4.3")
102+
list(APPEND PY_PKG_LIST "h5py==3.11.0")
103+
list(APPEND PY_PKG_LIST "cffi==1.16.0")
104+
elseif (PYTHON_VERSION_MINOR EQUAL 12)
105+
# python 3.12; Ubuntu 24.04
106+
# TF2.19.0 release at 2025-03-12
107+
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
108+
# NOTE `tensorflow-cpu` package is not available for aarch64, so we use `tensorflow` package.
109+
list(APPEND PY_PKG_LIST "tensorflow==2.19.0")
110+
else(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
111+
list(APPEND PY_PKG_LIST "tensorflow-cpu==2.19.0")
112+
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
113+
list(APPEND PY_PKG_LIST "flatbuffers==24.3.25")
114+
list(APPEND PY_PKG_LIST "protobuf==4.23.3")
115+
list(APPEND PY_PKG_LIST "pydot==1.4.2")
116+
list(APPEND PY_PKG_LIST "pytest==7.4.3")
117+
list(APPEND PY_PKG_LIST "h5py==3.11.0")
118+
list(APPEND PY_PKG_LIST "cffi==1.16.0")
119+
list(APPEND PY_PKG_LIST "numpy==1.26.4")
120+
else()
121+
# Should not enter here
122+
message(FATAL "Build common-artifacts: FAILED (Invalid pyhon version)")
123+
endif()
74124

75125
add_custom_command(
76126
OUTPUT REQUIREMENTS_OVERLAY_PATH_clean

compiler/dalgona/CMakeLists.txt

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
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; explictly installed python3.8 (default is python3.12)
5+
# Ubuntu24.04; default python3.12
66
# refer https://github.com/Samsung/ONE/issues/9962
7+
# NOTE Require same python version of common-artifacts
78
if(CMAKE_VERSION VERSION_LESS 3.12)
89
find_package(PythonInterp 3.8 QUIET)
910
find_package(PythonLibs 3.8 QUIET)
@@ -14,27 +15,20 @@ if(CMAKE_VERSION VERSION_LESS 3.12)
1415
endif()
1516

1617
if(${PYTHON_VERSION_MINOR} LESS 8)
17-
message(STATUS "Build dalgona: FAILED (Install Python version higher than or equal to 3.8)")
18+
message(STATUS "Build dalgona: FAILED (Need Python version 3.8 or higher)")
1819
return()
1920
endif()
2021
else()
21-
find_package(Python 3.8 EXACT COMPONENTS Development QUIET)
22-
if(NOT Python_FOUND)
23-
find_package(Python 3.8 COMPONENTS Development QUIET)
24-
endif()
22+
# find python 3.8 or above
23+
find_package(Python 3.8 COMPONENTS Development QUIET)
2524

26-
# Require same python version of common-artifacts
27-
if(Python_VERSION VERSION_GREATER_EQUAL 3.13)
28-
message(STATUS "Build dalgona: FALSE (Python version 3.13 or higher is not supported yet)")
29-
return()
30-
endif()
31-
if(Python_VERSION VERSION_LESS 3.8)
32-
message(STATUS "Build dalgona: FAILED (Install Python version 3.8 or above)")
25+
if(NOT Python_Development_FOUND)
26+
message(STATUS "Build dalgona: FAILED (Python3 development package is missing)")
3327
return()
3428
endif()
3529

36-
if(NOT Python_Development_FOUND)
37-
message(STATUS "Build dalgona: FAILED (Python3 development package is missing)")
30+
if(Python_VERSION VERSION_LESS 3.8)
31+
message(STATUS "Build dalgona: FAILED (Need Python version 3.8 or higher)")
3832
return()
3933
endif()
4034

compiler/fm-equalize-value-py-test/CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,19 @@ macro(eval RECIPE)
3333
set(AFTER_CIRCLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/${AFTER_CIRCLE_FILE}")
3434
set(AFTER_CIRCLE_PATTERN_PATH "${CMAKE_CURRENT_BINARY_DIR}/${AFETR_PATTERN_FILE}")
3535

36+
execute_process(
37+
COMMAND ${VIRTUALENV}/bin/python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')"
38+
OUTPUT_VARIABLE PYTHON_VERSION
39+
OUTPUT_STRIP_TRAILING_WHITESPACE
40+
)
41+
42+
set(PYTHON_SITE_PACKAGES "${NNCC_OVERLAY_DIR}/venv/lib/python${PYTHON_VERSION}/site-packages")
43+
3644
# Apply fm-equalize
3745
add_custom_command(OUTPUT ${AFTER_CIRCLE_OUTPUT_PATH} ${AFTER_CIRCLE_PATTERN_PATH}
38-
COMMAND ${VIRTUALENV}/bin/python ${FM_EQUALIZE_BIN} -i ${OPT_CIRCLE_OUTPUT_PATH}
46+
COMMAND ${CMAKE_COMMAND} -E env
47+
PYTHONPATH=${PYTHON_SITE_PACKAGES}
48+
${VIRTUALENV}/bin/python ${FM_EQUALIZE_BIN} -i ${OPT_CIRCLE_OUTPUT_PATH}
3949
-o ${AFTER_CIRCLE_OUTPUT_PATH} -f ${AFTER_CIRCLE_PATTERN_PATH}
4050
--fme_detect ${FME_DETECT_BIN} --dalgona ${DALGONA_BIN}
4151
--fme_apply ${FME_APPLY_BIN}

compiler/fm-equalize/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,10 @@ if(NOT ENABLE_TEST)
6666
return()
6767
endif(NOT ENABLE_TEST)
6868

69-
set(Python_ADDITIONAL_VERSIONS 3.8)
70-
find_package(PythonInterp 3.8 QUIET)
71-
72-
if(NOT ${PYTHONINTERP_FOUND})
73-
message(FATAL_ERROR "Build fm-equalize_unittest: FAIL (Python3 is missing)")
74-
endif()
69+
set(VIRTUALENV "${NNCC_OVERLAY_DIR}/venv")
7570

7671
add_test(
7772
NAME fm-equalize_unittest
78-
COMMAND ${PYTHON_EXECUTABLE} -m unittest
73+
COMMAND ${VIRTUALENV}/bin/python -m unittest
7974
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
8075
)

0 commit comments

Comments
 (0)