Add Metal memory stats to MLLMScheduler#78
Open
janhilgard wants to merge 1 commit intowaybarrios:mainfrom
Open
Add Metal memory stats to MLLMScheduler#78janhilgard wants to merge 1 commit intowaybarrios:mainfrom
janhilgard wants to merge 1 commit intowaybarrios:mainfrom
Conversation
- MLLMScheduler.get_stats() was missing metal_active/peak/cache_memory_gb - SimpleEngine.get_stats() was missing Metal memory stats entirely - BatchedEngine.get_stats() nested MLLM stats under mllm_scheduler key, but /v1/status expects metal_* at top-level — promote them Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a675c17 to
a0a8e9c
Compare
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.
Summary
MLLMScheduler.get_stats()was missing Metal memory metrics (metal_active_memory_gb,metal_peak_memory_gb,metal_cache_memory_gb) that the regularScheduleralready reports (scheduler.py:1818-1822)SimpleEngine.get_stats()was also missing Metal memory metrics entirelyBatchedEngine.get_stats()nested MLLM scheduler stats under amllm_schedulerkey, but/v1/statuslooks formetal_*at top-level — so Metal stats were alwaysnullfor vision models even after the scheduler fixChanges
mllm_scheduler.py— Addedimport mlx.core as mxand Metal memory stats block toget_stats()(identical toscheduler.py:1818-1822)engine/simple.py— Added Metal memory stats toSimpleEngine.get_stats()engine/batched.py— Promotemetal_*_memory_gbkeys from nestedmllm_schedulerdict to top-level, so/v1/statuscan find them (consistent with how non-MLLM stats are merged viaupdate())Test plan
curl http://localhost:1236/v1/statusreturns non-nullmetal.active_memory_gb,metal.peak_memory_gb,metal.cache_memory_gbfor an MLLM model (Qwen3-VL-8B — confirmed 5.76 GB)🤖 Generated with Claude Code