Skip to content

GPU Support

PostgresML is capable of leveraging GPUs when the underlying libraries and hardware are properly configured on the database server.

Tip

Models trained on GPU will also require GPU support to make predictions.

Tensorflow

GPU setup for Tensorflow is covered in the documentation. You may acquire pre-trained GPU enabled models for fine tuning from Hugging Face.

Torch

GPU setup for Torch is covered in the documentation. You may acquire pre-trained GPU enabled models for fine tuning from Hugging Face.

Flax

GPU setup for Flax is covered in the documentation. You may acquire pre-trained GPU enabled models for fine tuning from Hugging Face.

XGBoost

GPU setup for XGBoost is covered in the documentation.

Example

1
2
3
4
5
    pgml.train(
        'GPU project', 
        algorithm => 'xgboost', 
        hyperparams => '{"tree_method" : "gpu_hist"}'
    );

LightGBM

GPU setup for LightGBM is covered in the documentation.

Example

1
2
3
4
5
    pgml.train(
        'GPU project', 
        algorithm => 'lightgbm', 
        hyperparams => '{"device" : "gpu"}'
    );

Scikit-learn

None of the scikit-learn algorithms natively support GPU devices. There are a few projects to improve scikit performance with additional parralellism, although we currently have not integrated these with PostgresML:

If your project would benefit from GPU support, please consider opening an issue so we can prioritize integrations.

Comments