Conversation
| @@ -3,9 +3,9 @@ | |||
| #include <Cmlx/mlx-c-linalg.h> | |||
| #include <Cmlx/mlx-c-fast.h> | |||
There was a problem hiding this comment.
Automated generation of public headers for Xcode build. Changes are all just copies from mlx
Source/MLX/MLXArray+Init.swift
Outdated
| /// - shape: shape of the data in the rawPointer | ||
| /// - dtype: data type | ||
| /// - finalizer: closure that will release the associated resource | ||
| public convenience init( |
There was a problem hiding this comment.
New function, very exciting!
| } | ||
|
|
||
| #if canImport(IOSurface) | ||
| func testIOSurface() { |
There was a problem hiding this comment.
Test of new function -- hopefully this is guarded properly. This doesn't really compute anything of use but I can make sure it builds the way I expect and the logs show the calls are as expected.
xcode/MLX.xcodeproj/project.pbxproj
Outdated
| C3CBF1832EAC22110029A645 /* MAINTENANCE.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = MAINTENANCE.md; path = ../MAINTENANCE.md; sourceTree = SOURCE_ROOT; }; | ||
| C3CBF1842EAC22110029A645 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = SOURCE_ROOT; }; | ||
| C3CBF1852EAC22110029A645 /* README.xcodeproj.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = README.xcodeproj.md; path = ../README.xcodeproj.md; sourceTree = SOURCE_ROOT; }; | ||
| C3CBF1852EAC22110029A645 /* README.xcodeproj.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.xcodeproj.md; sourceTree = SOURCE_ROOT; }; |
There was a problem hiding this comment.
This was a dangling ref before (harmless but annoying to see the red file).
| guard limit >= 0 else { return false } | ||
| var previous: size_t = 0 | ||
| let result = mlx_set_wired_limit(&previous, size_t(limit)) | ||
| let result = evalLock.withLock { |
There was a problem hiding this comment.
@robertmsale FYI while debugging another issue I was looking at what this hits internally and it is not thread safe. I think we are ok anyway since this is inside the actor, but this is harmless and I like the documentation :-)
There was a problem hiding this comment.
Aw man! I see that is the standard lock used elsewhere 😅 like at the bottom of Memory.swift for cache clearing. Thank you for pointing that one out!
There was a problem hiding this comment.
I didn't think of it either until I was looking at the code in mlx::core for something else. The old code wasn't guarded either :-)
| /// - dtype: data type | ||
| /// - finalizer: closure that will release the associated resource | ||
| // TODO: disabled per issue on mlx side -- buffer enters residency set but | ||
| // not removed -- enable in next release. Also testIOSurface |
|
@awni ready to go 🚀 |
Proposed changes
Update for mlx v0.30.6
- one new API that allows a caller to pass ownership of a buffer to MLX + manage lifetime(delayed until next release)Note: this is waiting for tags on mlx-c and references a branch right now. Cmake builds expected to fail.Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes