chore: replace deprecated mx.metal.* with mx.set_* API #5

Closed
opened 2026-02-24 13:42:50 +00:00 by Virgil · 1 comment
Owner

Summary

MLX has deprecated mx.metal.set_memory_limit and mx.metal.set_cache_limit in favour of:

  • mx.set_memory_limit
  • mx.set_cache_limit

The old API will be removed in a future MLX release.

Files to update

  • scripts/train-4b-lek.py
  • scripts/train-4b-p0.py
  • Any other training scripts using mx.metal.*

Change

# Before
mx.metal.set_memory_limit(24 * 1024**3)
mx.metal.set_cache_limit(8 * 1024**3)

# After
mx.set_memory_limit(24 * 1024**3)
mx.set_cache_limit(8 * 1024**3)

Also check mx.get_peak_memory (may already be correct).

## Summary MLX has deprecated `mx.metal.set_memory_limit` and `mx.metal.set_cache_limit` in favour of: - `mx.set_memory_limit` - `mx.set_cache_limit` The old API will be removed in a future MLX release. ## Files to update - `scripts/train-4b-lek.py` - `scripts/train-4b-p0.py` - Any other training scripts using `mx.metal.*` ## Change ```python # Before mx.metal.set_memory_limit(24 * 1024**3) mx.metal.set_cache_limit(8 * 1024**3) # After mx.set_memory_limit(24 * 1024**3) mx.set_cache_limit(8 * 1024**3) ``` Also check `mx.get_peak_memory` (may already be correct).
Owner

No mx.metal.* calls found anywhere in the repo. The referenced scripts (train-4b-lek.py, train-4b-p0.py) are not committed — these are local training scripts on the M3. The deprecated API calls exist only in Virgil's local environment, not in tracked code.

Closing as not applicable to the repo.

No `mx.metal.*` calls found anywhere in the repo. The referenced scripts (`train-4b-lek.py`, `train-4b-p0.py`) are not committed — these are local training scripts on the M3. The deprecated API calls exist only in Virgil's local environment, not in tracked code. Closing as not applicable to the repo.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lthn/LEM#5
No description provided.