diff --git a/AI4C-v0.2.0-alpha.tar.gz b/AI4C-v0.2.0-alpha.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e52b4082fa0d4e39274708fe70ebc155d45f7686 Binary files /dev/null and b/AI4C-v0.2.0-alpha.tar.gz differ diff --git a/AI4C.spec b/AI4C.spec new file mode 100644 index 0000000000000000000000000000000000000000..d53756641d343d0073cfbbc85ac5774f01317d4e --- /dev/null +++ b/AI4C.spec @@ -0,0 +1,122 @@ +%global pkg_version %{name}-v%{version}-alpha + +%global build_dir %{_builddir}/%{pkg_version} +%global build_dir_dep %{build_dir}/third_party +%global build_dir_frm %{build_dir}/aiframe/build +%global build_libdir %{build_dir_frm}/%{_lib} +%global build_includedir %{build_dir_frm}/include +%global build_dir_model %{build_libdir}/%{name} + +%global install_libdir %{buildroot}%{_libdir} +%global install_dir_model %{install_libdir}/%{name} + +%global max_jobs 16 + +Summary: %{name} is a framework which enables compilers compilers to integrate ML-driven compiler optimization. +Name: AI4C +Version: 0.2.0 +Release: 1 +# Package onnxruntime and SafeInt have MIT License. +# Package onnx has Apache License 2.0. +License: MIT and ASL 2.0 and Boost and BSD +URL: https://gitee.com/openeuler/AI4C +Source0: %{pkg_version}.tar.gz + +BuildRequires: cmake >= 3.13 +BuildRequires: make +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: abseil-cpp-devel +BuildRequires: boost-devel >= 1.66 +BuildRequires: bzip2 +BuildRequires: python3-devel +BuildRequires: python3-numpy +BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: openssl +BuildRequires: openssl-devel + + +%description +%{name} is a framework which enables compilers compilers to integrate ML-driven compiler optimization. + +%prep +tar -xzf %{SOURCE0} -C . + +%autosetup -S git -n %{pkg_version} + +%build +# Construct dependency package `cmake` +cd %{build_dir_dep}/cmake +mkdir -p build && cd build +cmake .. -DCMAKE_INSTALL_PREFIX=./install +make install -j %{max_jobs} + +# Broken test in aarch64 architecture. +cd %{build_dir_dep}/onnxruntime +%ifarch aarch64 +rm -v onnxruntime/test/optimizer/nhwc_transformer_test.cc +%endif + +# Construct dependency package `onnxruntime`. +mkdir -p %{build_libdir} +mkdir -p %{build_includedir} +%{build_dir_dep}/cmake/build/install/bin/cmake \ + -DCMAKE_INSTALL_PREFIX=%{build_dir_frm} \ + -DCMAKE_INSTALL_LIBDIR=%{build_libdir} \ + -DCMAKE_INSTALL_INCLUDEDIR=%{build_includedir} \ + -Donnxruntime_BUILD_SHARED_LIB=ON \ + -Donnxruntime_BUILD_UNIT_TESTS=ON \ + -Donnxruntime_INSTALL_UNIT_TESTS=OFF \ + -Donnxruntime_BUILD_BENCHMARKS=OFF \ + -Donnxruntime_USE_FULL_PROTOBUF=ON \ + -DPYTHON_VERSION=%{python3_version} \ + -Donnxruntime_ENABLE_CPUINFO=ON \ + -Donnxruntime_DISABLE_ABSEIL=ON \ + -Donnxruntime_USE_NEURAL_SPEED=OFF \ + -Donnxruntime_ENABLE_PYTHON=OFF \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -S cmake +make -j %{max_jobs} && make install + +# Construct AI4C library `libONNXRunner.so`. +cd %{build_dir_frm} +cmake \ + -DCMAKE_INSTALL_PREFIX=%{build_dir_frm} \ + -Donnxruntime_ROOTDIR=%{build_dir_frm} \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + ../ +make -j %{max_jobs} && make install + +%install +install -d %{install_dir_model} +install %{build_dir_model}/* -t %{install_dir_model} +install %{build_libdir}/libonnxruntime.so* -t %{install_libdir} +install %{build_libdir}/libONNXRunner.so -t %{install_libdir} +pushd %{install_libdir} +ln -sf libonnxruntime.so.1.* libonnxruntime.so +popd + + +%files +%attr(0755,root,root) %{_libdir}/* + + +%changelog +* Wed Aug 14 2024 Zhenyu Zhao - 0.2.0-1 +- Update AI4C from v0.1.0 to v0.2.0. + +* Tue Aug 06 2024 Feiyang Liu - 0.1.0-5 +- Remove path dependencies for building AI4Compiler framework + +* Wed Jul 24 2024 Zhenyu Zhao - 0.1.0-4 +- Update-block-correction-model.patch + +* Tue Jul 23 2024 Zhenyu Zhao - 0.1.0-3 +- Bugfix-for-tensor-formation-and-update-block-correct + +* Fri Jun 21 2024 Feiyang Liu - 0.1.0-2 +- Add batch inference feature and optimizer model + +* Wed Jun 5 2024 Zhenyu Zhao - 0.1.0-1 +- Release 0.1.0