Skip to content

Apple GPU MLX example - #11

Open
chadbrewbaker wants to merge 1 commit into
svg-project:mainfrom
chadbrewbaker:main
Open

Apple GPU MLX example#11
chadbrewbaker wants to merge 1 commit into
svg-project:mainfrom
chadbrewbaker:main

Conversation

@chadbrewbaker

Copy link
Copy Markdown

I made a single python file example of a port to Apple GPU with the MLX library. Please give me some feedback. It's been a while since I programmed centroidal Voronoi codes. In practice I use these for time series vectors that have been normalized to (0,1).

Please give me some feedback.

@chadbrewbaker

chadbrewbaker commented Mar 17, 2026

Copy link
Copy Markdown
Author

I would add a GitHub worker for macos-26-arm64 that can be ran manually - it should have an Apple GPU to test with. I'm not sure what GitHub workers have NVIDIA GPU available. Probably have to install UV or modify to pip.

uv run examples/mlxtest.py

Put this in .github/workflows:

name: Manual MLX Benchmark

# Triggered only manually via the GitHub Actions UI
on:
  workflow_dispatch:

jobs:
  benchmark:
    # 'macos-15' is the latest Apple Silicon (M1) runner in the docs.
    # It provides the arm64 architecture required for MLX.
    runs-on: macos-15

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v5
        with:
          enable-cache: true

      - name: Run Benchmark
        # 'uv run' detects the /// script block in your file 
        # and automatically installs mlx, torch, and numpy.
        run: |
          uv run examples/mlxtest.py

@andy-yang-1

Copy link
Copy Markdown
Collaborator

@chadbrewbaker Thanks for your contribution! For now we don't have apple GPU so it is hard for us to test it. So merging this will take more time.

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.

2 participants