To sustain AI and other applications that require cutting-edge tech, the best strategy would be to either stockpile chips (not really feasible since the tech is deprecating) or to build spare capacity, along with the necessary supply chain.
In a WWII scenario, how long does it take to rapidly retrain a bunch of people with these skills. We have no shortage bunch of brilliant, quantitatively minded people trading derivatives and writing ML models to recommend TV shows. In a total war scenario, I assume most would be drafted for the war effort. Semiconductor engineering is complex, but probably not so complex that your average Math Olympiad couldn't pick it up in a month or two.
We had many brilliant minds working on these problems for decades, but it took time, skill, effort, and money over these decades to achieve each milestone of development. Now each of these firms (and each of their suppliers) has trade secrets that go deep, and barring some unlikely breakthrough of brilliance, these secrets can't be independently discovered by the brightest minds in any less than the time it already took to discover and develop them in the first place.
There's also the problem of supply chains -- modern fab tech requires a ton of downstream tech: the fab machines, the parts in them, and the places those parts were developed and manufactured... and the machines that were required there as well (repeat...). Also the raw materials, especially rare earth minerals.
We have a chip shortage going on for months now, if all it took was two months and a bunch of smart people, those billions of dollars in chip orders would've made it happen. That tells me it has to be a bit more complex than you think.
This is a very different calculus than a WW2 type scenario. Fully mobilized, the government would almost certainly pay up for microchip capacity today, regardless of the long-term payback residual.
If there was evidence of deep-pocketed firms trying and failing to get into semiconductor fab in 2020, I'd change my opinion. Like if Google or Amazon were trying to open their own fab plants, but were failing, then I might suspect that a WW2 fully mobilized war effort would run into difficulties. But as far as I can tell, the issue is that nobody wants to jump into the fab business, regardless of the temporarily higher profits over the next 2-4 quarters.
But you can't just 'build a fab' can you? Thats the point. You need a shipment of ASML's magic EUV machines and a bunch of their engineers and a bunch more technicians and managers with the right kind of skills for running a large cutting edge fab.