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

fix convert_weights not working for Qwen2.5 HF checkpoints #2233

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zhangtemplar
Copy link
Contributor

Summary: In QWen2.5, the attention's linear projection layer has bias=True, but torchtune.convert_weights is not yet supporting bias=True. This diff add support for that

Differential Revision: D67880222

Summary: In QWen2.5, the attention's linear projection layer has bias=True, but torchtune.convert_weights is not yet supporting bias=True. This diff add support for that

Differential Revision: D67880222
Copy link

pytorch-bot bot commented Jan 6, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2233

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 0881133 with merge base 213f386 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 6, 2025
@facebook-github-bot
Copy link

This pull request was exported from Phabricator. Differential Revision: D67880222

@ebsmothers
Copy link
Contributor

@calvinpelletier can you review?

@calvinpelletier
Copy link
Contributor

calvinpelletier commented Jan 8, 2025

Hi @zhangtemplar , you're changing the generic convert_weights function. Qwen2.5 already has a specific convert weights function here which handles the biases of the linear projections.

In our Qwen2.5 configs, we specify the model type as "QWEN2" here which causes the checkpointer to call the Qwen-specific convert weights function here

@joecummings
Copy link
Contributor

Hi @zhangtemplar , you're changing the generic convert_weights function. Qwen2.5 already has a specific convert weights function here which handles the biases of the linear projections.

In our Qwen2.5 configs, we specify the model type as "QWEN2" here which causes the checkpointer to call the Qwen-specific convert weights function here

This raises a good point tho that we don't tell the user if their model type is wrong. We should probably allow either QWEN2_5 or QWEN2 to point to the same conversion function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants