diff --git a/apex-23.08.tar.gz b/apex-23.08.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..15d3af3b4c7e743c63173955d45104ad2c4e788f Binary files /dev/null and b/apex-23.08.tar.gz differ diff --git a/python-apex.spec b/python-apex.spec new file mode 100644 index 0000000000000000000000000000000000000000..3e902367215d35a8b1ebbb7992d0b1f129e0121a --- /dev/null +++ b/python-apex.spec @@ -0,0 +1,77 @@ +%define anolis_release 1 +%global pypi_name apex +%global pypi_version 0.1 +%global apex_version 23.08 + +Name: python-%{pypi_name} +Version: %{pypi_version}.%{apex_version} +Release: %{anolis_release}%{?dist} +Summary: PyTorch Extensions written by NVIDIA + +License: BSD 3-Clause +URL: https://github.com/NVIDIA/apex +Source0: https://github.com/NVIDIA/apex/archive/refs/tags/23.08.tar.gz#/%{pypi_name}-%{apex_version}.tar.gz + +BuildRequires: python3-devel +BuildRequires: python3dist(packaging) > 20.6.0 +BuildRequires: python3dist(setuptools) +BuildRequires: python3dist(sphinx) +BuildRequires: python3dist(sphinx-rtd-theme) +BuildRequires: pytorch pytorch-devel +BuildRequires: cuda + +%description +Apex is an NVIDIA-maintained utilities to streamline mixed precision and distributed +training in Pytorch. Some of the code here will be included in upstream Pytorch eventually. The +intent of Apex is to make up-to-date utilities available to users as quickly as possible. + +%package -n python3-%{pypi_name} +Summary: %{summary} +%{?python_provide:%python_provide python3-%{pypi_name}} + +Requires: python3dist(packaging) > 20.6.0 +Requires: pytorch pytorch-devel +Requires: cuda +%description -n python3-%{pypi_name} +Apex is an NVIDIA-maintained utilities to streamline mixed precision and distributed +training in Pytorch. Some of the code here will be included in upstream Pytorch eventually. The +intent of Apex is to make up-to-date utilities available to users as quickly as possible. + +%package -n python-%{pypi_name}-doc +Summary: apex documentation +%description -n python-%{pypi_name}-doc +Documentation for apex + +%prep +%autosetup -n %{pypi_name}-%{apex_version} + +%build +export TORCH_CUDA_ARCH_LIST="6.0;6.1;6.2;7.0;7.5;8.0;8.6" +export CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" +export LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" +%{__python3} setup.py build --cpp_ext --cuda_ext +# generate html docs +PYTHONPATH=${PWD} sphinx-build-3 docs/source html +# remove the sphinx-build leftovers +rm -rf html/.{doctrees,buildinfo} + +%install +export TORCH_CUDA_ARCH_LIST="6.0;6.1;6.2;7.0;7.5;8.0;8.6" +export CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" +export LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" +%{__python3} setup.py install --cpp_ext --cuda_ext -O1 --skip-build --root /root/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/ +rm -rfv /root/rpmbuild/BUILDROOT/%{NAME}-%{VERSION}-%{RELEASE}.x86_64/usr/bin/__pycache__ + +%files -n python3-%{pypi_name} +%license LICENSE +%{python3_sitearch}/%{pypi_name} +%{python3_sitearch}/%{pypi_name}-%{pypi_version}-py%{python3_version}.egg-info +%{python3_sitearch}/*.so + +%files -n python-%{pypi_name}-doc +%doc html +%license LICENSE + +%changelog +* Thu Jan 4 2024 Zhongling He - 0.1.23.08-1 +- Initial package.