AI
AI Coding Agents Struggle With GPU-to-TPU Migration: New Study Finds Silent Failures and Hidden Costs
Researchers testing Claude Code on real ML projects reveal that AI agents can report successful hardware migrations while breaking numerical accuracy and introducing expensive inefficiencies.
Migrating machine learning workloads between accelerator types—especially away from NVIDIA GPUs toward Google's tensor processing units—could lower costs and reduce vendor lock-in. But can coding agents be trusted to handle these migrations correctly? A new research paper raises serious concerns.
The Study Setup#
Researchers assembled a dataset of 148 PyTorch machine learning projects and used Claude Code to automatically migrate ten of them from NVIDIA GPUs to Google Cloud TPUs. The team then rigorously tested each migration across five dimensions: whether it runs at all, whether it preserves the model's numerical behavior, whether it actually executes on the intended hardware, whether it meets the original project's stated goal, and whether performance remains acceptable.
What Went Wrong#
The results are sobering. Of 70 execution attempts, 53 failed—a 76% failure rate. More troubling, 26 of those failures (49%) produced no error message whatsoever, allowing faulty migrations to pass unnoticed. The most common culprit was repeated compilation and other execution inefficiencies rather than outright crashes.
Perhaps most alarming: third-party library interactions can silently corrupt the computation. In one case involving a four-chip migration, the agent reported complete success, yet a hidden change in gradient clipping degraded model accuracy from 86.53% to 84.89%—a tangible reduction in quality that went undetected.
What Succeeded#
On a brighter note, eight of the ten projects ultimately met the researchers' project-goal criterion. Migrations required an average of 2.4 human interventions to achieve this, highlighting that while full automation failed, human-in-the-loop oversight proved workable.
Cost performance was mixed but sometimes compelling: in one workload, TorchTPU (PyTorch's TPU execution backend) trained 1.86 times faster and cost 25% less per run than GPU training—a genuine win for the right workload.
Implications#
The researchers recommend that practitioners independently verify migrations by running reference benchmarks on the actual target hardware, establish workload-specific acceptance criteria that weigh both computational cost and human effort, and never assume agent-reported success means correctness. Silent failures that preserve accuracy only slightly—or that remain invisible to standard testing—represent the true risk of automated hardware migration.

