Skip to content

Conversation

@davidkoski
Copy link
Collaborator

  • work for linux related tasks #294
  • the underlying mlx API has moved from being GPU related to being Memory related
  • old API remains with deprecation

@incertum

- work for #294
- the underlying mlx API has moved from being GPU related to being Memory related
- old API remains with deprecation
@davidkoski davidkoski requested a review from awni November 5, 2025 22:44
/// ### See Also
/// - <doc:running-on-ios>
/// - ``Memory``
public enum GPU {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the old GPU.swift file cut down:

  • the methods and properties that are now in Memory are deprecated and cover the implementations in Memory
  • the GPU (metal) specific code remains

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this!

mlx_set_cache_limit(&current, cacheLimit)
/// ### See Also
/// - ``memoryLimit``
public static var cacheLimit: Int {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

///
/// See [the documentation](https://ml-explore.github.io/mlx/build/html/dev/metal_debugger.html)
/// for more information.
public static func startCapture(url: URL) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the GPU parts.

Copy link

@incertum incertum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this!

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.

3 participants