Move memory related API from GPU into Memory namespace.#296
Merged
davidkoski merged 3 commits intomainfrom Nov 18, 2025
Merged
Conversation
davidkoski
commented
Nov 5, 2025
| /// ### See Also | ||
| /// - <doc:running-on-ios> | ||
| /// - ``Memory`` | ||
| public enum GPU { |
Collaborator
Author
There was a problem hiding this comment.
This is the old GPU.swift file cut down:
- the methods and properties that are now in
Memoryare deprecated and cover the implementations inMemory - the GPU (metal) specific code remains
davidkoski
commented
Nov 5, 2025
| mlx_set_cache_limit(¤t, cacheLimit) | ||
| /// ### See Also | ||
| /// - ``memoryLimit`` | ||
| public static var cacheLimit: Int { |
Collaborator
Author
There was a problem hiding this comment.
Note: previously you would read from this property and write via set(cacheLimit:) but that isn't quire idiomatic swift. Using the property for both get/set is.
davidkoski
commented
Nov 5, 2025
| /// | ||
| /// See [the documentation](https://ml-explore.github.io/mlx/build/html/dev/metal_debugger.html) | ||
| /// for more information. | ||
| public static func startCapture(url: URL) { |
Collaborator
Author
There was a problem hiding this comment.
These are the GPU parts.
incertum
reviewed
Nov 6, 2025
Contributor
incertum
left a comment
There was a problem hiding this comment.
LGTM wrt new split and approach. @awni will be better positioned to double check the changes and approve the PR.
I'll rebase my other PR once this is merged, thanks a bunch @davidkoski!
| /// ### See Also | ||
| /// - <doc:running-on-ios> | ||
| /// - ``Memory`` | ||
| public enum GPU { |
awni
reviewed
Nov 17, 2025
Source/MLX/Memory.swift
Outdated
| /// Control the size of cache memory via ``Memory/cacheLimit`` | ||
| /// and the overall memory limit with ``Memory/memoryLimit``. | ||
| /// | ||
| /// This might be used to eamine memory use over a run or sample it during a run: |
- work for #294 - the underlying mlx API has moved from being GPU related to being Memory related - old API remains with deprecation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@incertum