1

I'd like Spacyr to use GPU in R. I work on ARM64 architecture (Mac M1) and I have installed the latest nighlty version of Spacy, which supports GPU. Although, when I initialize Spacy in R by using reticulate, the model doesn't use GPU.

This is what I tried:


Sys.setenv(RETICULATE_PYTHON = ".../miniconda3/envs/myenv_arm64/bin/python3")
library(reticulate)
library(spacyr)
spacyr::spacy_initialize(python_executable = ".../miniconda3/envs/myenv_arm64/bin/python3")

Training model:

library(politeness)
df_polite_train <- politeness(df_train$text, parser="spacy", num_mc_cores=parallel::detectCores())

The training is very slow and it only uses CPU, no GPU. Can I do anything with reticulate to use GPU and make it faster?

I'm very new to this so I'd really appreciate some pointers. Thank you.

0 Answers0