NEW YORK - U.S. stocks ended lower on Tuesday, with the Nasdaq showing the largest declines as chipmaker Nvidia stumbled ahead of its highly awaited earnings report, while gains in Walmart kept losses on the Dow Industrials in check.

Shares of the chip designer Nvidia tumbled 4.35%, it's biggest daily percentage fall since Oct. 17, while the broader Philadelphia semiconductor index declined 1.56% as other chip stocks followed.

Investors are concerned whether Nvidia's quarterly results, expected after markets close on Wednesday, will justify its expensive valuation, currently at a forward price-to-earnings ratio of just over 32, and continue to fuel the buying frenzy around artificial intelligence (AI) related stocks.

AI-fueled bets have helped Nvidia become the third-most valuable U.S. company and recently supplant Tesla as Wall Street's most traded stock.

"It is priced to perfection, no matter what they say they are probably going to take money out of it," said Ken Polcari, managing partner at Kace Capital Advisors in Boca Raton, Florida.

"No matter what they say, the traders are going to lock in profits, the asset managers are going to peel off a piece of their core position and lock in some profits and some of that is even happening today ahead of the number tomorrow."

Shares in Super Micro Computer, which has surged in recent weeks as the latest stock seen to benefit from AI, fell 1.96%, its second straight decline, after closing down nearly 20% on Friday to snap a nine-session streak of gains.

The S&P 500 lost 30.06 points, or 0.60%, to end at 4,975.51 points, while the Nasdaq Composite lost 144.87 points, or 0.92%, to 15,630.78. The Dow Jones Industrial Average fell 64.19 points, or 0.17%, to 38,56.80.

Walmart closed at a record high and was the best performer on the Dow Industrials after the U.S. retail giant forecast fiscal 2025 sales largely above Wall Street expectations and raised its annual dividend by 9%.

The S&P 500 consumer staples index, which includes Walmart, rose 1.13% as sole advancer of the 11 major S&P sectors, while information technology, down 1.27% was the weakest.

Shares of fellow Dow component Home Depot alternated between modest gains and losses and before closing up 0.06% after the home improvement retailer forecast full-year results below analysts' estimates.

A weeks-long rally on Wall Street stalled last week, as hotter-than-expected U.S. inflation data pushed back market expectations for the timing of a rate cut from the Federal Reserve.

The rate cut is expected in June, according to a slim majority of economists polled by Reuters, who also flagged risk of a further delay in the first cut.

Investors are also awaiting the release of minutes from the Fed's latest policy meeting as well as remarks from a slew of central bank officials later this week.

Smart-TV maker Vizio jumped 16.26% after Walmart said it would buy the company for $2.3 billion.

Discover Financial Services shot 12.61% higher on Warren Buffett-backed consumer bank Capital One's plans to acquire the U.S. credit card issuer in a $35.3 billion deal. Capital One shares edged 0.12% higher.

Declining issues outnumbered advancers by a 1.4 to 1 ratio on the NYSE, while on Nasdaq, decliners topped advancers by 1.9 to 1.

The S&P 500 posted 29 new 52-week highs and 3 new lows while the Nasdaq recorded 111 new highs and 95 new lows.

On U.S. exchanges 11.67 billion shares changed hands compared with the 11.64 billion moving average for the last 20 sessions.

(Reporting by Chuck Mikolajczak; Editing by Aurora Ellis)