Compare commits

..

1 Commits

Author SHA1 Message Date
Alex Cheema
8c57df8b37 fix: enable psutil fallback for memory monitoring when macmon is missing on macOS
On Darwin, the psutil memory poller was disabled (memory_poll_rate=None),
relying entirely on macmon. When macmon is not installed, no memory data
was reported, causing nodes to show zero memory in the cluster state and
blocking shard placement.

Now falls back to psutil-based memory polling when macmon is not found.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 08:34:54 -08:00
3 changed files with 5 additions and 8 deletions

View File

@@ -388,6 +388,10 @@ class InfoGatherer:
if IS_DARWIN:
if (macmon_path := shutil.which("macmon")) is not None:
tg.start_soon(self._monitor_macmon, macmon_path)
else:
# macmon not installed — fall back to psutil for memory
logger.warning("macmon not found, falling back to psutil for memory monitoring")
self.memory_poll_rate = 1
tg.start_soon(self._monitor_system_profiler_thunderbolt_data)
tg.start_soon(self._monitor_thunderbolt_bridge_status)
tg.start_soon(self._monitor_rdma_ctl_status)

View File

@@ -316,8 +316,6 @@ def get_eos_token_ids_for_model(model_id: ModelId) -> list[int] | None:
return [154820, 154827, 154829]
elif "glm" in model_id_lower:
return [151336, 151329, 151338]
elif "gpt-oss" in model_id_lower:
return [200002, 200012]
return None

View File

@@ -11,7 +11,6 @@ from mlx_lm.models.gpt_oss import Model as GptOssModel
from mlx_lm.tokenizer_utils import TokenizerWrapper
from openai_harmony import ( # pyright: ignore[reportMissingTypeStubs]
HarmonyEncodingName,
HarmonyError, # pyright: ignore[reportUnknownVariableType]
Role,
StreamableParser,
load_harmony_encoding,
@@ -569,11 +568,7 @@ def parse_gpt_oss(
for response in responses:
assert isinstance(response, GenerationResponse)
try:
stream.process(response.token)
except HarmonyError:
logger.error("Encountered critical Harmony Error, returning early")
return
stream.process(response.token)
delta = stream.last_content_delta
ch = stream.current_channel