Skip to content

Conversation

@tianyu-l
Copy link
Contributor

We originally thought each model should have its own pipeline.py function.

However, for most LLMs, it turns out a single function would suffice, and all models which needs PP are reusing pipeline_llama.py originally written for llama3.

(For diffusion models, the model size doesn't justify the usage of PP.)

This PR consolidates them and moves pipeline_llm into torchtitan/distributed/pipeline_parallel.py.

We can refactor later if things change.

@tianyu-l tianyu-l requested a review from H-Huang October 14, 2025 03:59
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 14, 2025
Copy link
Contributor

@wwwjn wwwjn left a comment

Choose a reason for hiding this comment

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

LGTM, nice refactor

@tianyu-l tianyu-l merged commit 6e06a49 into main Oct 14, 2025
9 checks passed
@tianyu-l tianyu-l deleted the pipeline_refactor branch October 14, 2025 05:18
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 15, 2025
We originally thought each model should have its own `pipeline.py`
function.

However, for most LLMs, it turns out a single function would suffice,
and all models which needs PP are reusing `pipeline_llama.py` originally
written for llama3.

(For diffusion models, the model size doesn't justify the usage of PP.)

This PR consolidates them and moves `pipeline_llm` into
`torchtitan/distributed/pipeline_parallel.py`.

We can refactor later if things change.
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 16, 2025
We originally thought each model should have its own `pipeline.py`
function.

However, for most LLMs, it turns out a single function would suffice,
and all models which needs PP are reusing `pipeline_llama.py` originally
written for llama3.

(For diffusion models, the model size doesn't justify the usage of PP.)

This PR consolidates them and moves `pipeline_llm` into
`torchtitan/distributed/pipeline_parallel.py`.

We can refactor later if things change.
githubsgi pushed a commit to githubsgi/torchtitan that referenced this pull request Oct 29, 2025
We originally thought each model should have its own `pipeline.py`
function.

However, for most LLMs, it turns out a single function would suffice,
and all models which needs PP are reusing `pipeline_llama.py` originally
written for llama3.

(For diffusion models, the model size doesn't justify the usage of PP.)

This PR consolidates them and moves `pipeline_llm` into
`torchtitan/distributed/pipeline_parallel.py`.

We can refactor later if things change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants