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

Optimization for ConvNd if dropout=0. #2371

Merged
merged 4 commits into from
Feb 11, 2025
Merged

Conversation

gslama12
Copy link
Contributor

@gslama12 gslama12 commented Feb 8, 2025

As discussed in #2153

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for adding this DoRA optimization to conv layers. Generally, this looks good, but I have one comment about the bias term.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@BenjaminBossan
Copy link
Member

Thanks for the update. Let's call make style or remove the trailing white space to make the linter happy.

@gslama12
Copy link
Contributor Author

Should be fixed.

Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for the update. As you can see, the tests are failing. I checked what's going on and the issue is that the bias is still flat at this point, hence when it is subtracted, PyTorch broadcasts the base_result.

By reshaping the bias, this should be addressed. IIUC, the bias shape should be (1, -1, ...), where ... are 1s, the number of which depends on the type of conv layer. I suggested a fix, but please LMK if you think this is incorrect.

Co-authored-by: Benjamin Bossan <[email protected]>
Copy link
Member

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Thanks for bringing this DoRA optimization to conv layers.

@BenjaminBossan BenjaminBossan merged commit 363c14e into huggingface:main Feb 11, 2025
14 checks passed
BenjaminBossan pushed a commit to BenjaminBossan/peft that referenced this pull request Feb 18, 2025
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.

3 participants