Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ktransformers
Commits
a7b99536
Unverified
Commit
a7b99536
authored
Apr 25, 2025
by
ZiWei Yuan
Committed by
GitHub
Apr 25, 2025
Browse files
Merge pull request #1197 from jizhilong/jizhilong-patch-1
fix: make cpufeature a local import
parents
b90362b5
82920e79
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
requirements-local_chat.txt
requirements-local_chat.txt
+1
-1
setup.py
setup.py
+2
-1
No files found.
requirements-local_chat.txt
View file @
a7b99536
...
@@ -3,7 +3,7 @@ transformers==4.43.2
...
@@ -3,7 +3,7 @@ transformers==4.43.2
numpy
numpy
torch>=2.3.0
torch>=2.3.0
packaging
packaging
cpufeature
cpufeature
; sys_platform == 'win32' or sys_platform == 'Windows'
protobuf
protobuf
tiktoken
tiktoken
blobfile
blobfile
setup.py
View file @
a7b99536
...
@@ -33,7 +33,6 @@ import torch
...
@@ -33,7 +33,6 @@ import torch
import
torch.version
import
torch.version
from
wheel.bdist_wheel
import
bdist_wheel
as
_bdist_wheel
from
wheel.bdist_wheel
import
bdist_wheel
as
_bdist_wheel
from
setuptools
import
setup
,
Extension
from
setuptools
import
setup
,
Extension
from
cpufeature.extension
import
CPUFeature
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
,
CUDA_HOME
,
ROCM_HOME
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
,
CUDA_HOME
,
ROCM_HOME
try
:
try
:
from
torch_musa.utils.simple_porting
import
SimplePorting
from
torch_musa.utils.simple_porting
import
SimplePorting
...
@@ -188,6 +187,8 @@ class VersionInfo:
...
@@ -188,6 +187,8 @@ class VersionInfo:
raise
ValueError
(
raise
ValueError
(
"Unsupported cpu Instructions: {}"
.
format
(
flags_line
))
"Unsupported cpu Instructions: {}"
.
format
(
flags_line
))
elif
sys
.
platform
==
"win32"
:
elif
sys
.
platform
==
"win32"
:
from
cpufeature.extension
import
CPUFeature
if
CPUFeature
.
get
(
"AVX512bw"
,
False
):
if
CPUFeature
.
get
(
"AVX512bw"
,
False
):
return
'fancy'
return
'fancy'
if
CPUFeature
.
get
(
"AVX512f"
,
False
):
if
CPUFeature
.
get
(
"AVX512f"
,
False
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment