Treffer: How Fast is AI in Pharo? Benchmarking Linear Regression

Title:
How Fast is AI in Pharo? Benchmarking Linear Regression
Contributors:
Arolla, Analyses and Languages Constructs for Object-Oriented Application Evolution (RMOD), Centre Inria de l'Université de Lille, Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)-Centre de Recherche en Informatique, Signal et Automatique de Lille - UMR 9189 (CRIStAL), Centrale Lille-Université de Lille-Centre National de la Recherche Scientifique (CNRS)-Centrale Lille-Université de Lille-Centre National de la Recherche Scientifique (CNRS)
Source:
IWST22 - International Workshop on Smalltalk Technologies, Aug 2022, Novi Sad, Serbia
Publisher Information:
CCSD, 2022.
Publication Year:
2022
Collection:
collection:CNRS
collection:INRIA
collection:INRIA-LILLE
collection:INRIA_TEST
collection:TESTALAIN1
collection:CRISTAL
collection:INRIA2
collection:CRISTAL-RMOD
collection:PHARO
collection:UNIV-LILLE
Subject Geographic:
Original Identifier:
HAL: hal-03768601
Document Type:
Konferenz conferenceObject<br />Conference papers
Language:
English
Rights:
info:eu-repo/semantics/OpenAccess
Accession Number:
edshal.hal.03768601v2
Database:
HAL

Weitere Informationen

As many other modern programming languages, Pharo spreads its applications into computationally demanding fields such as machine learning, big data, cryptocurrency, etc. This raises a need for fast numerical computation libraries. In this work, we propose to speed up the low-level computations by calling the routines from highly optimized external libraries, e.g., LAPACK or BLAS through the foreign function interface (FFI). As a proof of concept, we build a prototype implementation of linear regression based on the DGELSD routine of LAPACK. Using three benchmark datasets of different sizes, we compare the execution time of our algorithm agains pure Pharo implementation and scikit-learn - a popular Python library for machine learning. We show that LAPACK & Pharo is up to 2103 times faster than pure Pharo. We also show that scikit-learn is 8-5 times faster than our prototype, depending on the size of the data. Finally, we demonstrate that pure Pharo is up to 15 times faster than the equivalent implementation in pure Python. Those findings can lay the foundation for the future work in building fast numerical libraries for Pharo and further using them in higher-level libraries such as pharo-ai.