已开启
[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
已开启
共 2 个文件变更+14-5
Binary files do not support preview
| @@ -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 | - | ||
| 15 | Summary: %{name} is a framework which enables compilers to integrate ML-driven compiler optimization. | 13 | Summary: %{name} is a framework which enables compilers to integrate ML-driven compiler optimization. |
| 16 | Name: AI4C | 14 | Name: AI4C |
| 17 | Version: 1.0.4 | 15 | Version: 1.0.4 |
| 18 | -Release: 5 | 16 | +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. |
| 21 | License: MIT and ASL 2.0 and Boost and BSD | 19 | License: MIT and ASL 2.0 and Boost and BSD |
| @@ -25,6 +23,7 @@ Source0: %{pkg_version}.tar.gz | |||
| 25 | Patch1: 0001-Bugfix-for-undefined-np-symbol-in-ai4c-option-tuner.patch | 23 | Patch1: 0001-Bugfix-for-undefined-np-symbol-in-ai4c-option-tuner.patch |
| 26 | Patch2: 0002-Update-README.md.patch | 24 | Patch2: 0002-Update-README.md.patch |
| 27 | Patch3: 0003-Bugfix-and-update-inline-and-unroll-model.patch | 25 | Patch3: 0003-Bugfix-and-update-inline-and-unroll-model.patch |
| 26 | +Patch4: 0004-Add-AI4C-UDF-to-optimize-UDF-code.patch | ||
| 28 | 27 | ||
| 29 | BuildRequires: cmake >= 3.13 | 28 | BuildRequires: cmake >= 3.13 |
| 30 | BuildRequires: make | 29 | BuildRequires: 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 | %build | 56 | %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. |
| 59 | cd %{build_dir_dep}/onnxruntime | 64 | cd %{build_dir_dep}/onnxruntime |
| 60 | %ifarch aarch64 | 65 | %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`. |
| 65 | mkdir -p %{build_libdir} | 70 | mkdir -p %{build_libdir} |
| 66 | mkdir -p %{build_includedir} | 71 | mkdir -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 cmake | 87 | -S cmake |
| 83 | -make -j %{max_jobs} && make install | 88 | +make %{?_smp_mflags} && make %{?_smp_mflags} install |
| 84 | 89 | ||
| 85 | 90 | ||
| 86 | pushd %{build_dir}/python | 91 | pushd %{build_dir}/python |
| @@ -111,9 +116,13 @@ pushd %{build_dir}/python | |||
| 111 | /usr/bin/ai4c-gcc | 116 | /usr/bin/ai4c-gcc |
| 112 | /usr/bin/ai4c-option-tune | 117 | /usr/bin/ai4c-option-tune |
| 113 | /usr/bin/ai4c-tune | 118 | /usr/bin/ai4c-tune |
| 119 | +/usr/bin/ai4c-udf | ||
| 114 | 120 | ||
| 115 | 121 | ||
| 116 | %changelog | 122 | %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-5 | 126 | * 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 | ||