Skip to content

Conversation

@yao-matrix
Copy link
Contributor

as discussed in huggingface/diffusers#11690, ut pytest -rA tests/models/chameleon/test_modeling_chameleon.py::ChameleonVision2SeqModelTest::test_model_parallel_beam_search w/ 2 cards, the error log is "RuntimeError: Expected all tensors to be on the same device, but found at least two devices,src/transformers/models/chameleon/modeling_chameleon.py", the reason is even residual is in the same device as hidden_states at the beginning, but after they went through some operators as both input and output, they finally placed to different device, but when they come to + which is not a nn.Module(so accelerate cannot pre-hook it), error happens.

so, update no_split_modules in ChameleonVQVAE to avoid it. @SunMarc, pls help review, thx.

Copy link
Member

@SunMarc SunMarc left a comment

Choose a reason for hiding this comment

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

Thanks !

Comment on lines +822 to +823
"ChameleonVQVAEEncoderAttnBlock",
"ChameleonVQVAEEncoderResnetBlock",
Copy link
Member

Choose a reason for hiding this comment

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

Thanks ! we can also put instead ChameleonVQVAEEncoder if these blocks are small enough

Copy link
Contributor Author

@yao-matrix yao-matrix Jul 29, 2025

Choose a reason for hiding this comment

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

seems ChameleonVQVAEEncoder is a mega block w/ multiple ChameleonVQVAEEncoderResnetBlock, ChameleonVQVAEEncoderConvDownsample and ChameleonVQVAEEncoderAttnBlock(

class ChameleonVQVAEEncoder(nn.Module):
), so maybe better not to put ChameleonVQVAEEncoder

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

@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: chameleon

@SunMarc SunMarc enabled auto-merge (squash) July 30, 2025 11:56
@SunMarc SunMarc merged commit bb2ac66 into huggingface:main Jul 30, 2025
19 checks passed
@yao-matrix yao-matrix deleted the ChameleonVision-fix branch July 30, 2025 16:15
@yao-matrix yao-matrix mentioned this pull request Aug 6, 2025
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix chameleonvision UT failure

Signed-off-by: [email protected] <Yao Matrix>

* fix style

Signed-off-by: Yao, Matrix <[email protected]>

---------

Signed-off-by: [email protected] <Yao Matrix>
Signed-off-by: Yao, Matrix <[email protected]>
Co-authored-by: root <Yao Matrix>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix chameleonvision UT failure

Signed-off-by: [email protected] <Yao Matrix>

* fix style

Signed-off-by: Yao, Matrix <[email protected]>

---------

Signed-off-by: [email protected] <Yao Matrix>
Signed-off-by: Yao, Matrix <[email protected]>
Co-authored-by: root <Yao Matrix>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix chameleonvision UT failure

Signed-off-by: [email protected] <Yao Matrix>

* fix style

Signed-off-by: Yao, Matrix <[email protected]>

---------

Signed-off-by: [email protected] <Yao Matrix>
Signed-off-by: Yao, Matrix <[email protected]>
Co-authored-by: root <Yao Matrix>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix chameleonvision UT failure

Signed-off-by: [email protected] <Yao Matrix>

* fix style

Signed-off-by: Yao, Matrix <[email protected]>

---------

Signed-off-by: [email protected] <Yao Matrix>
Signed-off-by: Yao, Matrix <[email protected]>
Co-authored-by: root <Yao Matrix>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix chameleonvision UT failure

Signed-off-by: [email protected] <Yao Matrix>

* fix style

Signed-off-by: Yao, Matrix <[email protected]>

---------

Signed-off-by: [email protected] <Yao Matrix>
Signed-off-by: Yao, Matrix <[email protected]>
Co-authored-by: root <Yao Matrix>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix chameleonvision UT failure

Signed-off-by: [email protected] <Yao Matrix>

* fix style

Signed-off-by: Yao, Matrix <[email protected]>

---------

Signed-off-by: [email protected] <Yao Matrix>
Signed-off-by: Yao, Matrix <[email protected]>
Co-authored-by: root <Yao Matrix>
zaristei pushed a commit to zaristei/transformers that referenced this pull request Sep 9, 2025
* fix chameleonvision UT failure

Signed-off-by: [email protected] <Yao Matrix>

* fix style

Signed-off-by: Yao, Matrix <[email protected]>

---------

Signed-off-by: [email protected] <Yao Matrix>
Signed-off-by: Yao, Matrix <[email protected]>
Co-authored-by: root <Yao Matrix>
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