Repository navigation
[core] Tensor parallelism for Qwen-Image-2.1 #14865
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
Merged
sayakpaul
merged 21 commits into
huggingface:main
from
JingyaHuang:add-qwen-image-21-tp-plan
Oct 15, 2026
+104
−227
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
95c69bf
feat: qwen image 21 tp plan
JingyaHuang 481f25d
test: vallidated on neuron
JingyaHuang 46b415a
fix: lru_cache_unless_export leak
JingyaHuang f679fe5
fix: use complex RoPE on TPU for Qwen Image 2.1
JingyaHuang 0da8358
refactor: inline the Neuron device check for Qwen Image 2.1 RoPE
JingyaHuang d641013
Merge branch 'main' into add-qwen-image-21-tp-plan
JingyaHuang 58a87bd
review: cache Qwen Image 2.1 RoPE device freqs with lru_cache
JingyaHuang 1b294bb
review: drop redundant torch.device
JingyaHuang 281c3c5
Merge branch 'main' into add-qwen-image-21-tp-plan
JingyaHuang f9c39bf
Merge branch 'main' into add-qwen-image-21-tp-plan
JingyaHuang 6961b73
Merge branch 'main' into add-qwen-image-21-tp-plan
JingyaHuang b301314
fix: use torch.accelerator.device_count() when resolving the parallel…
JingyaHuang 17c2aa8
refactor: drop the Neuron branch in Qwen Image 2.1 block ids
JingyaHuang 615cd92
restore: neuron repeat_interleave lowering error fix
JingyaHuang aab59a2
review: add TensorParallelNeuronTesterMixin for Neuron TP tests
JingyaHuang 9ac753c
Merge branch 'main' into add-qwen-image-21-tp-plan
sayakpaul 593ada2
Merge branch 'main' into add-qwen-image-21-tp-plan
JingyaHuang 6210f4c
review: revert Qwen Image 2.1 RoPE freqs cache to a per-instance dict
JingyaHuang 906b279
Merge branch 'add-qwen-image-21-tp-plan' of github.com:JingyaHuang/di…
JingyaHuang 46dc894
Merge branch 'main' into add-qwen-image-21-tp-plan
JingyaHuang bed1115
review: drop the Neuron RoPE path in Qwen Image 2.1
JingyaHuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this change now?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the latest nightly built of
torch_tpu,torch.get_device_module("tpu").device_count()now raises(RuntimeError: device_count is internal to TorchTPU and can only be called by the PyTorch framework (torch and torch_tpu). Use torch.accelerator.device_count instead.).this is how it is working with beta releases... but torch.accelerator is equivalent and work for cuda/neuron at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's available from PyTorch 2.6 as well because that is the minimum PyTorch we require.