Roughly 8,000 employees will be laid off and another 7,000 reassigned as Meta tries to keep pace in the AI race.