scenic
Use Scenic, Google Research's JAX/Flax computer-vision research codebase, for configs, training, datasets, models, layers, baselines, and project-specific workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- scenic
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use Scenic, Google Research's JAX/Flax computer-vision research codebase, for configs, training, datasets, models, layers, baselines, and project-specific workflows.
- disable-model-invocation
- true
02 资源文件 7
- 参考文档references/common-utilities.md1.7 KB
- 参考文档references/installation-and-environment.md4.2 KB
- 参考文档references/repo-provenance.md2.3 KB
- 参考文档references/repo-routing-metadata.json528 B
- 参考文档references/troubleshooting.md5.6 KB
- 脚本scripts/inspect_scenic_package.py6.0 KB
- 脚本scripts/run_scenic_smoke.py4.4 KB
03 SKILL.md 正文
Scenic Repo Skill
Use this skill when a task is about Scenic (google-research/scenic): JAX/Flax vision research experiments, Scenic config files, app/training runners, dataset registry errors, BaseModel/layer APIs, or choosing/adapting a Scenic baseline or project.
Scenic is both a lightweight shared library (common_lib, dataset_lib, model_lib, train_lib) and a large project zoo under scenic.projects. It favors project-level forking/copying for research code and keeps reusable patterns in the shared libraries.
Start here
- If setting up an environment or checking whether Scenic imports, read references/installation-and-environment.md and run scripts/inspect_scenic_package.py.
- If the task names
--config,--workdir,rng_seed,trainer_name,model_name,dataset_name, LR schedules, optimizers, checkpoints, or train launches, use sub-skills/running-and-training/SKILL.md. - If the task is about dataset registration, TFDS, FlexIO, COCO/TFRecord layouts,
DatasetRegistry,@add_dataset, or unknown dataset errors, use sub-skills/data-pipelines/SKILL.md. - If the task is about BaseModel contracts, registered model names, Flax modules, attention/layers, matchers, losses, metrics, or tiny model checks, use sub-skills/modeling-and-layers/SKILL.md.
- If the task asks which Scenic baseline/project to use, how a project-specific
main.py/config/registry works, or which optional dependencies a project needs, use sub-skills/baselines-and-projects/SKILL.md.
Safe core checks
Run these from any environment where Scenic is installed:
python scripts/inspect_scenic_package.py
python scripts/run_scenic_smoke.py
The smoke helper is self-contained: it imports safe modules, checks a tiny JAX calculation, validates LR schedule construction, and lists dataset/model registry names. It does not run training, load datasets, download checkpoints, or execute original repository tests.
For optional trainer-registry import diagnostics:
python scripts/inspect_scenic_package.py --check-trainers
python scripts/run_scenic_smoke.py --check-trainers
A trainer import failure can be an optional transfer/BigTransfer/TensorFlow Addons dependency issue rather than a core package failure. Read references/troubleshooting.md and the running-and-training troubleshooting reference before changing package versions.
Route by user intent
| User intent or signal | Read next |
|---|---|
"How do I run this config?", --config, --workdir, dataset_service_address, JAX backend flags |
running-and-training |
| Validate a config without launching a job | running-and-training and its scripts/scenic_config_probe.py |
Unknown dataset, custom dataset registration, TFDS/FlexIO/COCO/TFRecord data layout |
data-pipelines |
Unrecognized model, model registry names, BaseModel, metrics/losses, matchers/layers |
modeling-and-layers |
| Choose ViT/ResNet/DETR/CLIP/BERT/ViViT/MTV/OWL-ViT/UnLoc/Vid2Seq/DenseVOC/PixelLLM/etc. | baselines-and-projects |
| Optional dependencies such as DMVR, T5/T5X, CLIP/Torch, COCO/LVIS, pycocotools, TensorFlow Addons, BigVision | baselines-and-projects plus root troubleshooting |
| Shared image/video/debug/export helpers | references/common-utilities.md |
| Check whether this generated skill is stale for a checkout | references/repo-provenance.md |
Operating rules
- Do not launch full training/evaluation until config, dataset availability, checkpoint paths, backend devices, and project dependencies are all known.
- Treat CPU smoke checks as validation for API/config guidance only. They do not prove GPU/TPU performance or multi-host correctness.
- Do not install every project
requirements.txt. Pick the project/baseline first, then install the narrow optional dependency set it needs. - Do not run data-conversion tools unless input data, output paths, credentials, side effects, and dependencies are explicitly approved.
- For project-specific models/trainers/datasets, prefer the project
main.pyand project registry pattern instead of assuming the rootscenic.mainregistry knows every project object. - Keep source-code modification and contribution-policy tasks separate from user-facing Scenic experiment use; if the user is editing Scenic itself, verify with focused tests and current project instructions.
Provenance and routing metadata
- Read references/repo-provenance.md before refreshing or trusting this skill for a different Scenic checkout.
- references/repo-routing-metadata.json is the structured router metadata used by the managed repo-skill importer when import is explicitly requested in a later run.
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).