Walmart on Thursday raised its annual sales and profit forecast, driven by strong demand from shoppers across all income levels and another quarter of double-digit growth in its online business, even as the company warned of higher costs from tariffs.