Skip to content

Conversation

@JoshuaKirby88
Copy link

@JoshuaKirby88 JoshuaKirby88 commented Dec 21, 2025

Problem

The project didn’t support running on macOS Apple Silicon (MPS).

Approach

  • Added a macOS Apple Silicon setup guide (MACOS_SETUP.md) and linked it from the README.md.
  • Updated GPU detection / GPU worker selection to recognize MPS in addition to CUDA, while keeping the existing CUDA path as-is as much as possible (and only adding a safe MPS check on the non-CUDA/CPU path).
  • Updated the agent’s device-selection guidance and seed-setting snippet to handle MPS.
  • Updated the i_cant_believe_its_not_better* examples to select cudampscpu, and guarded torch.compile / MPS checks for compatibility.

Limitations

  • MPS is treated as a single device, and multi-device scheduling is still CUDA-oriented.
  • This improves defaults and common entrypoints, but LLM-generated experiment code can still explicitly reference cuda.
  • No tests are added for macOS/MPS behavior.

@JoshuaKirby88 JoshuaKirby88 marked this pull request as ready for review December 21, 2025 20:23
Copilot AI review requested due to automatic review settings December 21, 2025 20:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for running AI Scientist-v2 on macOS with Apple Silicon by integrating Metal Performance Shaders (MPS) backend support throughout the codebase.

Key changes:

  • Added MPS device detection and selection logic alongside existing CUDA support
  • Updated GPU count detection to recognize MPS as a single-device backend
  • Created comprehensive macOS setup documentation with installation instructions

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
launch_scientist_bfts.py Added MPS device detection to GPU enumeration logic
ai_scientist/treesearch/parallel_agent.py Updated device selection guidelines, GPU counting, and random seed initialization to support MPS
ai_scientist/ideas/i_cant_believe_its_not_better.py Modified device selection and torch.compile conditional to include MPS
ai_scientist/ideas/i_cant_believe_its_not_betterrealworld.py Modified device selection and torch.compile conditional to include MPS
README.md Added reference to macOS setup documentation
MACOS_SETUP.md New documentation file with detailed Apple Silicon installation and setup instructions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JoshuaKirby88 JoshuaKirby88 mentioned this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant