Wall Street rarely talks about its mistakes, but Goldman Sachs is now admitting it was wrong with its pessimistic view of AMD shares.

The firm raised its rating to neutral from sell for the chipmaker's stock, predicting big market share gains for its server chips over the next two years.

"We find it increasingly harder to argue our prior bear thesis — even following the recent stock price move — given Intel's struggles with 10nm process technology," analyst Toshiya Hari said in a note to clients Friday. "The delay in Intel's new products will allow AMD to gain share in not only client (i.e. desktop PC, notebook PC) CPUs, but also in the lucrative server CPU market."

AMD shares are up 0.9 percent Friday after the report. Its stock has risen 85.8 percent this year through Thursday versus the S&P 500's 6.7 percent return. The chip stock's performance ranks as the second-best return in the S&P 500 this year.

Hari raised his price target to $21 from $13.25 for AMD shares, representing 10 percent upside to Thursday's close.

One nanometer equals one-billionth of a meter. Smaller nanometer chipmaking technologies historically have allowed companies to create faster, more power-efficient chips.

The analyst noted Intel's repeated delays in moving to the 10 nanometer chip process. Intel said last month its 10 nanometer chips will be released for holiday 2019 compared with AMD's 7 nanometer products' launch later this year.

"We believe Intel's struggles will provide a reason for customers (PC OEMs, server OEMs, Cloud Service Providers, etc.) to adopt, or at least investigate, AMD's product," he said.

Hari estimates AMD server chip market share will rise to 5.1 percent in 2019 and increase to 9.4 percent in 2020 from an estimated 2.2 percent this year.

The analyst said since he started coverage on AMD with a sell rating on April 6, 2017, the chipmaker's stock is up 44 percent through Thursday versus the S&P 500's 21 percent return.

— CNBC's Michael Bloom contributed to this story.