Skip to content

[ASK] Is there a way to find all GPU supported models?  #609

@lgabs

Description

@lgabs

Description

I could not find easily which models support GPU (I had to search in the documentation page with ctrl+F). To check which models support GPU programmatically, one can run (not all models follow the same param name, like backend for MF and use_gpu for several other models):

from cornac.models import *

models = [
AMR(),
BaselineOnly(),
Beacon(),
BiVAECF(),
BPR(),
WBPR(),
CausalRec(),
C2PF(),
CDL(),
CDR(),
COE(),
ComparERObj(),
ComparERSub(),
ConvMF(),
CTR(),
CVAE(),
CVAECF(),
DMRL(),
DNNTSP(),
EASE(),
EFM(),
# FM(), only supported on Linux.
GCMC(),
GlobalAvg(),
GPTop(),
GRU4Rec(),
HFT(),
HPF(),
HRDR(),
HypAR(),
IBPR(),
ItemKNN(),
UserKNN(),
LightGCN(),
LRPPM(),
MCF(),
MF(),
MMMF(),
MostPop(),
MTER(),
NARRE(),
GMF(),
MLP(),
NeuMF(),
NGCF(),
NMF(),
OnlineIBPR(),
PCRL(),
PMF(),
RecVAE(),
SBPR(),
SKMeans(),
SoRec(),
SPop(),
SVD(),
TIFUKNN(),
TriRank(),
UPCF(),
VAECF(),
VBPR(),
VMF(),
WMF(),
]

gpu_models = []
for model in models:
    if hasattr(model, 'use_gpu') or hasattr(model, 'backend'):
        gpu_models.append(model.name)
print(gpu_models)

which results in the list

['AMR', 'BiVAECF', 'CausalRec', 'CVAECF', 'MF', 'GMF', 'MLP', 'NeuMF', 'SVD', 'VAECF', 'VBPR', 'VMF']

Suggestions

  • it would be nice to see in the model's table in README which models support GPU
  • cornac could have a helper function to check which models support gpu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions