Nvidia (NVDA -1.77%) is the 800-pound gorilla of artificial intelligence (AI). Demand for its chips is through the roof. Its shares skyrocketed by 239% last year, and are up around 60% so far in 2024.

But Nvidia isn't the only AI company that's popular with investors, and there's another one that has especially found favor with those whom the voters have sent to work on Capitol Hill. Members of Congress are scooping up shares of Nvidia's chief rival instead.

Out with Nvidia, in with AMD

Nvidia ranked in the top 10 among stocks lawmakers sold most in 2023. The trend has continued into this year, with sell transactions outweighing buy transactions by a ratio of more than 2 to 1.

It's a completely different story with Advanced Micro Devices (AMD -0.91%), though. Year to date, there have been 11 purchases of AMD shares reported by members of Congress versus only three sell transactions, according to Capitol Trades.

The buying has been bipartisan. Democratic Rep. Josh Gottheimer of New Jersey and Republican Rep. Michael McCaul of Texas have each bought AMD shares multiple times in  2024.

AMD's appeal

Members of Congress must disclose all trades they make, but they don't have to reveal why they buy and sell specific stocks. It's not too hard to figure out why some lawmakers find AMD appealing, though.

AMD has lagged well behind Nvidia in the AI chip market thus far. However, it hopes to take some market share from its bigger rival -- and just might be successful in those efforts.

In December, AMD unveiled its MI300X AI accelerator and its Instinct MI300A accelerated processing unit. The company claimed the MI300X chip holds its own against Nvidia's H100 graphics processing unit in training large language models. And AMD maintained its new chip beats the H100 GPU in AI inference (the process through which AI models derive conclusions from data).

In addition, earlier this month, AMD rolled out its Ryzen line of AI chips for desktops and laptops. It touted the new chips as "the most advanced x86 processors for AI PCs." PC makers including HP and Lenovo are expected to introduce products this quarter featuring AMD's new chips.

Importantly, AMD doesn't have to beat Nvidia in the AI chip market to be a huge winner. Demand for AI chips should be so great for years to come that a company playing second fiddle in that niche will still make beautiful music for investors.

Is AMD a better AI stock to buy than Nvidia?

Members of Congress seem to prefer AMD to Nvidia these days. But are they right to feel that way? Is AMD a better AI stock to buy than Nvidia?

Both stocks are expensive based on one popular valuation metric: AMD trades at a forward price-to-earnings ratio of 45.7, while Nvidia's forward earnings multiple is about 34.3. However, these metrics are only based on earnings estimates for the next year.

There's a good case to be made that AMD could grow faster than Nvidia over the next five years. Technology companies, especially the big ones, don't want to be overly dependent on one source for chips, and they have been with Nvidia when it comes to AI silicon. AMD could be an attractive alternative if it can provide comparable performance at a lower cost.

Nvidia may out-innovate AMD and hold onto its commanding market share lead. Right now, though, I'm on the same page as politicians on Capitol Hill who view AMD as the better stock to buy.