This commit is contained in:
CircleCI Docs
2025-03-24 20:24:41 +00:00
parent 62b83836e7
commit e87bbad179
3033 changed files with 9909 additions and 442035 deletions

View File

@@ -247,9 +247,7 @@ point-wise. This is captured in the templated function :meth:`axpby_impl`.
float alpha_,
float beta_,
mx::Stream stream) {
// Allocate the output with `malloc_or_wait` which synchronously allocates
// memory, potentially waiting if the system is under memory pressure
out.set_data(mx::allocator::malloc_or_wait(out.nbytes()));
out.set_data(mx::allocator::malloc(out.nbytes()));
// Get the CPU command encoder and register input and output arrays
auto& encoder = mx::cpu::get_command_encoder(stream);
@@ -393,7 +391,7 @@ below.
auto& d = metal::device(s.device);
// Allocate output memory
out.set_data(allocator::malloc_or_wait(out.nbytes()));
out.set_data(allocator::malloc(out.nbytes()));
// Resolve name of kernel
std::ostringstream kname;

View File

@@ -70,6 +70,7 @@ are the CPU and GPU.
python/fft
python/linalg
python/metal
python/memory_management
python/nn
python/optimizers
python/distributed

View File

@@ -0,0 +1,6 @@
mlx.core.clear\_cache
=====================
.. currentmodule:: mlx.core
.. autofunction:: clear_cache

View File

@@ -0,0 +1,6 @@
mlx.core.get\_active\_memory
============================
.. currentmodule:: mlx.core
.. autofunction:: get_active_memory

View File

@@ -0,0 +1,6 @@
mlx.core.get\_cache\_memory
===========================
.. currentmodule:: mlx.core
.. autofunction:: get_cache_memory

View File

@@ -0,0 +1,6 @@
mlx.core.get\_peak\_memory
==========================
.. currentmodule:: mlx.core
.. autofunction:: get_peak_memory

View File

@@ -1,6 +0,0 @@
mlx.core.metal.clear\_cache
===========================
.. currentmodule:: mlx.core.metal
.. autofunction:: clear_cache

View File

@@ -1,6 +0,0 @@
mlx.core.metal.get\_active\_memory
==================================
.. currentmodule:: mlx.core.metal
.. autofunction:: get_active_memory

View File

@@ -1,6 +0,0 @@
mlx.core.metal.get\_cache\_memory
=================================
.. currentmodule:: mlx.core.metal
.. autofunction:: get_cache_memory

View File

@@ -1,6 +0,0 @@
mlx.core.metal.get\_peak\_memory
================================
.. currentmodule:: mlx.core.metal
.. autofunction:: get_peak_memory

View File

@@ -1,6 +0,0 @@
mlx.core.metal.reset\_peak\_memory
==================================
.. currentmodule:: mlx.core.metal
.. autofunction:: reset_peak_memory

View File

@@ -1,6 +0,0 @@
mlx.core.metal.set\_cache\_limit
================================
.. currentmodule:: mlx.core.metal
.. autofunction:: set_cache_limit

View File

@@ -1,6 +0,0 @@
mlx.core.metal.set\_memory\_limit
=================================
.. currentmodule:: mlx.core.metal
.. autofunction:: set_memory_limit

View File

@@ -1,6 +0,0 @@
mlx.core.metal.set\_wired\_limit
================================
.. currentmodule:: mlx.core.metal
.. autofunction:: set_wired_limit

View File

@@ -0,0 +1,6 @@
mlx.core.reset\_peak\_memory
============================
.. currentmodule:: mlx.core
.. autofunction:: reset_peak_memory

View File

@@ -0,0 +1,6 @@
mlx.core.set\_cache\_limit
==========================
.. currentmodule:: mlx.core
.. autofunction:: set_cache_limit

View File

@@ -0,0 +1,6 @@
mlx.core.set\_memory\_limit
===========================
.. currentmodule:: mlx.core
.. autofunction:: set_memory_limit

View File

@@ -0,0 +1,6 @@
mlx.core.set\_wired\_limit
==========================
.. currentmodule:: mlx.core
.. autofunction:: set_wired_limit

View File

@@ -0,0 +1,16 @@
Memory Management
=================
.. currentmodule:: mlx.core
.. autosummary::
:toctree: _autosummary
get_active_memory
get_peak_memory
reset_peak_memory
get_cache_memory
set_memory_limit
set_cache_limit
set_wired_limit
clear_cache

View File

@@ -8,13 +8,5 @@ Metal
is_available
device_info
get_active_memory
get_peak_memory
reset_peak_memory
get_cache_memory
set_memory_limit
set_cache_limit
set_wired_limit
clear_cache
start_capture
stop_capture