issue running llm_build on macOS

#1
by splash329 - opened

The "pulsar2 llm-build" command introduced in version 4.0 seems has some issues with macOS. When I tried compiling the example, following error occurred:

2025-06-19 16:44:36.548 | INFO | yasched.job_cse:job_cse:60 - jobs cse names: ['self_attn.concat_k_0_t_r', 'self_attn.concat_k_1_t_r']
building llm decode layers ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 24/24 0:24:44
building llm post layer ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1/1 0:05:01
2025-06-19 16:57:01.954 | SUCCESS | yamain.command.llm_build:llm_build:245 - build llm model done!
Traceback (most recent call last):
File "", line 59, in guard_context
File "", line 314, in llm_build
File "/usr/local/lib/python3.12/site-packages/transformers/models/auto/auto_factory.py", line 564, in from_pretrained
return model_class.from_pretrained(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/transformers/modeling_utils.py", line 262, in _wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/transformers/modeling_utils.py", line 3690, in from_pretrained
hf_quantizer = AutoHfQuantizer.from_config(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/transformers/quantizers/auto.py", line 167, in from_config
return target_cls(quantization_config, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/transformers/quantizers/quantizer_gptq.py", line 49, in init
raise ImportError("Loading a GPTQ quantized model requires optimum (pip install optimum)")
ImportError: Loading a GPTQ quantized model requires optimum (pip install optimum)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 4, in
File "", line 275, in
File "", line 271, in pulsar2
File "", line 248, in llm_build
File "/usr/local/lib/python3.12/contextlib.py", line 158, in exit
self.gen.throw(value)
File "", line 61, in guard_context
File "", line 73, in error_func
yamain.common.error.CodeException: (<LLMErrorCode.LLM_CHECK: 2>, ImportError('Loading a GPTQ quantized model requires optimum (pip install optimum)'))

Installing optimum did not solve this issue.
Although this error occurred, there were still some files being compiled to target path:
.
|-- qwen2_p128_l0_together.axmodel
|-- qwen2_p128_l10_together.axmodel
|-- qwen2_p128_l11_together.axmodel
|-- qwen2_p128_l12_together.axmodel
|-- qwen2_p128_l13_together.axmodel
|-- qwen2_p128_l14_together.axmodel
|-- qwen2_p128_l15_together.axmodel
|-- qwen2_p128_l16_together.axmodel
|-- qwen2_p128_l17_together.axmodel
|-- qwen2_p128_l18_together.axmodel
|-- qwen2_p128_l19_together.axmodel
|-- qwen2_p128_l1_together.axmodel
|-- qwen2_p128_l20_together.axmodel
|-- qwen2_p128_l21_together.axmodel
|-- qwen2_p128_l22_together.axmodel
|-- qwen2_p128_l23_together.axmodel
|-- qwen2_p128_l2_together.axmodel
|-- qwen2_p128_l3_together.axmodel
|-- qwen2_p128_l4_together.axmodel
|-- qwen2_p128_l5_together.axmodel
|-- qwen2_p128_l6_together.axmodel
|-- qwen2_p128_l7_together.axmodel
|-- qwen2_p128_l8_together.axmodel
|-- qwen2_p128_l9_together.axmodel
`-- qwen2_post.axmodel

1 directory, 25 files

Can anyone confirm if this is a compatibility issue or not? Is there anything I can do to fix this? Thanks.

Sign up or log in to comment