Skip to content
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

fix reshape error when multi GPU bachsize > 1 not packed #382

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

Ultized
Copy link
Contributor

@Ultized Ultized commented Sep 3, 2024

fix reshape error when multi GPU bachsize > 1 and not packed.

when bachsize =2 , GPU size = 2
(world_view,) = all_to_all_tensor_list(
world_size,
[(torch.ones_like(radii) * torch.arange(0, 4, device = radii.device)[:, None] + torch.ones_like(radii) * world_rank * radii.shape[0]).flatten(0, 1)],
splits=[C_i * N for C_i in C_world],
output_splits=[C * N_i for N_i in N_world],
)
world_view2 = world_view.reshape(C, -1)

when world_rank = 1 the world_view2 is
tensor([[2, 2, 2, ..., 3, 3, 3],
[6, 6, 6, ..., 7, 7, 7]], device='cuda:1')
It should tensor([[2, 2, 2, ..., 6, 6, 6],
[3, 3, 3, ..., 7, 7, 7]], device='cuda:1')

@liruilong940607
Copy link
Collaborator

Thanks for the fix!

Mind run the black format?

black==22.3.0
black . gsplat/ tests/ examples/ profiling/ --check

Conforms to black format
Copy link
Collaborator

@liruilong940607 liruilong940607 left a comment

Choose a reason for hiding this comment

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

LGTM!

@liruilong940607 liruilong940607 merged commit c14d720 into nerfstudio-project:main Sep 4, 2024
2 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.

2 participants