Metal Sandbox: Isolated Execution and Command Scheduling for GPU Coding Agents on Apple Silicon
Haozhe Wang, Lina Chen, Fanqi Wan, Qi Han, Yinmin Zhang, Zheng Ge, Daxin Jiang, Junchi Yan
Abstract
On-device inference requires kernels that make effective use of local accelerators. Efficient training and evaluation of models that generate Apple Metal kernels benefit from native macOS tools and concurrent agent sessions. These sessions alternate between model requests, development commands, and GPU execution, leaving GPU capacity idle for much of a rollout. We present Metal Sandbox, infrastructure that combines restricted per-instance file access, native command execution, and command-level scheduling across interconnected Macs. Each agent retains its workspace and private development environment. Parallel commands can run concurrently, while serial commands share one execution slot per node; eligible waiting commands can migrate to available Macs and return results to the original agent. Integration with Harbor supports task execution, automatic verification, and rollout collection through a common workflow. Controlled experiments on four Mac mini M4 nodes achieve -- gains in command throughput under concentrated demand. Sixteen static agent traces give an estimated sustained-throughput gain for four sessions per node versus one, assuming continuously replenished sessions and unchanged mean durations. Replaying these measured traces under dynamic scheduling reduces mean tool waiting by 18.8% and batch elapsed time by 22.3%, assuming unchanged phase durations. Metal Sandbox and its Harbor integration are open-source on GitHub.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI, cs.CL, cs.DC
- Comments
- 16 pages, 7 figures, 5 tables. Code available at https://github.com/WangHaoZhe/metal-sandbox and https://github.com/WangHaoZhe/harbor
Related papers
Optimistic Online Learning for Coding Agents with Aggregate Feedback
Shared title terminologycs.LGHao Luan, Hao Qiu, Zhi Zheng et al.
Learning Compact State Abstractions for LLM Agents
Shared title terminologycs.LGYaswanth Chittepu, Raghavendra Addanki, Anup Rao et al.
LatentLens: Rethinking Latent Interface in Multi-Agent Systems
Shared title terminologycs.LGZiqing Yang, Kewei Cheng, Mingjie Li et al.
Agentic AI for Intent Management and Control in Autonomous Communication Networks
Shared title terminologycs.LGBurak Demirel, Yu Wang, Pablo Soldati
Learning Neurovascular Codes for EEG-to-fMRI Synthesis
Shared title terminologycs.LGYiming Sun, Yifan Wang, Aosong Feng et al.
TrialAgentBench: Evaluating AI Agents for Clinical-Trial Analysis and Long-Horizon Drug-Development Decisions
Shared title terminologycs.LGBradley Segal, William Bolton, Philip Torr et al.