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

MEMIT related method issues for llama3.2 #475

Closed
Syon-Li opened this issue Jan 19, 2025 · 3 comments
Closed

MEMIT related method issues for llama3.2 #475

Syon-Li opened this issue Jan 19, 2025 · 3 comments
Labels
question Further information is requested

Comments

@Syon-Li
Copy link

Syon-Li commented Jan 19, 2025

Dear EasyEdit Team,

I got the following error when trying to run MEMIT for llama3.2-3b

Traceback (most recent call last):
  File "/Editing_baselines.py", line 533, in <module>
    main()
  File "/Editing_baselines.py", line 399, in main
    metrics, edited_model, weights_copy = editor.batch_edit(
  File "/EasyEdit/easyeditor/editors/editor.py", line 227, in batch_edit
    edited_model, weights_copy = self.apply_algo(
  File "/EasyEdit/easyeditor/models/memit/memit_main.py", line 46, in apply_memit_to_model
    deltas = execute_memit(model, tok, requests, hparams, cache_template=cache_template)
  File "/EasyEdit/easyeditor/models/memit/memit_main.py", line 137, in execute_memit
    cur_z = compute_z(
  File "/EasyEdit/easyeditor/models/memit/compute_z.py", line 149, in compute_z
    log_probs = torch.log_softmax(ln_f(full_repr) @ lm_w.to(full_repr.device) + lm_b.to(full_repr.device), dim=2)
RuntimeError: The size of tensor a (128256) must match the size of tensor b (3072) at non-singleton dimension 2

Can you confirm whether this is a bug in your code?

Hi, the same mistake occurs in other MEMIT-related methods, like EMMET, and PEMT (maybe there are others), could you help fix it?

Originally posted by @Syon-Li in #458

@zxlzr zxlzr added the question Further information is requested label Jan 20, 2025
@Syon-Li
Copy link
Author

Syon-Li commented Jan 22, 2025

I have fixed it myself, but you can still update this 7e35bb1#diff-37751c17b0cd75afce0559f97c28e59f0a1cd662f4dc7eea5ba88fd1246166dcR21 to your repo. Thanks!

@zxlzr
Copy link
Contributor

zxlzr commented Jan 22, 2025

Hi buddy, due to limited manpower and resources, we will address this issue as soon as possible. Thank you for providing the solution.

@pengzju
Copy link
Collaborator

pengzju commented Jan 23, 2025

Thank you for your reminder. I have updated the hparams file for PMET and EMMET. plz allow me to close this issue.

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

No branches or pull requests

3 participants