How to use Claude to port PyTorch models to MLX
Claude ran and inspected CUDA PyTorch models in a GPU VM, then reimplemented them in MLX on a local Mac. The author reports three completed audio-model ports with numerical parity and a repository release still planned.
Suggested prompt
Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.
Port [PyTorch model] from [CUDA VM] to MLX on [Mac]. Run the original model, inspect its layers and mechanics, then implement the equivalent MLX behavior. Compare outputs on [test inputs], report numerical differences and document any unsupported operations.
Reach people exploring AI agents
See placements →Evidence at a glance
Sourced account- Source poster / publisher
- bleonov
- Original account
- Read the source ↗
- Published
- Source link checked
- Reported result
- The author reports numerically matching MLX ports of omnilingual ASR, Sam-audio and Nvidia Sortformer, plus substantial local inference speed without quantified timings. Repository publication was still planned.
- Human involvement
- The author uses a Mac to test the ported models and reports numerical parity, but does not describe the comparison procedure or code review.
A linked account supports attribution. It does not mean we independently reproduced its result.
Report an issue with this case
Open correction emailOpens your email app with the case link included. Nothing is sent automatically.
How the agent did it
- Run the original PyTorch model in the Nvidia-equipped Gradient VM.
- Have Claude investigate model layers and analyze their mechanics.
- Reimplement the model locally on the Mac using MLX.
The author describes spending three weeks using Claude to port models from CUDA PyTorch to MLX. Their setup combines a local Mac for testing the ports with a Gradient virtual machine running PyTorch on an Nvidia GPU. Claude can execute code inside that VM.
The reported workflow gives Claude access to the original model environment so it can run code, investigate layers and analyze model mechanics. It then reimplements those mechanics locally on the Mac using MLX. The author uses the Mac to test the resulting ports. This account describes both environments and the investigation-to-reimplementation sequence, but does not provide individual commands or comparison procedures.
The author reports completed ports with numerical parity to their originals for Facebook's omnilingual ASR, Sam-audio and Nvidia Sortformer. Most of the work was in the audio domain. They also report substantial inference speed on their own machine, without supplying timings or a benchmark methodology.
At the time of the comment, releasing the work in a repository was still planned. The source does not establish that a public release had happened.
Who it's for: Developers porting existing audio models to Apple hardware who have access to both the original GPU environment and a Mac.
Prompt
Suggested prompt (written by Agents In Use, not the author's)
Source: Hacker News · bleonov
Frequently asked questions
What environments did the author use for the ports?
The author used a Gradient VM with PyTorch and an Nvidia GPU for the original models, plus a local Mac to reimplement and test the MLX ports. Claude could run code in the VM.
Which completed ports does the author name?
The author names Facebook's omnilingual ASR, Sam-audio and Nvidia Sortformer, and reports numerical parity with the originals.
Was a public repository already available?
The comment says the author planned to release the work in a repository soon. It does not report an existing public release.
More details
Remaining steps
- Test the ported model on the Mac and assess numerical parity.
About this account
Claude can execute code in the GPU VM, investigate model behavior and reimplement model mechanics in the local MLX environment.
Platform: Hacker News. Attribution: https://news.ycombinator.com/item?id=46580259. Prompt: Suggested (written by Agents In Use, not the author's). Sourced by the Agents In Use pipeline.
Credit: bleonov on Hacker News
Source published
Added to Agents In Use
Source checked
Tools and topics
Claude · PyTorch · MLX · Gradient VM · Nvidia GPU · Mac
MLX · PyTorch · Model porting · Audio · Apple Silicon
Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.