Merge pull request #1197 from jizhilong/jizhilong-patch-1
Some checks failed
Book-CI / test (push) Has been cancelled
Deploy / deploy (macos-latest) (push) Has been cancelled
Deploy / deploy (ubuntu-latest) (push) Has been cancelled
Deploy / deploy (windows-latest) (push) Has been cancelled

fix: make cpufeature a local import
This commit is contained in:
ZiWei Yuan 2025-04-25 14:50:58 +08:00 committed by GitHub
commit a7b995365e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -3,7 +3,7 @@ transformers==4.43.2
numpy
torch>=2.3.0
packaging
cpufeature
cpufeature; sys_platform == 'win32' or sys_platform == 'Windows'
protobuf
tiktoken
blobfile

View file

@ -33,7 +33,6 @@ import torch
import torch.version
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
from setuptools import setup, Extension
from cpufeature.extension import CPUFeature
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CUDA_HOME, ROCM_HOME
try:
from torch_musa.utils.simple_porting import SimplePorting
@ -188,6 +187,8 @@ class VersionInfo:
raise ValueError(
"Unsupported cpu Instructions: {}".format(flags_line))
elif sys.platform == "win32":
from cpufeature.extension import CPUFeature
if CPUFeature.get("AVX512bw", False):
return 'fancy'
if CPUFeature.get("AVX512f", False):