Skip to content

MLX error: Failed to load the default metallib. This library is using a deployment target (0x00020008) that is not supported on this OS #10

Description

@mumaxiaozi

mac book pro m4 48G
ProductName: macOS
ProductVersion: 15.3.1
BuildVersion: 24D70

vllm-swift version
vllm-swift 0.2.2
dylib: /opt/homebrew/Cellar/vllm-swift/0.2.2/lib/libVLLMBridge.dylib
vLLM: 0.19.1

startup & log:
 vllm-swift serve ~/.lmstudio/models/mlx-community/Qwen3.6-27B-4bit --max-model-len 32876 --served-model-name qwen3.6-27b --port 8001 INFO 04-27 19:00:15 [__init__.py:44] Available plugins for group vllm.platform_plugins: INFO 04-27 19:00:15 [__init__.py:46] - swift -> vllm_swift:register INFO 04-27 19:00:15 [__init__.py:49] All plugins in this group will be loaded. Set VLLM_PLUGINSto control which plugins to load. INFO 04-27 19:00:15 [__init__.py:239] Platform plugin swift is activated (APIServer pid=58692) INFO 04-27 19:00:16 [utils.py:299] (APIServer pid=58692) INFO 04-27 19:00:16 [utils.py:299] █ █ █▄ ▄█ (APIServer pid=58692) INFO 04-27 19:00:16 [utils.py:299] ▄▄ ▄█ █ █ █ ▀▄▀ █ version 0.19.1 (APIServer pid=58692) INFO 04-27 19:00:16 [utils.py:299] █▄█▀ █ █ █ █ model Qwen/Qwen3-0.6B (APIServer pid=58692) INFO 04-27 19:00:16 [utils.py:299] ▀▀ ▀▀▀▀▀ ▀▀▀▀▀ ▀ ▀ (APIServer pid=58692) INFO 04-27 19:00:16 [utils.py:299] (APIServer pid=58692) INFO 04-27 19:00:16 [utils.py:233] non-default args: {'model_tag': '/Users/kk/.lmstudio/models/mlx-community/Qwen3.6-27B-4bit', 'port': 8001, 'max_model_len': 32876, 'served_model_name': ['qwen3.6-27b']} (APIServer pid=58692) Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads. (APIServer pid=58692) INFO 04-27 19:00:19 [model.py:549] Resolved architecture: Qwen3ForCausalLM (APIServer pid=58692) INFO 04-27 19:00:19 [model.py:1678] Using max model len 32876 (APIServer pid=58692) INFO 04-27 19:00:19 [vllm.py:790] Asynchronous scheduling is enabled. (APIServer pid=58692) INFO 04-27 19:00:19 [importing.py:68] Triton not installed or not compatible; certain GPU-related functions will not be available. INFO 04-27 19:00:23 [__init__.py:44] Available plugins for group vllm.platform_plugins: INFO 04-27 19:00:23 [__init__.py:46] - swift -> vllm_swift:register INFO 04-27 19:00:23 [__init__.py:49] All plugins in this group will be loaded. SetVLLM_PLUGINS to control which plugins to load. INFO 04-27 19:00:23 [__init__.py:239] Platform plugin swift is activated (EngineCore pid=58708) INFO 04-27 19:00:24 [core.py:105] Initializing a V1 LLM engine (v0.19.1) with config: model='Qwen/Qwen3-0.6B', speculative_config=None, tokenizer='Qwen/Qwen3-0.6B', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=32876, download_dir=None, load_format=auto, tensor_parallel_size=1, pipeline_parallel_size=1, data_parallel_size=1, decode_context_parallel_size=1, dcp_comm_backend=ag_rs, disable_custom_all_reduce=True, quantization=None, enforce_eager=False, enable_return_routed_experts=False, kv_cache_dtype=auto, device_config=cpu, structured_outputs_config=StructuredOutputsConfig(backend='auto', disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser='', reasoning_parser_plugin='', enable_in_reasoning=False), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None, kv_cache_metrics=False, kv_cache_metrics_sample=0.01, cudagraph_metrics=False, enable_layerwise_nvtx_tracing=False, enable_mfu_metrics=False, enable_mm_processor_stats=False, enable_logging_iteration_details=False), seed=0, served_model_name=qwen3.6-27b, enable_prefix_caching=False, enable_chunked_prefill=False, pooler_config=None, compilation_config={'mode': <CompilationMode.VLLM_COMPILE: 3>, 'debug_dump_path': None, 'cache_dir': '', 'compile_cache_save_format': 'binary', 'backend': 'inductor', 'custom_ops': ['none'], 'splitting_ops': ['vllm::unified_attention', 'vllm::unified_attention_with_output', 'vllm::unified_mla_attention', 'vllm::unified_mla_attention_with_output', 'vllm::mamba_mixer2', 'vllm::mamba_mixer', 'vllm::short_conv', 'vllm::linear_attention', 'vllm::plamo2_mamba_mixer', 'vllm::gdn_attention_core', 'vllm::olmo_hybrid_gdn_full_forward', 'vllm::kda_attention', 'vllm::sparse_attn_indexer', 'vllm::rocm_aiter_sparse_attn_indexer', 'vllm::unified_kv_cache_update', 'vllm::unified_mla_kv_cache_update'], 'compile_mm_encoder': False, 'cudagraph_mm_encoder': False, 'encoder_cudagraph_token_budgets': [], 'encoder_cudagraph_max_images_per_batch': 0, 'compile_sizes': None, 'compile_ranges_endpoints': [32876], 'inductor_compile_config': {'enable_auto_functionalized_v2': False, 'size_asserts': False, 'alignment_asserts': False, 'scalar_asserts': False, 'combo_kernels': True, 'benchmark_combo_kernel': True}, 'inductor_passes': {}, 'cudagraph_mode': <CUDAGraphMode.NONE: 0>, 'cudagraph_num_of_warmups': 0, 'cudagraph_capture_sizes': None, 'cudagraph_copy_inputs': False, 'cudagraph_specialize_lora': True, 'use_inductor_graph_partition': False, 'pass_config': {'fuse_norm_quant': False, 'fuse_act_quant': False, 'fuse_attn_quant': False, 'enable_sp': False, 'fuse_gemm_comms': False, 'fuse_allreduce_rms': False}, 'max_cudagraph_capture_size': None, 'dynamic_shapes_config': {'type': <DynamicShapesType.BACKED: 'backed'>, 'evaluate_guards': False, 'assume_32_bit_indexing': False}, 'local_cache_dir': None, 'fast_moe_cold_start': True, 'static_all_moe_layers': []} (EngineCore pid=58708) INFO 04-27 19:00:24 [parallel_state.py:1400] world_size=1 rank=0 local_rank=0 distributed_init_method=tcp://198.18.0.1:52723 backend=gloo (EngineCore pid=58708) INFO 04-27 19:00:24 [parallel_state.py:1716] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, PCP rank 0, TP rank 0, EP rank N/A, EPLB rank N/A MLX error: Failed to load the default metallib. This library is using a deployment target (0x00020008) that is not supported on this OS. library not found library not found library not found at /Users/tom/dev/vllm-swift/swift/.build/checkouts/mlx-swift/Source/Cmlx/mlx-c/mlx/c/memory.cpp:69 (APIServer pid=58692) Traceback (most recent call last): (APIServer pid=58692) File "<frozen runpy>", line 198, in _run_module_as_main (APIServer pid=58692) File "<frozen runpy>", line 88, in _run_code (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 712, in <module> (APIServer pid=58692) uvloop.run(run_server(args)) (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/uvloop/__init__.py", line 96, in run (APIServer pid=58692) return __asyncio.run( (APIServer pid=58692) ^^^^^^^^^^^^^^ (APIServer pid=58692) File "/opt/homebrew/Cellar/python@3.12/3.12.13_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 195, in run (APIServer pid=58692) return runner.run(main) (APIServer pid=58692) ^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/opt/homebrew/Cellar/python@3.12/3.12.13_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run (APIServer pid=58692) return self._loop.run_until_complete(task) (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/uvloop/__init__.py", line 48, in wrapper (APIServer pid=58692) return await main (APIServer pid=58692) ^^^^^^^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 672, in run_server (APIServer pid=58692) await run_server_worker(listen_address, sock, args, **uvicorn_kwargs) (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 686, in run_server_worker (APIServer pid=58692) async with build_async_engine_client( (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/opt/homebrew/Cellar/python@3.12/3.12.13_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 210, in __aenter__ (APIServer pid=58692) return await anext(self.gen) (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 100, in build_async_engine_client (APIServer pid=58692) async with build_async_engine_client_from_engine_args( (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/opt/homebrew/Cellar/python@3.12/3.12.13_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 210, in __aenter__ (APIServer pid=58692) return await anext(self.gen) (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 136, in build_async_engine_client_from_engine_args (APIServer pid=58692) async_llm = AsyncLLM.from_vllm_config( (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 225, in from_vllm_config (APIServer pid=58692) return cls( (APIServer pid=58692) ^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 154, in __init__ (APIServer pid=58692) self.engine_core = EngineCoreClient.make_async_mp_client( (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper (APIServer pid=58692) return func(*args, **kwargs) (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 130, in make_async_mp_client (APIServer pid=58692) return AsyncMPClient(*client_args) (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/tracing/otel.py", line 178, in sync_wrapper (APIServer pid=58692) return func(*args, **kwargs) (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 887, in __init__ (APIServer pid=58692) super().__init__( (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 535, in __init__ (APIServer pid=58692) with launch_core_engines( (APIServer pid=58692) ^^^^^^^^^^^^^^^^^^^^ (APIServer pid=58692) File "/opt/homebrew/Cellar/python@3.12/3.12.13_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/contextlib.py", line 144, in __exit__ (APIServer pid=58692) next(self.gen) (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 998, in launch_core_engines (APIServer pid=58692) wait_for_engine_startup( (APIServer pid=58692) File "/Users/kk/.vllm-swift/venv/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 1057, in wait_for_engine_startup (APIServer pid=58692) raise RuntimeError( (APIServer pid=58692) RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {'EngineCore': 255}

ai analyse:
MLX error: Failed to load the default metallib. This library is using a deployment target (0x00020008) that is not supported on this OS.

根本原因:vllm-swift 0.2.2 的 MLX metallib 库与你的 macOS 版本不兼容。

具体分析:

  1. MLX Metal 库部署目标不匹配 — 0x00020008 对应 macOS 26.0+ (即 macOS Tahoe/下一代),而你当前系统是 macOS 15.3.1 (Sequoia)。vllm-swift 0.2.2 编译时使用了过高的 macOS deployment
    target,导致 Metal shader metallib 无法在当前系统加载。
  2. 连锁反应 — MLX 初始化失败后,vLLM EngineCore 无法通过 Swift/Metal 后端运行模型,随后整个引擎启动流程崩溃,抛出 RuntimeError: Engine core initialization failed。
  3. 另外注意 — 日志显示 Resolved architecture: Qwen3ForCausalLM 和 model='Qwen/Qwen3-0.6B',说明 vLLM 把这个 Qwen3.5 hybrid (含 linear_attention 层) 模型错误地解析为
    Qwen3ForCausalLM(纯文本 Qwen3),而非 Qwen3_5ForConditionalGeneration。即使 MLX 加载成功,这个架构映射错误也会导致问题。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions