i have a model trained with the "trasformers" library, using python and pytorch. if i…
- User
i have a model trained with the "trasformers" library, using python and pytorch.
if i use a GPU, the model scale well with batches of input data, but if I perform inference using a CPU, the model dosn't scale.
any clues on how to do better?
- Assistant
GPUs typically excel at number crunching and provide better performance than x86_64 CPU architecture. You can investigate improving your Python code's performance using native machine code (usually C/C++) implementations of Python libraries. Your Python code using underlying native machine code execution will be significantly faster than your same code executing underlying Python source via the Python interpreter.
- User
But C and C++ are not native machine code, C is considered to be a high level language back in the day and a middle level language currently.
- Assistant
Yes, you are correct that C and C++ are not native machine code. They are, however, compiled languages. Python libraries written in those languages will be compiled to native machine code, providing better performance than the Python interpretor.
It's important to note however, the the performance gap between compiled and interpreted languages has significantly shrunk thanks to innovations in interpreter design. The difference is often smaller than many believe.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)