repo-maintenance
Maintain the torchsummary checkout safely, including package layout, public exports, dependency caveats, focused unittest commands, and safe edit boundaries.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- repo-maintenance
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Maintain the torchsummary checkout safely, including package layout, public exports, dependency caveats, focused unittest commands, and safe edit boundaries.
- disable-model-invocation
- true
02 资源文件 2
- 参考文档references/testing-and-maintenance.md9.5 KB
- 参考文档references/troubleshooting.md8.3 KB
03 SKILL.md 正文
repo-maintenance
Use this sub-skill when the task is to maintain, edit, test, package, or refresh the tiny torchsummary source checkout. It preserves the repository facts needed to make safe changes without reopening external project pages or depending on original checkout paths.
For user-level model summary calls, input_size usage, multiple-input workflows, return values, or interpreting the printed table, route to ../model-summary-usage/SKILL.md instead.
Route map
- Source layout, package metadata, dependency declaration gaps, focused tests, and safe edit boundaries: read
references/testing-and-maintenance.md. - Maintenance failures, import confusion, CPU/CUDA device issues, dtype pitfalls, and modern PyTorch count comparisons: read
references/troubleshooting.md. - Cross-skill install/import provenance and shared package troubleshooting: see the root skill references
../../references/repo-provenance.mdand../../references/troubleshooting.mdwhen those root files are present in the generated bundle.
Essential facts
- Distribution/import module:
torchsummary. - Source package version:
1.5.1fromsetup.py. - Public exports from
torchsummary/__init__.py:summaryandsummary_string. - Installed/source signatures verified for both public functions:
summary(model, input_size, batch_size=-1, device=torch.device("cuda:0"), dtypes=None)summary_string(model, input_size, batch_size=-1, device=torch.device("cuda:0"), dtypes=None)
setup.pydeclarespackages=["torchsummary"]and noinstall_requires, but runtime source imports bothtorchandnumpy.- The implementation creates random synthetic inputs and runs a real forward pass through the supplied
torch.nn.Module; tests are small and safe, but require workingtorchandnumpyimports. - The README begins with a deprecation/migration note recommending the newer
torchinfoproject. Preserve that note when editing docs, and prefer migration advice rather than adding broad new features to this legacy package.
Quick maintainer loop
From the repository root of the checkout being edited:
python - <<'PY'
import inspect
import torchsummary
print(torchsummary.__file__)
print(inspect.signature(torchsummary.summary))
print(inspect.signature(torchsummary.summary_string))
PY
python -m unittest torchsummary.tests.unit_tests.torchsummary_test
If the full unit module fails, run the focused test IDs in references/testing-and-maintenance.md, fix the smallest behavior boundary that explains the failure, then rerun the focused test and the full unit module.
Do not change casually
Treat the following as compatibility boundaries unless tests, docs, and generated skill references are updated together:
- Public function names, exports, signatures, defaults, return values, and print behavior.
input_sizesemantics: tuple means one input; list of tuples means multiple inputs.- Tuple/list handling for model outputs in the summary table.
- Per-input
dtypesorder and length expectations. - Device behavior, especially the default
cuda:0signature and explicitdevice="cpu"usage on CPU-only hosts. - Printed table columns and totals:
Layer (type),Output Shape,Param #, total/trainable/non-trainable params, and size estimates.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).