Skip to content

Conversation

@DamonFool
Copy link
Contributor

This fixes the following error with make causal-run-original-model on mac m1.

Traceback (most recent call last):
  File "/Users/jiefu/llama.cpp/examples/model-conversion/./scripts/causal/run-org-model.py", line 196, in <module>
    outputs = model(input_ids)
              ^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/transformers/utils/generic.py", line 940, in wrapper
    output = func(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/transformers/models/qwen2/modeling_qwen2.py", line 449, in forward
    outputs: BaseModelOutputWithPast = self.model(
                                       ^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1784, in _call_impl
    return forward_call(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/transformers/utils/generic.py", line 1064, in wrapper
    outputs = func(self, *args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/transformers/models/qwen2/modeling_qwen2.py", line 345, in forward
    inputs_embeds = self.embed_tokens(input_ids)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1773, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1879, in _call_impl
    return inner()
           ^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1827, in inner
    result = forward_call(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/modules/sparse.py", line 192, in forward
    return F.embedding(
           ^^^^^^^^^^^^
  File "/Users/jiefu/.python_venv/llama.cpp.dev/lib/python3.11/site-packages/torch/nn/functional.py", line 2546, in embedding
    return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Placeholder storage has not been allocated on MPS device!
make: *** [causal-run-original-model] Error 1

Signed-off-by: Jie Fu <jiefu@tencent.com>
@DamonFool DamonFool requested a review from danbev as a code owner September 24, 2025 06:34
@github-actions github-actions bot added examples python python script changes labels Sep 24, 2025
@danbev danbev merged commit 7735706 into ggml-org:master Sep 24, 2025
1 check passed
@danbev
Copy link
Member

danbev commented Sep 24, 2025

@DamonFool Thanks!

@DamonFool
Copy link
Contributor Author

Thanks @danbev .

@DamonFool DamonFool deleted the model-conversion branch September 24, 2025 07:23
pwilkin pushed a commit to pwilkin/llama.cpp that referenced this pull request Sep 25, 2025
struct pushed a commit to struct/llama.cpp that referenced this pull request Sep 26, 2025
yael-works pushed a commit to yael-works/llama.cpp that referenced this pull request Oct 15, 2025
pwilkin pushed a commit to pwilkin/llama.cpp that referenced this pull request Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples python python script changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants