已开启
[sync] PR-44: Add AI4C-UDF to optimize UDF code #49
AtomGit-Bot创建于 2025年9月4日
[sync] PR-44: Add AI4C-UDF to optimize UDF code #49
已开启
AtomGit-Bot创建于 2025年9月4日
共 2 个文件变更+14-5
Binary files do not support preview
MAI4C.spec+14-5
@@ -10,12 +10,10 @@
10%global install_includedir %{buildroot}%{_includedir}10%global install_includedir %{buildroot}%{_includedir}
11%global install_dir_model %{install_libdir}/%{name}11%global install_dir_model %{install_libdir}/%{name}
12 12 
13-%global max_jobs 16
14- 
15Summary: %{name} is a framework which enables compilers to integrate ML-driven compiler optimization.13Summary: %{name} is a framework which enables compilers to integrate ML-driven compiler optimization.
16Name: AI4C14Name: AI4C
17Version: 1.0.415Version: 1.0.4
18-Release: 516+Release: 6
19# Package onnxruntime and SafeInt have MIT License.17# Package onnxruntime and SafeInt have MIT License.
20# Package onnx has Apache License 2.0.18# Package onnx has Apache License 2.0.
21License: MIT and ASL 2.0 and Boost and BSD19License: MIT and ASL 2.0 and Boost and BSD
@@ -25,6 +23,7 @@ Source0: %{pkg_version}.tar.gz
25Patch1: 0001-Bugfix-for-undefined-np-symbol-in-ai4c-option-tuner.patch23Patch1: 0001-Bugfix-for-undefined-np-symbol-in-ai4c-option-tuner.patch
26Patch2: 0002-Update-README.md.patch24Patch2: 0002-Update-README.md.patch
27Patch3: 0003-Bugfix-and-update-inline-and-unroll-model.patch25Patch3: 0003-Bugfix-and-update-inline-and-unroll-model.patch
26+Patch4: 0004-Add-AI4C-UDF-to-optimize-UDF-code.patch
28 27 
29BuildRequires: cmake >= 3.1328BuildRequires: cmake >= 3.13
30BuildRequires: make29BuildRequires: make
@@ -55,6 +54,12 @@ tar -xzf %{SOURCE0} -C .
55%autosetup -S git -n %{pkg_version}54%autosetup -S git -n %{pkg_version}
56 55 
57%build56%build
57+# In order to support lower version systems, we build cmake for onnxruntime.
58+cd %{build_dir_dep}/cmake
59+mkdir -p build && cd build
60+cmake .. -DCMAKE_INSTALL_PREFIX=./install
61+make %{?_smp_mflags} install
62+ 
58# Broken test in aarch64 architecture.63# Broken test in aarch64 architecture.
59cd %{build_dir_dep}/onnxruntime64cd %{build_dir_dep}/onnxruntime
60%ifarch aarch6465%ifarch aarch64
@@ -64,7 +69,7 @@ rm -v onnxruntime/test/optimizer/nhwc_transformer_test.cc
64# Construct dependency package `onnxruntime`.69# Construct dependency package `onnxruntime`.
65mkdir -p %{build_libdir}70mkdir -p %{build_libdir}
66mkdir -p %{build_includedir}71mkdir -p %{build_includedir}
67-cmake \72+%{build_dir_dep}/cmake/build/install/bin/cmake \
68 -DCMAKE_INSTALL_PREFIX=%{build_dir_frm} \73 -DCMAKE_INSTALL_PREFIX=%{build_dir_frm} \
69 -DCMAKE_INSTALL_LIBDIR=%{build_libdir} \74 -DCMAKE_INSTALL_LIBDIR=%{build_libdir} \
70 -DCMAKE_INSTALL_INCLUDEDIR=%{build_includedir} \75 -DCMAKE_INSTALL_INCLUDEDIR=%{build_includedir} \
@@ -80,7 +85,7 @@ cmake \
80 -Donnxruntime_ENABLE_PYTHON=OFF \85 -Donnxruntime_ENABLE_PYTHON=OFF \
81 -DCMAKE_BUILD_TYPE=RelWithDebInfo \86 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
82 -S cmake87 -S cmake
83-make -j %{max_jobs} && make install88+make %{?_smp_mflags} && make %{?_smp_mflags} install
84 89 
85 90 
86pushd %{build_dir}/python91pushd %{build_dir}/python
@@ -111,9 +116,13 @@ pushd %{build_dir}/python
111/usr/bin/ai4c-gcc116/usr/bin/ai4c-gcc
112/usr/bin/ai4c-option-tune117/usr/bin/ai4c-option-tune
113/usr/bin/ai4c-tune118/usr/bin/ai4c-tune
119+/usr/bin/ai4c-udf
114 120 
115 121 
116%changelog122%changelog
123+* Wed May 21 2025 Feiyang Liu <liufeiyang6@huawei.com> - 1.0.4-6
124+- Add AI4C-UDF to optimize UDF code.
125+ 
117* Wed Feb 05 2025 Feiyang Liu <liufeiyang6@huawei.com> - 1.0.4-5126* Wed Feb 05 2025 Feiyang Liu <liufeiyang6@huawei.com> - 1.0.4-5
118- Add BuildRequires for git and fix description typo in spec file.127- Add BuildRequires for git and fix description typo in spec file.
119 128