Chip stocks rallied Thursday, thanks to bullish sentiment on the industry and a couple of Wall Street upgrades on high-profile semiconductor names.

Nvidia ( NVDA) garnered an upgrade from Lehman Brothers a day after its annual analyst briefing, sending the company's stock up 7.6%, or $3.02, to $42.88 to reach a new 52-week high.

And Advanced Micro Devices' ( MCHP) shares advanced nearly 7% to $14.56 when Stifel Nicolaus analyst Cody Acree upgraded the company to a short-term trading buy, after 18 months of keeping a neutral rating on the company.

The upgrades added juice throughout the chip sector, helping to propel The Philadelphia Stock Exchange Semiconductor Sector index nearly 3% to a new 52-week high of 511.52.

Thursday's gains marked the second semiconductor rally in the past week, as investors appear to sense an improving business environment for chipmakers.

"You're getting to the end of the June quarter, and I think investors, as they are checking in with these companies, for the most part are hearing that things are good," says Dan Niles of Neuberger Berman Technology Management.

And after three years of underperformance, the semiconductor sector is poised for a pickup, says Niles, whose firm is bullish on semiconductor stocks.

The SOX is trading at roughly the same level as it did in January 2004. In the same period, the Nasdaq has gained 30%, and the S&P 500 has risen 36.5%.

Chipmakers are beginning to emerge from the latest downturn in the famously cyclical semiconductor business. Unlike the previous recovery in 2005, Niles believes this one is coinciding with favorable macroeconomic trends, including a pause in interest rate tightening from the U.S. Federal Reserve and U.S. GDP picking up from the 0.6% level in the first quarter.

"That's what makes a good up cycle," Niles says.

Of course, there has been some negative news in chipland as well. Earlier this week, Microchip Technology ( MCHP) cut its earnings expectations for the quarter. And Texas Instruments ( TXN) delivered a disappointing midquarter update last week.

The Lead Time Metric

"There's been a fight between bears and bulls for last few weeks" when it comes to semiconductor stocks, says Craig Berger, a semiconductor analyst at Wedbush Morgan Securities.

The bear case is that consumer confidence is slowing, the European market is showing signs of stress, and the housing market is due for a correction.

But Berger believes that chip stocks are poised to recover, simply because of industry-specific factors. He points to expectations of increasing lead times -- the time it takes chipmakers to fulfill orders -- by companies such as On Semiconductor ( ONNN), as an indicator of healthy future demand. Berger's firm makes a market in shares of On.

When lead times increase, Berger explains, customers such as PC makers and consumer electronics companies do whatever it takes to guarantee their supply, whether that be paying higher prices for chips or ordering chips from multiple companies.

"Lead times in my opinion are the single most important cyclical metric we watch," Berger says.

Among some of the other gainers in Thursday's rally were PMC Sierra Semiconductor ( PMCS), which saw its shares jump 5.8% to $8.14, and Maxim Integrated ( MXIM), which gained 3.4% to $33.67.

With Thursday's pop, shares of Nvidia are up 130% in the past 12 months. The company provided upbeat comments about its prospects and profit margins at its annual analyst day Wednesday.

And Nvidia officially introduced a new product dubbed Tesla, which transforms its graphics chips into a high-performance computing engine that will allow the company to expand into lucrative new markets.