Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Do not require ConcurrentManagedAccess when not used#3062

Merged
zcbenz merged 1 commit intoml-explore:mainfrom
zcbenz:concurrent-managed-access
Jan 27, 2026
Merged

Do not require ConcurrentManagedAccess when not used#3062
zcbenz merged 1 commit intoml-explore:mainfrom
zcbenz:concurrent-managed-access

Conversation

@zcbenz
Copy link
Collaborator

@zcbenz zcbenz commented Jan 25, 2026

Do the check of ConcurrentManagedAccess capacity in AtomicEvent so MLX can work on consumer hardwares when CPU/GPU synchronization is not required.

Also did some refactoring:

  • cu::Device becomes cheap to create — the creations of cudnn and cublasLt are now lazy.
  • Create all cu::Devices during initialization and store them in a vector — this is more efficient than using hash map since we have code iterating all devices (SmallSizePool).

Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

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

Looks great! Not sure on the test failure.. looks like something strange is going on there 🤔

@zcbenz zcbenz force-pushed the concurrent-managed-access branch 11 times, most recently from 398ea74 to bf7029f Compare January 26, 2026 04:11
@zcbenz
Copy link
Collaborator Author

zcbenz commented Jan 26, 2026

Calling cu::device in SmallSizePool caused Device to be created before Scheduler which broke the initialization order. I fixed it by ensuring Scheduler is always created before CudaAllocator.

@zcbenz zcbenz force-pushed the concurrent-managed-access branch 3 times, most recently from 55ab61e to be29501 Compare January 26, 2026 23:21
@zcbenz zcbenz force-pushed the concurrent-managed-access branch from be29501 to bb09c16 Compare January 26, 2026 23:26
@zcbenz zcbenz merged commit ce4d0a6 into ml-explore:main Jan 27, 2026
16 checks passed
@zcbenz zcbenz deleted the concurrent-managed-access branch January 27, 2026 02:19
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.

2 participants