Skip to content

Conversation

@OleehyO
Copy link
Contributor

@OleehyO OleehyO commented Apr 17, 2025

What does this PR do?

This PR is primarily aimed at adding native multi-resolution + packing training support to CogView4 to better meet user needs. We have conducted relevant tests in this PR.

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.

@a-r-r-o-w
@zRzRzRzRzRzRzR

OleehyO added 4 commits April 9, 2025 10:24
…nd batch packing

Add support for variable-length attention between text and vision tokens while maintaining the original attention pattern. Implement batch packing capability to improve computational efficiency during inference and training.
@yiyixuxu
Copy link
Collaborator

let me know what you think too @a-r-r-o-w
I wonder if it would be easier to make a new attention processor for this?

@OleehyO
Copy link
Contributor Author

OleehyO commented Apr 18, 2025

@a-r-r-o-w It has been renamed to CogView4TrainingAttnProcessor, and a bug in the original CogView4AttnProcessor has been fixed. We use the same naming format in both CogView4AttnProcessor and CogView4TrainingAttnProcessor. Please take a look

@OleehyO
Copy link
Contributor Author

OleehyO commented Apr 19, 2025

I have changed back to using attention_kwargs in CogView4Transformer2DModel to pass attention parameters.

Copy link
Contributor

@a-r-r-o-w a-r-r-o-w 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 addressing the comments!

@a-r-r-o-w a-r-r-o-w requested a review from yiyixuxu April 19, 2025 15:06
@yiyixuxu
Copy link
Collaborator

@bot /style

@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.

@yiyixuxu
Copy link
Collaborator

@bot /style

@github-actions
Copy link
Contributor

Style fixes have been applied. View the workflow run here.

@yiyixuxu yiyixuxu merged commit 0434db9 into huggingface:main Apr 21, 2025
12 checks passed
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.

4 participants