Shares of technology companies surged as traders jumped back into the artificial-intelligence trade with both feet.

Palantir shares leapt by more than 25% after the provider of AI-backed consulting services reported robust revenue growth, reflecting what Chief Executive Alex Karp called "otherworldly" demand.

The Nasdaq Composite closed last week on the brink of correction territory and is now approaching record highs after the largest two-day gain in more than a year.

The PHLX SOX Semiconductor index rose by more than 6% as fears about the sustainability of demand from AI companies evaporated. Nvidia, the leading maker of AI chips, is now up by almost 10% in the last five sessions.

Shares of smaller chip makers such as Advanced Micro Devices and Micron each rose by 7% or more on Tuesday alone. AMD tumbled in late trading, however, after its fiscal third-quarter earnings only modestly exceeded the Wall Street forecast.