Apple M1 CPU + TensorFlow 2.4 + Rasa 2

RASA uses TensorFlow under the hood. TensorFlow 2.4 running on the recently-announced Apple M1 CPU has the potential to be significantly faster at training RASA models compared to all existing hardware[1]. Will this be coming to RASA Open Source in the near future? How can I track related development? Can I help make this happen?

[1] Accelerating TensorFlow Performance on Mac — The TensorFlow Blog

1 Like

From poking through the docs, it looks like it should already work? You’d just need the appropriate tf branch downloaded & running locally. You might need to update your Rasa tensorflow config as well.

Thanks Rachael. Unfortunately I can’t get Rasa to work on my M1 Mac (yet). When I try 2.2.4 (which uses Tensorflow 2.3.2) under Rosetta (x86 emulation) I get:

zsh: illegal hardware instruction rasa init

Looks like this has also been raised on StackOverflow:

Like Chris there, I also briefly attempted to use Apple’s alpha build of M1-optimized TensorFlow 2.4, but to no avail.

Any idea if anyone within Rasa is working on an M1? In the meantime I’ll revert to my older Intel Mac.

Looks like this is also being discussed here: Accelerated Tensorflow on mac - with no clear path forwards yet.

Seems like now Apple has released support for TensorFlow 2.5 on M1. Perhaps Rasa 2 can now move forward to have support on the M1 !

1 Like

Any news on how it goes with launching Rasa on a M1 machine? The news with TF 2.5 on a Mac I guess is a good one. So maybe someone knows what’s going on with Rasa and the M1 support.

@fkoerner I guess you might be the person to turn to? :slight_smile:

Hi @osterhult, sorry no new updates here :frowning: We do not have people using M1 internally (another reason we are keen to upgrade tensorflow). We cannot upgrade to 2.4 due to a bug that was fixed in 2.5. We are now evaluating performance decreases that we are seeing with 2.5 do determine whether the tradeoff is reasonable. We have another issue in tensorflow’s repository to alert them of these performance decreases.

There is an issue tracking our attempt to upgrade here. You can follow this for more updates, but rest assured there will be updates to this forum post as well

1 Like

Hello @fkoerner Any recent updates for Rasa on M1?:pleading_face:

Sadly, no. TensorFlow is not the only dependency giving us trouble here… See Greg’s attempts at getting this installed here

I tried building 3.0.1 a few days ago and posted an update on the github issue here.

There’s a possible workaround for the numpy & spacy issue but I haven’t had a chance to try it out.

@fkoerner do you know if there is a gh issue and plans to support TF 2.7?

@stephens the issue for supporting TF 2.7 is here.

1 Like

I’ve written a guide that seems to work for me. It’s unofficial, largely due to changes that might hopefully happen, but it’s something that should help in the meantime.