Saying the pool is too small or calling something a labor shortage is trimming away a bunch of relevant detail. There cannot be a shortage, only a shortage of people 1) qualified to do the work for 2) the compensation and 3) conditions you are offering. That's 3 levers to pull: Train more, pay more, offer better conditions (remote work). Particularly compensation, I have been told that's how supply and demand work.
The current crop of AI startups offer exceptionally high salaries, to the point that San Francisco rents have almost doubled over the past 2 years. Note that the most prominent AI researchers are of Chinese national origin. We can't only pay and train our way into getting talented people. We have to expand the pool internationally.
You can’t just train people and have them be good software engineers… It takes years of training to be a good software engineer (with plenty of people flunking out during the training).