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 support for prefix-tuning #359

Merged
merged 7 commits into from
Jul 5, 2022

Conversation

alexanderhanboli
Copy link

The current way of initializing input_tokens in __init__ and using device = next(self.parameters()).device to find device does not work for multi-gpu.

Instead we should use this fix to find the device of the module and assign it to the input tokens.

@calpt calpt self-requested a review June 14, 2022 08:43
Copy link
Member

@calpt calpt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @alexanderhanboli, thanks for looking into this issue and providing a fix! Happy to merge this as soon as all the tests are passing.

(I'm assuming this closes #358)

src/transformers/adapters/prefix_tuning.py Show resolved Hide resolved
@calpt calpt linked an issue Jun 14, 2022 that may be closed by this pull request
4 tasks
Copy link
Member

@calpt calpt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@calpt calpt merged commit 74dd021 into adapter-hub:master Jul 5, 2022
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.

prefix-tuning does not with pytorch >= 1.5.0
2 participants