-
Notifications
You must be signed in to change notification settings - Fork 31.5k
fix device dismatch issue for pe_audio_video model parallelism #42917
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
Open
kaixuanliu
wants to merge
9
commits into
huggingface:main
Choose a base branch
from
kaixuanliu:pe-video-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+19
−8
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5efe73c
fix device dismatch issue for pe_audio_video model parallelism
kaixuanliu bcae7f0
skip the model parallelism unit test
kaixuanliu 56f7b59
update
kaixuanliu b8a5ea2
Set all padding_mask_videos to 1 to avoid NaN values in outputs
kaixuanliu e5fb246
fix bug
kaixuanliu 58e78ea
keep at least 1 valid frame
kaixuanliu 63373d3
fix format issue
kaixuanliu e9aa6b6
use random.seed
kaixuanliu f8b0df3
update code
kaixuanliu 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,10 +103,9 @@ def prepare_config_and_inputs(self): | |
| self.config_kwargs["vision_config"]["model_args"]["img_size"][1], | ||
| ] | ||
| ) | ||
| valid_lengths = ids_tensor([self.batch_size], self.num_frames) | ||
| padding_mask_videos = ( | ||
| torch.ones([self.batch_size, self.num_frames], device=torch_device) < valid_lengths[:, None] | ||
| ) | ||
| # Generate valid_lengths in range [1, num_frames] to ensure at least one valid frame | ||
| valid_lengths = ids_tensor([self.batch_size], self.num_frames - 1) + 1 | ||
| padding_mask_videos = torch.arange(self.num_frames, device=torch_device).unsqueeze(0) < valid_lengths[:, None] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we should use |
||
| padding_mask_videos = padding_mask_videos.int() | ||
| config = self.get_config() | ||
|
|
||
|
|
@@ -187,6 +186,10 @@ def test_feed_forward_chunking(self): | |
| def test_save_load(self): | ||
| pass | ||
|
|
||
| @unittest.skip(reason="TimmWrapperModel does not support model parallelism") | ||
| def test_model_parallelism(self): | ||
| pass | ||
|
|
||
| @unittest.skip(reason="@eustlb this is not really expected") | ||
| def test_batching_equivalence(self): | ||
| pass | ||
|
|
||
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.
no, no, I meant to keep the changes and skip the tests. With the proposed diff, we can support model parallelism but the tests fail because of the way it is designed
Can you revert the prev diff and "move
no_split_moduleunder a timm's PreTrainedModel" instead of PE?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.
Is it OK now?