Advanced Micro Devices (AMD) shares surged Wednesday after the chipmaker posted solid quarterly earnings and said 2019 margins and revenues would likely top forecasts, defying investor gloom for the sector following Nvidia Corp.'s  (NVDA) sales warning earlier this week. 

AMD said non-GAAP earnings for the three months in December came in at 8 cents per share, matching the Street consensus and rising from 1 cent per share over the same period last year. Group revenues jumped 5.9% to $1.419 billion, AMD said, but that figure narrowly missed the $1.44 billion consensus estimates.

However, AMD said graphic and data center chip demand would support 2019 sales, with the company suggesting a "high single digit" growth rate, with an adjusted gross profit margin of around 41%, the highest in eight years. 

"2018 was another strong year for AMD. Increased adoption of our high performance products drove a second straight year of double-digit annual revenue growth, expanded gross margins and improved profitability," CEO Lisa Su told investors on a conference call late Tuesday. "While headwinds remain in the graphics channel and macro uncertainties are causing some caution in the first half of 2019, we believe we are well positioned to gain share throughout the year and accelerate growth as we ramp our next generation 7 nanometer products."

AMD shares were marked 14.7% higher in the opening minutes of trading Wednesday to change hands at $22.09 each, a move that would extend the stock's three-month gain to around 21% compared to a 34.5% decline for the Philadelphia Semiconductor Sector benchmark.

Chip and data center sales rose 9% to $986 billion in the fourth quarter, AMD said, driven by strong Ryzen desktop product sales and the adoption of second generation Ryzen mobile processors. Graphics sales fell due to "negligible Blockchain related revenue in the fourth quarter", AMD said, as well as "elevated levels of Graphics inventory in the channel."

Earlier this week, Nvidia shares plunged after the chipmaker cautioned that quarterly revenues would fall far short of analysts forecasts following weaker-than-expected demand for its gaming and datacenter products and slowing growth in China.

Nvidia said sales for the three months ended on Jan. 27, its fiscal fourth quarter, would come in at $2.2 billion compared to earlier guidance of $2.7 billion.

The company also said GAAP and non-GAAP margins would be hit by charges of around $120 million, adding that after a number of deals for its latest Turing graphics chips failed to close over the final months of the year as customers potentially waited for lower prices and demonstrations of the technology in actual games.

Last week, ASML Holding NV (ASML)  , the Dutch semiconductor supplier, cautioned that delayed orders and swelling inventories would hit first quarter sales, echoing concerns for the sector as chip prices fall and smartphone demand wanes.

Taiwan Semiconductor Mfg. Co. Ltd., (TSM) the world's biggest contract chipmaker and a lead supplier for Apple Inc. (AAPL) iPhones, cautioned that near-term sales would slide the most in 10 years as global smartphone markets continue to slow.

"Moving into first quarter 2019, we anticipate our business will be dampened by the overall weakening of the macroeconomic outlook, mobile product seasonality, and high levels of inventory in the semiconductor supply chain," said CFO Lora Ho, with chairman Mark Liu telling reporters that drop in high-end smartphone demand "came a little bit sudden", adding that the inventory in the supply chain is quite a lot."