Lightning-AI / Lightning-AI/lightning-thunder

Transform to skip distributed collective ops when `group.size() == 1`

Open
#1,099 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
1.5k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

🚀 Feature

As per title. It'd make sense to have a trace transformation that skip distributed collective ops if the number of processes residing in a group is 1.

Motivation
Pitch
Alternatives

It'd be equivalent to have this logic inside of ltorch definitions to check the world size and return tensor w/o calling dist_prims

Additional context

Contributor guide

No contributing guide indexed for this repository

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 inspecting the trace transformation entry points and the ltorch definitions mentioned in the issue, then trace how distributed collective operations reach dist_prims. Determine which collectives should be skipped when group.size() == 1 and how the unchanged tensor result should be represented. Done means the transformation handles the intended collectives without invoking them for singleton groups and has coverage for that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
compilers, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.