The race to build artificial intelligence infrastructure is consuming increasingly enormous amounts of cash at the biggest tech companies.