NVIDIA-NeMo / NVIDIA-NeMo/Automodel

Add an option for automatic module splitting in Autopipeline

Open
#604 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
963
Forks
318
Avg merge
3d 20h
Merged PRs (30d)
143

Description

  • Re "Challenge 3: Forward Method Patching"

Have you looked at:

import torch.distributed.pipelining as pipelining

full_model = AutoModelForCausalLM(...)

pipe = pipelining.pipeline(full_model, spec, ...)
my_submod = pipe.get_stage_module(my_pp_rank)

This way my_submod -- a nn.Module -- would have the desired forward function automatically.

  • Re "Challenge 2: nn.ModuleList vs nn.ModuleDict: The Indexing Problem":

my_submod created above would have the same FQN hierarchy as the original model as well as original indices, e.g. layers.8-16 instead of layers.0-8, thus avoiding challenge 2 too.

Reference: Option 2: splitting a model automatically

Originally posted by @kwen2501 in https://github.com/NVIDIA-NeMo/Automodel/discussions/589#discussioncomment-14619715

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked PyTorch distributed.pipelining documentation, especially “Option 2: splitting a model automatically,” and compare it with the Autopipeline code related to the referenced Challenge 2 and Challenge 3. Done means an automatic-splitting option produces submodules with the intended forward function and preserves the original FQN hierarchy and indices.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.