Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError: Cannot copy out of meta tensor; no data! #2519

Open
Steindox opened this issue Nov 26, 2024 · 1 comment
Open

NotImplementedError: Cannot copy out of meta tensor; no data! #2519

Steindox opened this issue Nov 26, 2024 · 1 comment

Comments

@Steindox
Copy link

Steindox commented Nov 26, 2024

I use Autoawq to quantize Llama3.2 and Llama 3.1, and it appears problem
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device.

and I try change self._model.to(device) to self._model.to_empty(device),but it does not work

Traceback (most recent call last):
。...
  File "anaconda3/envs/lmeval/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1333, in convert
    raise NotImplementedError(
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device.
@baberabb
Copy link
Contributor

Hi! Can you load the model through transformers, separate from this library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants