pytorch / cpuinfo

CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)
BSD 2-Clause "Simplified" License
992 stars 311 forks source link

Add a Minimal CPU support #87

Open antoinecarme opened 2 years ago

antoinecarme commented 2 years ago

Is it possible to define/specify a minimal CPU with the very minimal set of features and a very neutral architecture ?

This specification can to be used :

  1. Provide support for not-yet-defined CPUs, or not yet existing hardware. I see that there are at least two issues , one for SPARC (#53) and the other for PPC64 (#2 ).

  2. As a test CPU. Think of fooling pytorch to use this CPU instead of the hardware based one.

  3. For profiling new code. Think of using a very sophisticated XEON while disabling every sophisticated feature and comparing the floating point results and computation times.

  4. Some post-training operations, such as deployment, explanation and prediction do not need a very sophisticated CPU.

  5. Minimal CPU is ecologically friendly.

Thanks in advance

antoinecarme commented 2 years ago

On a SPARC debian machine, I get this message



```Python 3.9.11 (main, Mar 17 2022, 07:20:01) 
[GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Error in cpuinfo: processor architecture is not supported in cpuinfo
>>> quit()