US stocks end mostly higher after inflation data, AI shares rally