An Unofficial Guide to Installing Rasa on an M1 Macbook

Hi Vincent,

This is awesome! I followed the guide step-by-step, and training runs smoothly through on my MacBook Max.

Unfortunately, training takes more than 10x longer compared to my old, Intel-based MacBook Pro: 71 instead of 5 minutes.

This is the on my old (Intel) MacBook Pro:

2022-04-05 12:42:38 INFO     rasa.engine.training.hooks  - Starting to train component 'RegexFeaturizer'.
2022-04-05 12:42:38 INFO     rasa.engine.training.hooks  - Finished training component 'RegexFeaturizer'.
2022-04-05 12:42:39 INFO     rasa.engine.training.hooks  - Starting to train component 'LexicalSyntacticFeaturizer'.
2022-04-05 12:42:39 INFO     rasa.engine.training.hooks  - Finished training component 'LexicalSyntacticFeaturizer'.
2022-04-05 12:42:40 INFO     rasa.engine.training.hooks  - Starting to train component 'CountVectorsFeaturizer'.
2022-04-05 12:42:41 INFO     rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer  - 333 vocabulary items were created for text attribute.
2022-04-05 12:42:41 INFO     rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer  - 316 vocabulary items were created for response attribute.
2022-04-05 12:42:41 INFO     rasa.engine.training.hooks  - Finished training component 'CountVectorsFeaturizer'.
2022-04-05 12:42:43 INFO     rasa.engine.training.hooks  - Starting to train component 'CountVectorsFeaturizer'.
2022-04-05 12:42:43 INFO     rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer  - 2327 vocabulary items were created for text attribute.
2022-04-05 12:42:44 INFO     rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer  - 2471 vocabulary items were created for response attribute.
2022-04-05 12:42:44 INFO     rasa.engine.training.hooks  - Finished training component 'CountVectorsFeaturizer'.
2022-04-05 12:42:47 INFO     rasa.engine.training.hooks  - Starting to train component 'DIETClassifier'.
Epochs: 100%|████████████████████████| 100/100 [02:36<00:00,  1.57s/it, t_loss=1, i_acc=0.999, e_f1=1]
2022-04-05 12:45:26 INFO     rasa.engine.training.hooks  - Finished training component 'DIETClassifier'.
2022-04-05 12:45:26 INFO     rasa.engine.training.hooks  - Starting to train component 'EntitySynonymMapper'.
2022-04-05 12:45:28 INFO     rasa.engine.training.hooks  - Finished training component 'EntitySynonymMapper'.
2022-04-05 12:45:28 INFO     rasa.engine.training.hooks  - Starting to train component 'ResponseSelector'.
2022-04-05 12:45:29 INFO     rasa.nlu.selectors.response_selector  - Retrieval intent parameter was left to its default value. This response selector will be trained on training examples combining all retrieval intents.
Epochs: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:25<00:00,  3.92it/s, t_loss=5.08, r_acc=1]
2022-04-05 12:45:56 INFO     rasa.engine.training.hooks  - Finished training component 'ResponseSelector'.
Processed story blocks: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 1486.89it/s, # trackers=1]
Processed story blocks: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 70.38it/s, # trackers=35]
Processed story blocks: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:01<00:00, 25.71it/s, # trackers=50]
Processed story blocks: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:01<00:00, 34.05it/s, # trackers=50]
Processed rules: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 1831.46it/s, # trackers=1]
2022-04-05 12:46:00 INFO     rasa.engine.training.hooks  - Starting to train component 'MemoizationPolicy'.
Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 1496.41it/s, # action=98]
Processed actions: 98it [00:00, 5398.93it/s, # examples=98]
2022-04-05 12:46:01 INFO     rasa.engine.training.hooks  - Finished training component 'MemoizationPolicy'.
2022-04-05 12:46:01 INFO     rasa.engine.training.hooks  - Starting to train component 'RulePolicy'.
Processed trackers: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 1650.65it/s, # action=17]
Processed actions: 17it [00:00, 12649.13it/s, # examples=16]
Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 1192.05it/s, # action=98]
Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 858.28it/s]
Processed trackers: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 42/42 [00:00<00:00, 748.94it/s]
2022-04-05 12:46:02 INFO     rasa.engine.training.hooks  - Finished training component 'RulePolicy'.
2022-04-05 12:46:02 INFO     rasa.engine.training.hooks  - Starting to train component 'TEDPolicy'.
Processed trackers: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 535/535 [00:00<00:00, 871.08it/s, # action=874]
Epochs: 100%|██████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:35<00:00,  2.78it/s, t_loss=1.19, loss=0.923, acc=1]
2022-04-05 12:46:41 INFO     rasa.engine.training.hooks  - Finished training component 'TEDPolicy'.
2022-04-05 12:46:41 INFO     rasa.engine.training.hooks  - Starting to train component 'UnexpecTEDIntentPolicy'.
2022-04-05 12:46:42 WARNING  rasa.shared.utils.common  - The UnexpecTED Intent Policy is currently experimental and might change or be removed in the future 🔬 Please share your feedback on it in the forum (http://forum.rasa.com) to help us make this feature ready for production.
Processed trackers: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 535/535 [00:00<00:00, 1242.26it/s, # intent=268]
Epochs: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:20<00:00,  4.96it/s, t_loss=0.328, loss=0.233, acc=0.899]
2022-04-05 12:47:03 INFO     rasa.engine.training.hooks  - Finished training component 'UnexpecTEDIntentPolicy'.

→ rasa train 514.40s user 104.70s system 194% cpu 5:17.75 total

And here on my new M1 based McBook Pro:

2022-04-05 12:28:20 INFO     rasa.engine.training.hooks  - Starting to train component 'RegexFeaturizer'.
2022-04-05 12:28:21 INFO     rasa.engine.training.hooks  - Finished training component 'RegexFeaturizer'.
2022-04-05 12:28:21 INFO     rasa.engine.training.hooks  - Starting to train component 'LexicalSyntacticFeaturizer'.
2022-04-05 12:28:21 INFO     rasa.engine.training.hooks  - Finished training component 'LexicalSyntacticFeaturizer'.
2022-04-05 12:28:21 INFO     rasa.engine.training.hooks  - Starting to train component 'CountVectorsFeaturizer'.
2022-04-05 12:28:22 INFO     rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer  - 333 vocabulary items were created for text attribute.
2022-04-05 12:28:22 INFO     rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer  - 316 vocabulary items were created for response attribute.
2022-04-05 12:28:22 INFO     rasa.engine.training.hooks  - Finished training component 'CountVectorsFeaturizer'.
2022-04-05 12:28:22 INFO     rasa.engine.training.hooks  - Starting to train component 'CountVectorsFeaturizer'.
2022-04-05 12:28:22 INFO     rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer  - 2327 vocabulary items were created for text attribute.
2022-04-05 12:28:22 INFO     rasa.nlu.featurizers.sparse_featurizer.count_vectors_featurizer  - 2471 vocabulary items were created for response attribute.
2022-04-05 12:28:22 INFO     rasa.engine.training.hooks  - Finished training component 'CountVectorsFeaturizer'.
2022-04-05 12:28:24 INFO     rasa.engine.training.hooks  - Starting to train component 'DIETClassifier'.
Metal device set to: Apple M1 Max

systemMemory: 32.00 GB
maxCacheSize: 10.67 GB

Epochs: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [09:41<00:00,  5.82s/it, t_loss=1.03, i_acc=1, e_f1=1]
2022-04-05 12:38:06 INFO     rasa.engine.training.hooks  - Finished training component 'DIETClassifier'.
2022-04-05 12:38:06 INFO     rasa.engine.training.hooks  - Starting to train component 'EntitySynonymMapper'.
2022-04-05 12:38:07 INFO     rasa.engine.training.hooks  - Finished training component 'EntitySynonymMapper'.
2022-04-05 12:38:07 INFO     rasa.engine.training.hooks  - Starting to train component 'ResponseSelector'.
2022-04-05 12:38:08 INFO     rasa.nlu.selectors.response_selector  - Retrieval intent parameter was left to its default value. This response selector will be trained on training examples combining all retrieval intents.
Epochs: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [03:35<00:00,  2.16s/it, t_loss=5.09, r_acc=1]
2022-04-05 12:41:47 INFO     rasa.engine.training.hooks  - Finished training component 'ResponseSelector'.
Processed story blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 3252.77it/s, # trackers=1]
Processed story blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 200.69it/s, # trackers=35]
Processed story blocks: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 59.55it/s, # trackers=50]
Processed story blocks: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 100.55it/s, # trackers=50]
Processed rules: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 5363.56it/s, # trackers=1]
2022-04-05 12:41:49 INFO     rasa.engine.training.hooks  - Starting to train component 'MemoizationPolicy'.
Processed trackers: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 5011.46it/s, # action=98]
Processed actions: 98it [00:00, 15560.33it/s, # examples=98]
2022-04-05 12:41:49 INFO     rasa.engine.training.hooks  - Finished training component 'MemoizationPolicy'.
2022-04-05 12:41:49 INFO     rasa.engine.training.hooks  - Starting to train component 'RulePolicy'.
Processed trackers: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 5951.78it/s, # action=17]
Processed actions: 17it [00:00, 43504.07it/s, # examples=16]
Processed trackers: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████| 35/35 [00:00<00:00, 5244.19it/s, # action=98]
Processed trackers: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 3373.56it/s]
Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 42/42 [00:00<00:00, 2661.28it/s]
2022-04-05 12:41:50 INFO     rasa.engine.training.hooks  - Finished training component 'RulePolicy'.
2022-04-05 12:41:50 INFO     rasa.engine.training.hooks  - Starting to train component 'TEDPolicy'.
Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 535/535 [00:00<00:00, 4426.25it/s, # action=874]
Epochs: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [39:37<00:00, 23.77s/it, t_loss=0.849, loss=0.558, acc=1]
2022-04-05 13:21:28 INFO     rasa.engine.training.hooks  - Finished training component 'TEDPolicy'.
2022-04-05 13:21:28 INFO     rasa.engine.training.hooks  - Starting to train component 'UnexpecTEDIntentPolicy'.
2022-04-05 13:21:29 WARNING  rasa.shared.utils.common  - The UnexpecTED Intent Policy is currently experimental and might change or be removed in the future 🔬 Please share your feedback on it in the forum (http://forum.rasa.com) to help us make this feature ready for production.
Processed trackers: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 535/535 [00:00<00:00, 4869.56it/s, # intent=268]
Epochs: 100%|████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [16:37<00:00,  9.97s/it, t_loss=0.269, loss=0.169, acc=0.928]
2022-04-05 13:38:19 INFO     rasa.engine.training.hooks  - Finished training component 'UnexpecTEDIntentPolicy'.

→ rasa train 4243.07s user 6242.60s system 246% cpu 1:10:54.90 total

Any idea what I should do differently?

Many thanks,
Markus

1 Like