Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/run-onecc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ jobs:
strategy:
matrix:
type: [ Debug, Release ]
ubuntu_code: [ focal, jammy ]
ubuntu_code: [ focal, jammy ] #, noble ]
include:
- ubuntu_code: focal
ubuntu_ver: 20.04
- ubuntu_code: jammy
ubuntu_ver: 22.04
#- ubuntu_code: noble
# ubuntu_ver: 24.04
runs-on: one-x64-linux
container:
image: samsungonedev.azurecr.io/nnfw/one-devtools:${{ matrix.ubuntu_code }}
Expand All @@ -67,9 +69,15 @@ jobs:
# dalgona uses pybind11, but pybind11 cannot bind packages in virtualenv.
# So we need to install packages for dalgona-test globally.
- name: Install required packages
if: ${{ matrix.ubuntu_code == 'focal' || matrix.ubuntu_code == 'jammy' }}
run: |
python3 -m pip install numpy h5py==3.11.0 flatbuffers==23.5.26

- name: Install required packages
if: ${{ matrix.ubuntu_code == 'noble' }}
run: |
apt-get install -y python3-numpy python3-h5py python3-flatbuffers

- name: Caching externals
uses: actions/cache@v4
with:
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/run-onert-android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ on:
- master
- release/*
paths:
- '.github/workflows/run-onert-android-build.yml'
- 'nn*'
- 'Makefile.template'
- 'infra/buildtool/**'
- 'infra/cmake/**'
- 'infra/nncc/**'
- 'infra/nnfw/**'
- 'runtime/**'
- '!runtime/contrib/**'
- '!**/*.md'
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/run-onert-cross-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ on:
- master
- release/*
paths:
- '.github/workflows/run-onert-cross-build.yml'
- 'nn*'
- 'Makefile.template'
- 'infra/buildtool/**'
- 'infra/cmake/**'
- 'infra/nncc/**'
- 'infra/nnfw/**'
- 'runtime/**'
- '!runtime/contrib/**'
- '!**/*.md'
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/run-onert-gbs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ on:
- master
- release/*
paths:
- '.github/workflows/run-onert-gbs-build.yml'
- 'nncc'
- 'nnfw'
- 'compiler/luci/**'
- 'compiler/loco/**'
- 'compiler/logo/**'
- 'compute/**'
- 'infra/nnfw/**'
- 'infra/cmake/**'
- 'runtime/**'
- '!runtime/contrib/**'
- 'packaging/**'
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/run-onert-native-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ on:
- master
- release/*
paths:
- '.github/workflows/run-onert-native-build.yml'
- 'nn*'
- 'Makefile.template'
- 'infra/buildtool/**'
- 'infra/cmake/**'
- 'infra/nncc/**'
- 'infra/nnfw/**'
- 'runtime/**'
- '!runtime/contrib/**'
- '!**/*.md'
Expand Down
6 changes: 5 additions & 1 deletion compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set(ONE_UBUNTU_CODENAME "focal")
find_program(LSB_RELEASE_EXEC lsb_release)
if(LSB_RELEASE_EXEC)
# output should be one of 'bionic', 'focal', 'jammy'
# output should be one of 'bionic', 'focal', 'jammy', 'noble'
# others are not tested
execute_process(COMMAND "${LSB_RELEASE_EXEC}" --short --codename
OUTPUT_VARIABLE ONE_UBUNTU_CODENAME
Expand All @@ -14,6 +14,10 @@ endif()

if(${ONE_UBUNTU_CODENAME} STREQUAL "bionic")
set(ONE_UBUNTU_CODENAME_BIONIC TRUE)
elseif(${ONE_UBUNTU_CODENAME} STREQUAL "focal")
set(ONE_UBUNTU_CODENAME_FOCAL TRUE)
elseif(${ONE_UBUNTU_CODENAME} STREQUAL "jammy")
set(ONE_UBUNTU_CODENAME_JAMMY TRUE)
elseif(${ONE_UBUNTU_CODENAME} STREQUAL "noble")
set(ONE_UBUNTU_CODENAME_NOBLE TRUE)
endif()
Expand Down
22 changes: 6 additions & 16 deletions compiler/one-cmds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Ubuntu18.04; explictly installed python3.8 (default is python3.6)
# Ubuntu20.04; default python3.8
# Ubuntu22.04; default python3.10
# Ubuntu24.04; explicitly installed python3.8 (default is python3.12)
# Ubuntu24.04; default python3.12
# refer https://github.com/Samsung/ONE/issues/9962
if(CMAKE_VERSION VERSION_LESS 3.12)
find_package(PythonInterp 3.8 QUIET)
Expand All @@ -24,10 +24,10 @@ else()
endif()

# tensorflow 2.12.1 supports Python 3.8 ~ 3.11
if(Python_VERSION VERSION_GREATER_EQUAL 3.12)
message(STATUS "Build one-cmds: FALSE (Python version 3.12 or higher is not supported yet)")
return()
endif()
#if(Python_VERSION VERSION_GREATER_EQUAL 3.12)
# message(STATUS "Build one-cmds: FALSE (Python version 3.12 or higher is not supported yet)")
# return()
#endif()
if(Python_VERSION VERSION_LESS 3.8)
message(STATUS "Build one-cmds: FAILED (Install Python version 3.8 or 3.10)")
return()
Expand Down Expand Up @@ -67,17 +67,7 @@ if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
# and install build/../one-prepare-venv file
list(APPEND ONE_COMMAND_FILES one-prepare-venv.aarch64)
else(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
if(ONE_UBUNTU_CODENAME_BIONIC)
# NOTE copy one-prepare-venv.u1804 as build/../one-prepare-venv
# and install build/../one-prepare-venv file
list(APPEND ONE_COMMAND_FILES one-prepare-venv.u1804)
elseif(ONE_UBUNTU_CODENAME_NOBLE)
# NOTE copy one-prepare-venv.u2404 as build/../one-prepare-venv
# and install build/../one-prepare-venv file
list(APPEND ONE_COMMAND_FILES one-prepare-venv.u2404)
else()
list(APPEND ONE_COMMAND_FILES one-prepare-venv)
endif()
list(APPEND ONE_COMMAND_FILES one-prepare-venv)
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")

# pytorch importer is an experimental feature, it is not used in default configuration
Expand Down
15 changes: 14 additions & 1 deletion compiler/one-cmds/one-import-onnx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ import os
import sys
import tempfile
import onnx
import onnx_tf

# onnx_tf may not exist for latest python
try:
import onnx_tf
_onnx_tf_enabled = True
except ImportError:
_onnx_tf_enabled = False

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


def _check_onnx_tf():
import onnx


def get_driver_cfg_section():
return "one-import-onnx"

Expand Down Expand Up @@ -330,6 +340,9 @@ def _convert(args):
if _force_ext(args):
run_default_import = False

if not _onnx_tf_enabled:
run_default_import = False

res_conv = -1
if run_default_import:
if _force_ext(args):
Expand Down
71 changes: 45 additions & 26 deletions compiler/one-cmds/one-prepare-venv
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ source /etc/lsb-release
# - https://github.com/onnx/onnx/blob/master/docs/Versioning.md
# - https://github.com/onnx/onnx-tensorflow/blob/master/Versioning.md

# default version values
VER_TENSORFLOW=2.12.1
VER_TF_PROB=0.20.1
VER_TF_ADON=0.20.0
Expand All @@ -63,18 +64,31 @@ VER_ONNX_TF=1.10.0
VER_PYDOT=1.4.2
VER_TORCH="2.1.2+cpu"
VER_PROTOBUF=4.23.3

# Install tensorflow
VER_NUMPY=1.24.3

echo "Setting version for '$DISTRIB_CODENAME'"
if [[ "$DISTRIB_CODENAME" == "bionic" ]]; then
: # use as is
: # use default
elif [[ "$DISTRIB_CODENAME" == "focal" ]]; then
: # use as is
: # use default
elif [[ "$DISTRIB_CODENAME" == "jammy" ]]; then
: # TODO change vesions
:
#VER_TENSORFLOW=2.19.0
#VER_TF_PROB=0.25.0
#VER_TF_ADON=0.23.0
#VER_ONNX=1.17.0
#VER_ONNXRUNTIME=1.21.1
#VER_TORCH="2.7.0+cpu"
#VER_NUMPY=1.24.4
elif [[ "$DISTRIB_CODENAME" == "noble" ]]; then
: # TODO change vesions
VER_TENSORFLOW=2.19.0
VER_TF_PROB=0
VER_TF_ADON=0 # EOL, don't exist in python3.12~
VER_ONNX=1.17.0
VER_ONNXRUNTIME=1.21.0
VER_ONNX_TF=0
VER_TORCH="2.7.0+cpu"
VER_NUMPY=1.26.4
else
echo "Error one-prepare-venv: Unsupported codename $DISTRIB_CODENAME"
exit -1
Expand All @@ -97,15 +111,18 @@ if [[ ! -z "$ONE_PREPVENV_PIP_OPTION" ]]; then
fi

${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade pip setuptools
if [ -n "${EXT_TENSORFLOW_WHL}" ]; then
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install ${EXT_TENSORFLOW_WHL}
else
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow-cpu==${VER_TENSORFLOW}

PYTHON_PACKAGES="tensorflow-cpu==${VER_TENSORFLOW} "

PYTHON_PACKAGES+="Pillow "

if [[ "$VER_TF_PROB" != "0" ]]; then
# Fix version to that of TF release date
PYTHON_PACKAGES+="tensorflow_probability==${VER_TF_PROB} "
fi
if [[ "$VER_TF_ADON" != "0" ]]; then
PYTHON_PACKAGES+="tensorflow_addons==${VER_TF_ADON} "
fi
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install Pillow
# Fix version to that of TF release date
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_probability==${VER_TF_PROB}
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_addons==${VER_TF_ADON}

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

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

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

# Provide install of custom onnx-tf
if [ -n "${EXT_ONNX_TF_WHL}" ]; then
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install ${EXT_ONNX_TF_WHL}
else
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnx-tf==${VER_ONNX_TF}
if [[ "$VER_ONNX_TF" != "0" ]]; then
PYTHON_PACKAGES+="onnx-tf==${VER_ONNX_TF} "
fi

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

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

# Install pydot for visq
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install pydot==${VER_PYDOT}
PYTHON_PACKAGES+="pydot==${VER_PYDOT} "

# Install numpy 1.x
PYTHON_PACKAGES+="numpy==${VER_NUMPY} "

${VENV_PYTHON} -m pip ${PIP_OPTIONS} install --upgrade ${PYTHON_PACKAGES} ${TORCH_SOURCE_OPTION}
28 changes: 14 additions & 14 deletions compiler/one-cmds/one-prepare-venv.u2404
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ VENV_PYTHON=${DRIVER_PATH}/venv/bin/python

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

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

VER_TENSORFLOW=2.12.1
VER_ONNX=1.16.0
VER_ONNXRUNTIME=1.18.0
VER_ONNX_TF=1.10.0
VER_TENSORFLOW=2.19.0 # 2025-03-12
VER_ONNX=1.17.0
VER_ONNXRUNTIME=1.20.1
#VER_ONNX_TF=1.10.0
VER_PYDOT=1.4.2
VER_TORCH="2.1.2+cpu"
VER_TORCH="2.6.0+cpu"

# Install tensorflow

Expand Down Expand Up @@ -66,8 +66,8 @@ else
fi
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install Pillow
# Fix version to that of TF release date
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_probability==0.20.1
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_addons==0.20.0
#${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_probability==0.25.0
#${VENV_PYTHON} -m pip ${PIP_OPTIONS} install tensorflow_addons==0.23.0

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

# Provide install of custom onnx-tf
if [ -n "${EXT_ONNX_TF_WHL}" ]; then
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install ${EXT_ONNX_TF_WHL}
else
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnx-tf==${VER_ONNX_TF}
fi
#if [ -n "${EXT_ONNX_TF_WHL}" ]; then
# ${VENV_PYTHON} -m pip ${PIP_OPTIONS} install ${EXT_ONNX_TF_WHL}
#else
# ${VENV_PYTHON} -m pip ${PIP_OPTIONS} install onnx-tf==${VER_ONNX_TF}
#fi

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

# Install pydot for visq
${VENV_PYTHON} -m pip ${PIP_OPTIONS} install pydot==${VER_PYDOT}
1 change: 1 addition & 0 deletions compiler/one-cmds/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ file(APPEND "${DRIVER_SCRIPT}"
else
echo \"ALL TESTS PASSED!\"
fi\n
echo \"Test results are also recorded in runtestall.log file.\"
")

set(PREPARE_TEST_MATERIALS_SH "${CMAKE_CURRENT_SOURCE_DIR}/prepare_test_materials.sh")
Expand Down
3 changes: 1 addition & 2 deletions infra/nncc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ include("cmake/ApplyCompileFlags.cmake")
###
add_library(nncc_common INTERFACE)
if(ENABLE_STRICT_BUILD)
# TODO Remove -Wno-overloaded-virtual
target_compile_options(nncc_common INTERFACE -Werror -Wall -Wextra -Wno-overloaded-virtual)
target_compile_options(nncc_common INTERFACE -Werror -Wall -Wextra)
endif(ENABLE_STRICT_BUILD)

add_library(nncc_coverage INTERFACE)
Expand Down