pytorch / pytorch/executorch

Error Compiling SpinQuant in QnnBackend

Open
#6,748 7 comments 0 reactions 1 assignee View on GitHub

@cccclai is already working on this.

Since Nov 12, 2024.

module: qnn partner: qualcomm triaged
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

🐛 Describe the bug

Traceback (most recent call last):
File "anaconda3/envs/et_qnn/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "anaconda3/envs/et_qnn/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "Downloads/executorch/examples/models/llama/export_llama.py", line 30, in
main() # pragma: no cover
File "Downloads/executorch/examples/models/llama/export_llama.py", line 26, in main
export_llama(modelname, args)
File "Downloads/executorch/examples/models/llama/export_llama_lib.py", line 485, in export_llama
builder = _export_llama(modelname, args)
File "Downloads/executorch/examples/models/llama/export_llama_lib.py", line 591, in _export_llama
_prepare_for_llama_export(modelname, args)
File "Downloads/executorch/examples/models/llama/export_llama_lib.py", line 517, in _prepare_for_llama_export
_load_llama_model(
File "Downloads/executorch/examples/models/llama/export_llama_lib.py", line 812, in load_llama_model
model, example_inputs, example_kwarg_inputs, _ = EagerModelFactory.create_model(
File "Downloads/executorch/examples/models/model_factory.py", line 44, in create_model
model = model_class(**kwargs)
File "Downloads/executorch/examples/models/llama/model.py", line 207, in init
missing, unexpected = self.model
.load_state_dict(
File "anaconda3/envs/et_qnn/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2584, in load_state_dict
raise RuntimeError(
RuntimeError: Error(s) in loading state_dict for Transformer:
While copying the parameter named "tok_embeddings.weight", whose dimensions in the model are torch.Size([128256, 3072]) and whose dimensions in the checkpoint are torch.Size([128256, 3072]), an exception occurred : ('Only Tensors of floating point and complex dtype can require gradients',).

Versions

wget https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
--2024-11-11 16:29:08-- https://raw.githubusercontent.com/pytorch/pytorch/main/torch/utils/collect_env.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8001::154, 2606:50c0:8003::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8002::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24366 (24K) [text/plain]
Saving to: ‘collect_env.py’

collect_env.py 100%[================================================================================================================>] 23.79K --.-KB/s in 0s

2024-11-11 16:29:09 (58.5 MB/s) - ‘collect_env.py’ saved [24366/24366]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.