Skip to content

Commit ed8c2aa

Browse files
authored
Merge branch 'ml-explore:main' into rocm-support
2 parents bc9d8ba + 6a9a121 commit ed8c2aa

92 files changed

Lines changed: 1839 additions & 584 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/build-macos/action.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ runs:
4545
cd build
4646
cmake ..
4747
make -j $(sysctl -n hw.ncpu)
48-
48+
4949
- name: Run CPP tests
5050
shell: bash -l {0}
5151
env:
5252
DEVICE: gpu
5353
METAL_DEVICE_WRAPPER_TYPE: 1
5454
METAL_DEBUG_ERROR_MODE: 0
55-
run: ./build/tests/tests
56-
55+
run: |
56+
./build/tests/tests
57+
./build/tests/test_teardown
58+
5759
- name: Build small binary with JIT
5860
shell: bash -l {0}
5961
run: |

.github/actions/setup-linux/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ runs:
5454
echo PYTHONPATH=`python -c 'import sys; print(sys.path[-1])'` >> $GITHUB_ENV
5555
echo "::endgroup::"
5656
57+
- name: Set swap space
58+
if: ${{ startsWith(inputs.toolkit, 'cuda') && runner.arch == 'arm64' }}
59+
uses: pierotofy/set-swap-space@fc79b3f67fa8a838184ce84a674ca12238d2c761
60+
with:
61+
swap-size-gb: 16
62+
5763
- name: Install CUDA toolkit
5864
if: ${{ startsWith(inputs.toolkit, 'cuda') }}
5965
shell: bash

.github/actions/test-windows/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ runs:
1717
run: |
1818
echo "::group::CPP tests - CPU"
1919
./build/tests.exe -tce="*gguf*,test random uniform"
20+
./build/test_teardown.exe
2021
echo "::endgroup::"

.github/workflows/documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ jobs:
2525
steps:
2626
- name: Deploy to GitHub Pages
2727
id: deployment
28-
uses: actions/deploy-pages@v4
28+
uses: actions/deploy-pages@v5

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
steps:
4242
- name: Deploy to GitHub Pages
4343
id: deployment
44-
uses: actions/deploy-pages@v4
44+
uses: actions/deploy-pages@v5
4545

4646
build_linux_release:
4747
if: github.repository == 'ml-explore/mlx'

docs/src/dev/extensions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ below.
404404
auto kernel = d.get_kernel(kname, lib);
405405

406406
// Prepare to encode kernel
407-
auto& compute_encoder = d.get_command_encoder(s.index);
407+
auto& compute_encoder = mx::metal::get_command_encoder(s);
408408
compute_encoder.set_compute_pipeline_state(kernel);
409409

410410
// Kernel parameters are registered with buffer indices corresponding to
@@ -448,7 +448,7 @@ We can now call the :meth:`axpby` operation on both the CPU and the GPU!
448448

449449
A few things to note about MLX and Metal before moving on. MLX keeps track of
450450
the active ``command_buffer`` and the ``MTLCommandBuffer`` to which it is
451-
associated. We rely on :meth:`d.get_command_encoder` to give us the active
451+
associated. We rely on :meth:`metal::get_command_encoder` to give us the active
452452
metal compute command encoder instead of building a new one and calling
453453
:meth:`compute_encoder->end_encoding` at the end. MLX adds kernels (compute
454454
pipelines) to the active command buffer until some specified limit is hit or

docs/src/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ are the CPU and GPU.
3232
install
3333

3434
.. toctree::
35-
:caption: Usage
35+
:caption: Usage
3636
:maxdepth: 1
3737

3838
usage/quick_start
@@ -78,6 +78,7 @@ are the CPU and GPU.
7878
python/optimizers
7979
python/distributed
8080
python/tree_utils
81+
python/printoptions
8182

8283
.. toctree::
8384
:caption: C++ API Reference

docs/src/python/fft.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@ FFT
2020
irfft2
2121
rfftn
2222
irfftn
23+
fftfreq
24+
rfftfreq
2325
fftshift
2426
ifftshift

docs/src/python/printoptions.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Print Options
2+
===============
3+
4+
.. currentmodule:: mlx.core
5+
6+
.. autosummary::
7+
:toctree: _autosummary
8+
9+
PrintOptions
10+
set_printoptions
11+
printoptions
12+
get_printoptions

examples/extensions/axpby/axpby.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void Axpby::eval_gpu(
192192
auto kernel = d.get_kernel(kname, lib);
193193

194194
// Prepare to encode kernel
195-
auto& compute_encoder = d.get_command_encoder(s.index);
195+
auto& compute_encoder = mx::metal::get_command_encoder(s);
196196
compute_encoder.set_compute_pipeline_state(kernel);
197197

198198
// Kernel parameters are registered with buffer indices corresponding to

0 commit comments

Comments
 (0)