Visitar URL original
[Feature] Refactor `ParallelContext.world_rank_matrix` · Issue #77 · huggingface/nanotron · GitHub
Skip to content

[Feature] Refactor ParallelContext.world_rank_matrix #77

Open

Description

@nmntz

For now we're storing the global ranks inside the world_rank_matrix attribute which is a numpy array of shape (expert_parallel_size, pipeline_parallel_size, data_parallel_size, tensor_parallel_size)

So in order to access a process' global rank using the world_rank_matrix right now we're using:

parallel_context.world_rank_matrix[
dist.get_rank(parallel_context.expert_pg),
get_pp_rank_of(target, module=mdl),
dist.get_rank(parallel_context.dp_pg),
dist.get_rank(parallel_context.tp_pg),
],

It would be cool to make it a functional call instead such as:

parallel_context.get_global_rank(expert_parallel_rank=0, pipeline_parallel_rank=0, data_parallel_rank=0, tensor_parallel_rank=0)

Activity

  1. added 2 commits that reference this issue on Apr 20, 2025
    0d8693b
    9b3380a
  2. info-gallary commented on Aug 25, 2026

    @info-gallary

    Hi! I’d like to work on this issue if it’s still available. I can implement the "get_global_rank()" helper and add/update the relevant tests. Please let me know if I should proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions