Skip to content

Fold tbe/stats/ into tbe/monitoring/ for better organization#5591

Closed
q10 wants to merge 1 commit into
pytorch:mainfrom
q10:export-D99739698
Closed

Fold tbe/stats/ into tbe/monitoring/ for better organization#5591
q10 wants to merge 1 commit into
pytorch:mainfrom
q10:export-D99739698

Conversation

@q10

@q10 q10 commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary:
Move bench_params_reporter.py from tbe/stats/ into tbe/monitoring/ to collocate
all three TBE runtime monitoring hooks in one package. Delete the now-empty tbe/stats/
subpackage.

Like TBEStatsReporter and TBEInputMultiplexer, TBEBenchmarkParamsReporter is a
passive forward() observer in the training operator. Grouping them together makes the
package self-documenting and eliminates a confusing single-file subpackage.

To preserve the lightweight tbe:monitoring target (only depends on torch), the reporter
lives in a separate tbe:bench_params_reporter BUCK target with its heavy C++ and
Manifold dependencies. The two targets share the monitoring/ directory but are fully
independent.

Changes:

  • Move bench_params_reporter.py to tbe/monitoring/
  • Delete tbe/stats/ directory (__init__.py and bench_params_reporter.py)
  • Split BUCK: tbe:monitoring (lightweight) + tbe:bench_params_reporter (heavy)
  • Remove old tbe:stats and tbe:dummy_stats_backend_bc targets
  • Update 2 internal consumers to import from new path

No re-export shell needed \u2014 only 2 internal consumers, not externed in torch.package.

Reviewed By: cthi

Differential Revision: D99739698

Summary:
Move `bench_params_reporter.py` from `tbe/stats/` into `tbe/monitoring/` to collocate
all three TBE runtime monitoring hooks in one package. Delete the now-empty `tbe/stats/`
subpackage.

Like `TBEStatsReporter` and `TBEInputMultiplexer`, `TBEBenchmarkParamsReporter` is a
passive forward() observer in the training operator. Grouping them together makes the
package self-documenting and eliminates a confusing single-file subpackage.

To preserve the lightweight `tbe:monitoring` target (only depends on torch), the reporter
lives in a separate `tbe:bench_params_reporter` BUCK target with its heavy C++ and
Manifold dependencies. The two targets share the `monitoring/` directory but are fully
independent.

Changes:
- Move bench_params_reporter.py to tbe/monitoring/
- Delete tbe/stats/ directory (\_\_init\_\_.py and bench_params_reporter.py)
- Split BUCK: tbe:monitoring (lightweight) + tbe:bench_params_reporter (heavy)
- Remove old tbe:stats and tbe:dummy_stats_backend_bc targets
- Update 2 internal consumers to import from new path

No re-export shell needed \u2014 only 2 internal consumers, not externed in torch.package.

Reviewed By: cthi

Differential Revision: D99739698
@meta-codesync

meta-codesync Bot commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

@q10 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D99739698.

@meta-codesync

meta-codesync Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 141dc0d.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants