GitHub: https://github.com/tudor-22/MetalML
MetalML started with a practical idea: keep the familiar scikit-learn workflow while making supported numerical operations available on a Mac's GPU. Instead of introducing a separate training framework, it exposes estimators with the fit, predict and transform methods Python users already know.
# pip install metalml import numpy as np import metalml as ml # was: import sklearn as ml X = np . random . default_rng ( 7 ). normal ( size = ( 5000 , 32 )). astype ( np . float32 ) y = X [:, 0 ] * 3 - X [:, 1 ] model = ml . linear_model . Ridge ( alpha = 1.0 ). fit ( X , y ) print ( model . predict ( X [: 5 ])) print ( model . operation_backends_ ) # which ops ran on Metal vs CPU
Enter fullscreen mode
Exit fullscreen mode
Status
MetalML is experimental. GPU execution is verified on an Intel Mac with a Radeon Pro 5300M; Apple Silicon validation and tuning are next.…