How to only train Rasa core on CPU and only Rasa NLU on GPU

Hello, so in the past day I’ve been doing some testing training Rasa models on a CPU vs a GPU. I’m using a work laptop that has decent hardware but far from anything special. Nothing good enough to train deep machine learning models but good enough for the specific user cases I have. Doing the testing I learned that the Rasa core was being trained significantly faster on the computer’s CPU vs the computer’s GPU. On the other hand though Rasa NLU was being trained faster on the computer’s GPU vs the computer’s CPU.

Below are my test results

CPU vs GPU Testing for Training Rasa Models

CPU: Intel® Core™ I5-7440HQ CPU @ 2.80 GHz 2.81GHz

Rasa Core: around 45 seconds

Time 1: 10:09.25

Time 2: 10:13.28

Time 3: 10:23.54

Time 4: 10:22.80

Time 5: 10:02.58

Time 6: 09:58.39

GPU: Nvidia Gefore 940MX

Rasa Core training time: around 1 minute 40 seconds

Time 1: 8:20.00

Time 2: 8:07.00

Time 3: 8:08.28

Time 4: 8:10.18

Time 5: 8:07:73

Time 6: 8:05:24

Time 7: 8:41.50

Time 8: 8:28.50

With these results I was wondering if we could configure Rasa core to be trained on the computer’s CPU and Rasa NLU to be trained on the computer’s GPU. Also if anyone could explain why Rasa core is trained a lot faster on the CPU vs GPU and why Rasa NLU is trained faster on the computer’s GPU vs CPU. I would’ve thought that from what I’ve read that since the algrothims Rasa uses aren’t extremely deep maybe there wouldn’t be a significant increase in training time for Rasa Core but I’m surprised Rasa core is significant slower being trained in the GPU vs the CPU. I’m quite interested in this but regardless my main concern is how to allocate the CPU to be trained with Rasa Core and the GPU to be trained with Rasa NLU. Any feedback and thoughts on this topic would be appreciated.

EDIT*** I forgot to include my config.yml file which is most likely helpful. Below is my config.yml file.

Configuration for Rasa NLU.


language: en pipeline:

  • name: WhitespaceTokenizer case_sensitive: False
  • name: RegexFeaturizer
  • name: LexicalSyntacticFeaturizer
  • name: CountVectorsFeaturizer
  • name: CountVectorsFeaturizer analyzer: “char_wb” min_ngram: 1 max_ngram: 4
  • name: DIETClassifier epochs: 90
  • name: EntitySynonymMapper
  • name: ResponseSelector epochs: 90

Configuration for Rasa Core.



  • name: TEDPolicy epochs: 30 featurizer:
    • name: MaxHistoryTrackerFeaturizer max_history: 5 state_featurizer:
      • name: BinarySingleStateFeaturizer
  • name: MappingPolicy
  • name: AugmentedMemoizationPolicy max_history: 6
  • name: FormPolicy
  • name: TwoStageFallbackPolicy nlu_threshold: 0.5 ambiguity_threshold: 0.1 fallback_nlu_action_name: “utter_fallback”