repo-development
Maintain the einops repository safely: focused tests, backend/env selection, docs and notebook checks, formatting/type checking, CI matrix interpretation, release boundaries, and staleness refresh cues.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- repo-development
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Maintain the einops repository safely: focused tests, backend/env selection, docs and notebook checks, formatting/type checking, CI matrix interpretation, release boundaries, and staleness refresh cues.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/docs-and-tests.md9.9 KB
- 参考文档references/maintainer-troubleshooting.md9.4 KB
- 脚本scripts/convert_readme_for_docs.py2.0 KB
- 脚本scripts/notebook_execution_check.py3.3 KB
- 脚本scripts/run_selected_einops_tests.py4.1 KB
03 SKILL.md 正文
repo-development
Use this sub-skill when the task is about maintaining the einops repository rather
than writing package-usage recipes. It covers development commands, backend-aware
test selection, docs/notebook checks, README-to-docs conversion, CI interpretation,
packaging boundaries, and refresh/staleness checks.
For tensor operation patterns, API examples, framework-specific user code, or
named einsum/packing recipes, route to sibling sub-skills such as
tensor-operations, named-einsum-and-packing, or framework-integrations.
Evidence scope
This guidance was distilled from these source-evidence names: README.md
Development section, pyproject.toml, einops/tests/run_tests.py,
einops/tests/__init__.py, scripts/convert_readme.py,
scripts/test_notebooks.py, scripts/pytorch_examples_source/converter.py,
.github/workflows/run_tests.yml, .github/workflows/test_notebooks.yml,
.github/workflows/deploy_docs.yml, .github/workflows/deploy_to_pypi.yml, and
mkdocs.yml.
Do not depend on machine-local checkout paths or environment-specific details. Prefer the bundled references and scripts below; if repository development files or workflows have changed since this skill was produced, perform a repo-skill refresh before relying on stale commands.
Quick routing
| Maintainer intent | Use this guidance |
|---|---|
| Run minimal package tests without installing all frameworks | references/docs-and-tests.md and scripts/run_selected_einops_tests.py |
Interpret EINOPS_TEST_BACKENDS or framework names |
references/docs-and-tests.md |
| Format, lint, or type-check changes | references/docs-and-tests.md |
| Build or serve documentation | references/docs-and-tests.md |
| Convert README content into docs index safely | scripts/convert_readme_for_docs.py |
| Check notebook dependencies or execute selected tutorials | references/docs-and-tests.md and scripts/notebook_execution_check.py |
| Understand CI matrix coverage | references/docs-and-tests.md |
| Avoid unsafe deploy/publish steps | references/docs-and-tests.md |
| Diagnose common maintainer failures | references/maintainer-troubleshooting.md |
Safe command patterns
- Tests are distributed with the package. Use the native runner for broad checks:
python -m einops.tests.run_tests numpy. - Include
numpywith backend tests unless intentionally investigating a symbolic-only case; the README says every framework is tested against numpy. - Omit
--pip-installwhen dependencies are already installed. That flag usespip installin the current environment. - For a dry-run plan or a focused pytest node, use the bundled wrapper:
python scripts/run_selected_einops_tests.py numpy --pytest-target test_ops.py::test_repeat_numpy. Add--executeonly when ready to run. - For check-only style validation, prefer CI-like non-mutating commands:
ruff check .,ruff format . --check, andmypy .in an environment with the default development dependencies. - The Hatch
checkscript inpyproject.tomlis intentionally mutating: it runsruff format,ruff check --fix, thenmypy.
Backend selection rules
- Native runner synonyms:
pytorch->torch,tf->tensorflow, andpaddlepaddle->paddle. - Exact backend names are comma-joined in
EINOPS_TEST_BACKENDS, for exampleEINOPS_TEST_BACKENDS=numpy,torch. - Missing
EINOPS_TEST_BACKENDSis an error for tests that call the package test utilities directly. The native runner and bundled wrapper set it for you. - Optional frameworks can conflict in one environment, especially TensorFlow, OneFlow, and Paddle protobuf stacks. Use a smaller backend set or a fresh environment instead of repairing a shared environment blindly.
Docs and notebook safety
hatch run docs:buildandhatch run docs:servefirst convert README content into the docs index, so they can mutate generated docs content.- Use
scripts/convert_readme_for_docs.py --readme README.md --output docs_src/index.mdfor a dry-run preview; add--executeonly when the mutation is intended. - Notebook execution needs notebook tooling plus runtime frameworks. CI installs
nbformat,nbconvert,jupyter,pillow,pytest,numpy,tensorflow, and CPUtorchbefore running notebook tests. - Use
scripts/notebook_execution_check.pyto list missing dependencies and, if approved, execute named notebooks with--executeand a bounded timeout.
CI and release boundaries
- Test CI runs Python 3.10, 3.11, and 3.13 for the main backend bundle
numpy pytorch tensorflow jax mlx.core, pluspytensoron Python 3.10 and 3.13. - CI ruff compliance uses a check-only form:
ruff check .andruff format . --check. - Docs deploy is a GitHub workflow with repository write permission and a force deploy command. Treat it as credentialed infrastructure, not a local maintainer default.
- PyPI deploy is triggered by a GitHub release and uses
UV_PUBLISH_TOKENfrom a secret. Localuv publishcommands are outside this sub-skill except as a boundary warning. - Safe packaging inspection may run build-only commands in an isolated release rehearsal, but never run credentialed publish/deploy steps unless the human maintainer explicitly owns the credentials and authorizes that action.
Refresh and staleness cues
Refresh this sub-skill if any of these maintainer surfaces change: supported
Python version, Hatch envs or scripts, native test runner semantics, backend
synonyms, EINOPS_TEST_BACKENDS parsing, notebook execution script, README docs
conversion, mkdocs configuration, CI matrices, or docs/PyPI deploy workflows.
Bundled files
- references/docs-and-tests.md: command matrix, backend semantics, docs/notebook workflow, CI notes, and deploy boundaries.
- references/maintainer-troubleshooting.md: failure diagnosis for backends, environments, docs mutation, notebooks, and release credentials.
- scripts/run_selected_einops_tests.py: safe dry-run wrapper around native package tests with optional focused pytest targets.
- scripts/convert_readme_for_docs.py: dry-run-first README-to-docs converter adapted from the repository script.
- scripts/notebook_execution_check.py: dependency checker and optional bounded notebook executor.
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).