%global debug_package %{nil} %global pypi_name torchao Name: python-%{pypi_name} Version: 0.17.0 Release: 1%{?dist} Summary: PyTorch native quantization and sparsity for training and inference License: BSD-3-Clause URL: https://pytorch.org/ao Source0: https://github.com/pytorch/ao/archive/%{version}.tar.gz#/%{pypi_name}-%{version}.tar.gz ExclusiveArch: aarch64 x86_64 BuildRequires: gcc gcc-c++ BuildRequires: python3-cmake BuildRequires: python3-setuptools BuildRequires: python3-torch BuildRequires: python3-pytest %global _description %{expand: PyTorch native quantization and sparsity for training and inference. } %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -p1 -n ao-%{version} # works around the git submodule checkout mkdir -p torchao/experimental/third-party/cutlass %generate_buildrequires export USE_CUDA=0 export USE_CPP=0 %ifarch aarch64 export TORCHAO_BUILD_CPU_AARCH64=1 export TORCHAO_BUILD_KLEIDIAI=0 # Newer aarch64 cores export TORCHAO_ENABLE_ARM_NEON_DOT=0 export TORCHAO_ENABLE_ARM_I8MM=0 %endif %pyproject_buildrequires %build export USE_CUDA=0 export USE_CPP=0 %ifarch aarch64 export TORCHAO_BUILD_CPU_AARCH64=1 export TORCHAO_BUILD_KLEIDIAI=0 # Newer aarch64 cores export TORCHAO_ENABLE_ARM_NEON_DOT=0 export TORCHAO_ENABLE_ARM_I8MM=0 %endif %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %exclude %{python3_sitelib}/test/ %changelog * Mon May 18 2026 Peter Robinson - 0.17.0-1 - Initial package