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

multi-gpu fix #668

Merged
merged 7 commits into from
Dec 3, 2024
Merged

multi-gpu fix #668

merged 7 commits into from
Dec 3, 2024

Conversation

casper-hansen
Copy link
Owner

@casper-hansen casper-hansen commented Dec 3, 2024

Closes #667 #666 #662 #652 #638 (if not, please let me know in a new issue with traceback + code).

@davedgd
Copy link
Contributor

davedgd commented Dec 4, 2024

Not sure if you’ve already fully tested this, but tomorrow I will run some tests to see how things look similar to the old PR and will let you know. Really appreciate your work on this!

@davedgd
Copy link
Contributor

davedgd commented Dec 4, 2024

Just confirmed this works perfectly using the recommended approach, i.e.,

model = AutoAWQForCausalLM.from_pretrained(model_path)

Tested with both one and two GPUs (with the former being slightly faster likely due to less transfer).

@Jerryzhao-z
Copy link

Jerryzhao-z commented Dec 6, 2024

I reproduced two device error while quantizing qwen2 7b lora with the latest version.

deps:

  • transformers==4.47.0
  • accelerate==1.1.1

I set two cuda devices available and track this error. The AlignDevicesHook.execution_device attached on model.rotary_emb is still equal to cuda:1 after awq.models.qwen2.move_embed set model.rotary_emb to cuda:0.
so this hook resets activations to device cuda:1 while forwarding rotary_embed module

after removing this [move_embed] code, quantization task got executed.

hope it helps

@Jerryzhao-z
Copy link

I reproduced two device error while quantizing qwen2 7b lora with the latest version.

deps:

  • transformers==4.47.0
  • accelerate==1.1.1

I set two cuda devices available and track this error. The AlignDevicesHook.execution_device attached on model.rotary_emb is still equal to cuda:1 after awq.models.qwen2.move_embed set model.rotary_emb to cuda:0. so this hook resets activations to device cuda:1 while forwarding rotary_embed module

after removing this [move_embed] code, quantization task got executed.

hope it helps

sorry, I didn't follow the recommended usage examples. It works perfectly now.
model = AutoAWQForCausalLM.from_pretrained(model_path)

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