[GH-ISSUE #1191] Should use cpufeature>=0.2.2 #815

Closed
opened 2026-10-29 14:44:53 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @0seba on GitHub (Apr 23, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1191

Originally assigned to: @KMSorSMS on GitHub.

In some virtualized environments cpufeature<=0.2.1 causes floating point issues

>>> import cpufeature
Floating point exception (core dumped)

This is as silent error and during installation of ktransformers you would get a hard to debug ERROR: Getting requirements to build wheel exited with -8 error.
cpufeature 0.2.2 ins't a released version yet, so you would have to install from main branch

git clone https://github.com/robbmcleod/cpufeature
cd cpufeature && pip install.

After this it works without error

>>> cpufeature.__version__
'0.2.2'
>>> cpufeature.print_features()
=== CPU FEATURES ===
    arch                    : x86_64
    VendorId                : GenuineIntel
    num_virtual_cores       : 8
    num_physical_cores      : 0
    num_threads_per_core    : 0
    num_cpus                : 8
    cache_line_size         : 64
    cache_L1_size           : 32768
    cache_L2_size           : 1310720
    cache_L3_size           : 12582912
    OS_x64                  : True
    OS_AVX                  : True
    OS_AVX512               : False
...
Originally created by @0seba on GitHub (Apr 23, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1191 Originally assigned to: @KMSorSMS on GitHub. In some virtualized environments `cpufeature<=0.2.1` causes floating point issues ``` >>> import cpufeature Floating point exception (core dumped) ``` This is as silent error and during installation of `ktransformers` you would get a hard to debug `ERROR: Getting requirements to build wheel exited with -8` error. `cpufeature 0.2.2` ins't a released version yet, so you would have to install from main branch ``` git clone https://github.com/robbmcleod/cpufeature cd cpufeature && pip install. ``` After this it works without error ``` >>> cpufeature.__version__ '0.2.2' >>> cpufeature.print_features() === CPU FEATURES === arch : x86_64 VendorId : GenuineIntel num_virtual_cores : 8 num_physical_cores : 0 num_threads_per_core : 0 num_cpus : 8 cache_line_size : 64 cache_L1_size : 32768 cache_L2_size : 1310720 cache_L3_size : 12582912 OS_x64 : True OS_AVX : True OS_AVX512 : False ... ```
Author
Owner

@jizhilong commented on GitHub (Apr 25, 2025):

cpufeature 0.2.2 ins't a released version yet, so you would have to install from main branch

delclaring a pip requirements on github repo may break future builds, due to upstream changes or users' poor network to github(which is common in some area).

as setup.py only requires cpufeature for windows platform, I think we can move the global import cpufeature statement to a local one, minimizing its possible side effects.

<!-- gh-comment-id:2829302009 --> @jizhilong commented on GitHub (Apr 25, 2025): > `cpufeature 0.2.2` ins't a released version yet, so you would have to install from main branch delclaring a pip requirements on github repo may break future builds, due to upstream changes or users' poor network to github(which is common in some area). as setup.py only requires cpufeature for windows platform, I think we can move the global `import cpufeature` statement to a local one, minimizing its possible side effects.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/ktransformers#815
No description provided.