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

FineTuning AutoModelForSequenceClassification.from_pretrained(meta-llama/Llama-3.2-1B) Bug:RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:1 and cuda:0! (when checking argument for argument target in method wrapper_CUDA_nll_loss_forward) and awq importing #35365

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

alestrami
Copy link

What does this PR do?

Fixes # (issue)

Before submitting

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

I added two contributions.

  1. The first one regarding the mismatch about the batch of the devices then training the model with the attribute device_map='auto'. Discussed here for AutoModelForSequenceClassification.from_pretrained. Thasnks to [hust] who provided the solution. Working also in my case with llama 3.3 1B https://discuss.huggingface.co/t/fine-tune-meta-llama-llama-2-7b-hf-bug-expected-all-tensors-to-be-on-the-same-device-but-found-at-least-two-devices-cuda-1-and-cuda-0-when-checking-argument-for-argument-target-in-method-wrapper-cuda-nll-loss-forward/129341/1
  2. The seconds is regarding the checking of availability of the package awq for loading quantized models. 'problems importing in awq # importlib.metadata.version doesn't work with awq (line 144 src/transformers/utils/import_utils.py) . mportlib.metadata.version(pkg_name) works with 'autoawq' and not 'awq' while importlib.util.find_spec("awq") works only with awq and not autoawq. Both of thems need to be taken into account (is the same package)

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

Successfully merging this pull request may close these issues.

1 participant