Skip to content

[graph_trainer] Add nightly self-improvement scout and first report - #2838

Merged
SherlockNoMad merged 1 commit into
mainfrom
bahuang/self_improve
Apr 5, 2026
Merged

SherlockNoMad merged 1 commit into
mainfrom
bahuang/self_improve

Conversation

@SherlockNoMad

Copy link
Copy Markdown
Contributor

Add a nightly prompt (.claude/nightly.md) designed to be run by Claude Code to discover self-improvement opportunities — not breakage detection (CI handles that), but things like upstream API drift, test coverage gaps, unblocked TODOs, and code freshness issues.

The scout covers 5 areas (all local, no network access required):

  1. Core torchtitan delta review (opportunity/risk from upstream changes)
  2. TODO unblock detection (dynamic discovery, local torch inspection)
  3. Test & CI coverage gap analysis (file comparison vs workflow YAMLs)
  4. Code freshness & technical debt (monkey-patches, private APIs, config drift)
  5. Documentation freshness

Removed from earlier version: performance opportunity discovery (produced no actionable output), open work tracking (requires GitHub API), CI status checks (requires GitHub API), git push (requires network access).

Reports are written to graph_trainer/reports/YYYY-MM-DD.md. After the report, action items are implemented as one-commit-per-item on a graph_trainer/self_improve/YYYY-MM-DD branch.

The first report (2026-04-02) surfaces two P0 findings:

  • Llama3 parallelize.py missing enable_cp/enable_sp in apply_tp() call, meaning context parallelism silently malfunctions despite README claiming CP support
  • fsdp_reshard_after_fwd_pass has zero test coverage (no unit or integration test)

ghstack-source-id: 7c03f4a1bf1d69f00ed296ac4357a60443142213
Pull Request resolved: #2806

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a GraphTrainer “nightly self-improvement scout” prompt (for Claude Code) plus an initial generated report to help proactively detect drift, coverage gaps, and documentation/config inconsistencies in torchtitan/experiments/graph_trainer.

Changes:

  • Add a runnable nightly scout prompt at torchtitan/experiments/graph_trainer/.claude/nightly.md.
  • Add the first scout output report at torchtitan/experiments/graph_trainer/reports/2026-04-02.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
torchtitan/experiments/graph_trainer/.claude/nightly.md New nightly prompt describing how to scan for upstream drift, TODO unblock status, test/CI gaps, and doc freshness.
torchtitan/experiments/graph_trainer/reports/2026-04-02.md Initial scout report capturing discovered action items/opportunities/FYIs as of 2026-04-02.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yiming0416 yiming0416 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is very cool!
I think the comments from copilot on updating file path makes sense. We should give a clearer file path to avoid potential confusions.


- Are there parallelism combinations that core torchtitan tests but
graph_trainer's integration_tests.py doesn't? Compare:
- `tests/integration_tests/test_llama3.py` vs `graph_trainer/tests/integration_tests.py`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is no test_llama3.py.
It should be tests/integration_tests/models.py

@aditvenk aditvenk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Future starts now

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we want to check-in one report per day? who's going to do this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, the report is the memory of the agent.

will automate this in agent first devvm, and it would show up as an PR.
I imagine the first thing I would do everyday is to review it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

who's supposed to run this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will run this as a nightly cron job in agent first devvm.

Add a nightly prompt (.claude/nightly.md) designed to be run by Claude Code
to discover self-improvement opportunities — not breakage detection (CI
handles that), but things like upstream API drift, test coverage gaps,
unblocked TODOs, and code freshness issues.

The scout covers 5 areas (all local, no network access required):
1. Core torchtitan delta review (opportunity/risk from upstream changes)
2. TODO unblock detection (dynamic discovery, local torch inspection)
3. Test & CI coverage gap analysis (file comparison vs workflow YAMLs)
4. Code freshness & technical debt (monkey-patches, private APIs, config drift)
5. Documentation freshness

Removed from earlier version: performance opportunity discovery (produced
no actionable output), open work tracking (requires GitHub API), CI status
checks (requires GitHub API), git push (requires network access).

Reports are written to graph_trainer/reports/YYYY-MM-DD.md.
After the report, action items are implemented as one-commit-per-item on
a graph_trainer/self_improve/YYYY-MM-DD branch.

The first report (2026-04-02) surfaces two P0 findings:
- Llama3 parallelize.py missing enable_cp/enable_sp in apply_tp() call,
  meaning context parallelism silently malfunctions despite README claiming
  CP support
- fsdp_reshard_after_fwd_pass has zero test coverage (no unit or
  integration test)

ghstack-source-id: 7c03f4a
Pull Request resolved: #2806
@SherlockNoMad
SherlockNoMad force-pushed the bahuang/self_improve branch from 4829bea to 74768b6 Compare April 3, 2026 22:45
@SherlockNoMad
SherlockNoMad requested a review from tianyu-l April 3, 2026 22:46

@tianyu-l tianyu-l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable. Let's give it a try.

The first report (2026-04-02) surfaces two P0 findings:

  • Llama3 parallelize.py missing enable_cp/enable_sp in apply_tp() call, meaning context parallelism silently malfunctions despite README claiming CP support
  • fsdp_reshard_after_fwd_pass has zero test coverage (no unit or integration test)

The 2nd seems being addressed by #2809

How about the 1st? Is the issue only in graph_trainer llama3 parallelize.py?

@SherlockNoMad

Copy link
Copy Markdown
Contributor Author

Sounds reasonable. Let's give it a try.

The first report (2026-04-02) surfaces two P0 findings:

  • Llama3 parallelize.py missing enable_cp/enable_sp in apply_tp() call, meaning context parallelism silently malfunctions despite README claiming CP support
  • fsdp_reshard_after_fwd_pass has zero test coverage (no unit or integration test)

The 2nd seems being addressed by #2809

How about the 1st? Is the issue only in graph_trainer llama3 parallelize.py?

AFAIK, graph trainer has never test CP/SP path.
We should. cc @yiming0416

@SherlockNoMad
SherlockNoMad merged commit d7630e1 into main Apr 5, 2026
19 of 25 checks passed
TXacs pushed a commit to McmillanTAC/torchtitan that referenced this pull request Apr 13, 2026
…ytorch#2838)

Add a nightly prompt (.claude/nightly.md) designed to be run by Claude
Code to discover self-improvement opportunities — not breakage detection
(CI handles that), but things like upstream API drift, test coverage
gaps, unblocked TODOs, and code freshness issues.

The scout covers 5 areas (all local, no network access required):
1. Core torchtitan delta review (opportunity/risk from upstream changes)
2. TODO unblock detection (dynamic discovery, local torch inspection)
3. Test & CI coverage gap analysis (file comparison vs workflow YAMLs)
4. Code freshness & technical debt (monkey-patches, private APIs, config
drift)
5. Documentation freshness

Removed from earlier version: performance opportunity discovery
(produced no actionable output), open work tracking (requires GitHub
API), CI status checks (requires GitHub API), git push (requires network
access).

Reports are written to graph_trainer/reports/YYYY-MM-DD.md. After the
report, action items are implemented as one-commit-per-item on a
graph_trainer/self_improve/YYYY-MM-DD branch.

The first report (2026-04-02) surfaces two P0 findings:
- Llama3 parallelize.py missing enable_cp/enable_sp in apply_tp() call,
meaning context parallelism silently malfunctions despite README
claiming CP support
- fsdp_reshard_after_fwd_pass has zero test coverage (no unit or
integration test)

ghstack-source-id: 7c03f4a
Pull Request resolved: pytorch#2806
jemitche1 pushed a commit to jemitche1/torchtitan that referenced this pull request Apr 14, 2026
…ytorch#2838)

Add a nightly prompt (.claude/nightly.md) designed to be run by Claude
Code to discover self-improvement opportunities — not breakage detection
(CI handles that), but things like upstream API drift, test coverage
gaps, unblocked TODOs, and code freshness issues.

The scout covers 5 areas (all local, no network access required):
1. Core torchtitan delta review (opportunity/risk from upstream changes)
2. TODO unblock detection (dynamic discovery, local torch inspection)
3. Test & CI coverage gap analysis (file comparison vs workflow YAMLs)
4. Code freshness & technical debt (monkey-patches, private APIs, config
drift)
5. Documentation freshness

Removed from earlier version: performance opportunity discovery
(produced no actionable output), open work tracking (requires GitHub
API), CI status checks (requires GitHub API), git push (requires network
access).

Reports are written to graph_trainer/reports/YYYY-MM-DD.md. After the
report, action items are implemented as one-commit-per-item on a
graph_trainer/self_improve/YYYY-MM-DD branch.

The first report (2026-04-02) surfaces two P0 findings:
- Llama3 parallelize.py missing enable_cp/enable_sp in apply_tp() call,
meaning context parallelism silently malfunctions despite README
claiming CP support
- fsdp_reshard_after_fwd_pass has zero test coverage (no unit or
integration test)

ghstack-source-id: 7c03f4a
Pull Request resolved: pytorch#2806
ACharacterInASimulation pushed a commit to ACharacterInASimulation/torchtitan that referenced this pull request Apr 21, 2026
…ytorch#2838)

Add a nightly prompt (.claude/nightly.md) designed to be run by Claude
Code to discover self-improvement opportunities — not breakage detection
(CI handles that), but things like upstream API drift, test coverage
gaps, unblocked TODOs, and code freshness issues.

The scout covers 5 areas (all local, no network access required):
1. Core torchtitan delta review (opportunity/risk from upstream changes)
2. TODO unblock detection (dynamic discovery, local torch inspection)
3. Test & CI coverage gap analysis (file comparison vs workflow YAMLs)
4. Code freshness & technical debt (monkey-patches, private APIs, config
drift)
5. Documentation freshness

Removed from earlier version: performance opportunity discovery
(produced no actionable output), open work tracking (requires GitHub
API), CI status checks (requires GitHub API), git push (requires network
access).

Reports are written to graph_trainer/reports/YYYY-MM-DD.md. After the
report, action items are implemented as one-commit-per-item on a
graph_trainer/self_improve/YYYY-MM-DD branch.

The first report (2026-04-02) surfaces two P0 findings:
- Llama3 parallelize.py missing enable_cp/enable_sp in apply_tp() call,
meaning context parallelism silently malfunctions despite README
claiming CP support
- fsdp_reshard_after_fwd_pass has zero test coverage (no unit or
integration test)

ghstack-source-id: 7c03f4a
Pull Request resolved: pytorch#2806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/8gpu 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.

5 participants