Skip to content

Fix model parallel issue for altclip model and ChineseClip model#45487

Merged
vasqu merged 5 commits into
huggingface:mainfrom
kaixuanliu:altclip-fix
May 28, 2026
Merged

Fix model parallel issue for altclip model and ChineseClip model#45487
vasqu merged 5 commits into
huggingface:mainfrom
kaixuanliu:altclip-fix

Conversation

@kaixuanliu

Copy link
Copy Markdown
Contributor

This PR tries to fix bug for model parallel test cases for altclip model and ChineseClip model:

tests/models/chinese_clip/test_modeling_chinese_clip.py::ChineseCLIPTextModelTest::test_model_parallelism
tests/models/altclip/test_modeling_altclip.py::AltCLIPTextModelTest::test_model_parallelism

pls help review, @ydshieh , thx!

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
@ydshieh

ydshieh commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

I need to allocate more time on this PR, please be patient 🙏

@kaixuanliu

Copy link
Copy Markdown
Contributor Author

@vasqu Hi, can you help review this PR? There are a lot of file changes here as I need to resolve modular conversion check issue.

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall looks fine, just one question re vision attention as no split module --> would be nice if we had a layer instead or similar

base_model_prefix = "altclip"
input_modalities = ("image", "text")
_no_split_modules = ["AltCLIPTextEmbeddings", "AltCLIPEncoderLayer", "AltCLIPVisionEmbeddings"]
_no_split_modules = ["AltRobertaEmbeddings", "AltRobertaLayer", "AltCLIPEncoderLayer", "AltCLIPVisionEmbeddings"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh wow, text embeddings doesnt even exist. Probably missed durig a refactor

"ChineseCLIPVisionEmbeddings",
"ChineseCLIPTextEmbeddings",
"ChineseCLIPTextLayer",
"ChineseCLIPVisionAttention",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why vision attention? Do we maybe have vision layer instead?

@kaixuanliu kaixuanliu May 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, have changed to ChineseCLIPVisionLayer

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

run-slow: altclip, bridgetower, camembert, chinese_clip, clap, data2vec, roberta, roberta_prelayernorm, xlm_roberta, xmod

@vasqu vasqu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, sanity checking now

@vasqu

vasqu commented May 28, 2026

Copy link
Copy Markdown
Collaborator

run-slow: altclip, bridgetower, camembert, chinese_clip, clap, data2vec, roberta, roberta_prelayernorm, xlm_roberta, xmod

@github-actions

Copy link
Copy Markdown
Contributor

Workflow Run ⚙️

This comment contains run-slow, running the specified jobs:

models: ["models/altclip", "models/bridgetower", "models/camembert", "models/chinese_clip", "models/clap", "models/data2vec", "models/roberta", "models/roberta_prelayernorm", "models/xlm_roberta", "models/xmod"]
quantizations: []

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

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
Copy Markdown
Contributor

CI Results

Workflow Run ⚙️

Commit Info

Context Commit Description
RUN 7fcc88f8 workflow commit (merge commit)
PR fd2f47f5 branch commit (from PR)
main bdca59aa base commit (on main)

✅ No failing test specific to this PR 🎉 👏 !

@vasqu vasqu added this pull request to the merge queue May 28, 2026
@vasqu vasqu removed this pull request from the merge queue due to a manual request May 28, 2026
@vasqu vasqu added this pull request to the merge queue May 28, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 28, 2026
@vasqu vasqu added this pull request to the merge queue May 28, 2026
Merged via the queue into huggingface:main with commit 08f1309 May 28, 2026
23 checks passed
yuchenxie4645 pushed a commit to yuchenxie4645/transformers that referenced this pull request May 28, 2026
…gingface#45487)

* fix model parallel device mismatch issue for altclip model

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

* fix model parallel issue for ChineseClip model

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

* refine code

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
kashif pushed a commit to kashif/transformers that referenced this pull request Jun 1, 2026
…gingface#45487)

* fix model parallel device mismatch issue for altclip model

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

* fix model parallel issue for ChineseClip model

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

* refine code

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
khushali9 pushed a commit to khushali9/transformers that referenced this pull request Jun 8, 2026
…gingface#45487)

* fix model parallel device mismatch issue for altclip model

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

* fix model parallel issue for ChineseClip model

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

* refine code

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>

---------

Signed-off-by: Liu, Kaixuan <kaixuan.liu@intel.com>
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.

5 participants