Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/rust-ci-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Rust CI MacOS

on:
pull_request:
types:
- opened
- synchronize

env:
CARGO_TERM_COLOR: always

jobs:
test:
# MLX only builds on Apple Silicon; macos-14+ runners are arm64.
runs-on: macos-15
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

# Cache the CMake build of mlx-c + MLX, which is the slow part of the build.
- name: Cache cargo & build artifacts
uses: Swatinem/rust-cache@v2

- name: Format
run: cargo fmt --all -- --check

- name: Clippy
run: cargo clippy --all-targets -- -D warnings

- name: Test
run: make test
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ __pycache__
*.pyc
.pytest_cache
*.tgz


# Added by cargo

/target
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third_party/mlx-c"]
path = third_party/mlx-c
url = https://github.com/ml-explore/mlx-c.git
267 changes: 267 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[workspace]
resolver = "2"
members = ["crates/mlx-sys", "crates/mlx"]

[workspace.package]
edition = "2024"
license = "MIT"
repository = "https://github.com/InftyAI/mlx"
authors = ["kerthcet"]

[workspace.dependencies]
mlx-sys = { path = "crates/mlx-sys", version = "0.0.0" }
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: build test fmt clean

# Build the workspace (compiles mlx-c + MLX from source on first run).
build:
cargo build

# Run all tests across the workspace.
test:
cargo test

# Format all crates.
fmt:
cargo fmt --all

# Remove build artifacts.
clean:
cargo clean
4 changes: 2 additions & 2 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
approvers:
- TBD
- kerthcet

reviewers:
- TBD
- kerthcet
Loading
Loading