data-model-setup
Prepare and validate DINO's COCO-style inputs, model/config shapes, and CUDA deformable-attention backend before training or evaluation.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- data-model-setup
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Prepare and validate DINO's COCO-style inputs, model/config shapes, and CUDA deformable-attention backend before training or evaluation.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/data-formats.md6.8 KB
- 参考文档references/environment.md6.1 KB
- 参考文档references/model-architecture.md6.7 KB
- 参考文档references/troubleshooting.md7.1 KB
- 脚本scripts/check_dino_environment.py10.7 KB
- 脚本scripts/validate_coco_layout.py16.5 KB
03 SKILL.md 正文
DINO data and model setup
Use this route before a DINO training or evaluation run when the dataset, model configuration, or compiled backend is new, changed, or suspect. It builds no dataset and does not launch training, inference, or evaluation.
Route and gates
-
Environment gate. Run
scripts/check_dino_environment.pywith the strict requirements appropriate to the requested run. For the standard CUDA DINO path, use:python scripts/check_dino_environment.py --require-cuda \ --require-extension --require-coco --require-runtime --pip-check --jsonIt checks package imports, PyTorch/CUDA visibility,
CUDA_HOME/nvccobservations, theMultiScaleDeformableAttentionimport, and optionallypip check. Add--require-panopticonly for the panoptic branch. Use--smoke-cudaand--smoke-extensiononly when a free visible GPU is available; import/symbol success is not the repository's numerical operator gate. -
Data gate. Run
scripts/validate_coco_layout.pyagainst an existing COCO root. Validate only the requested split(s); add the optional panoptic root only when panoptic data is actually needed. -
Target gate. Confirm the dataset yields the fields and coordinate conventions in data formats, including the
num_classes/category-ID convention and transformedsizeversusorig_size. -
Model gate. Compare the selected config with the backbone, returned feature levels, hidden dimension, attention heads, number of queries, class count, and denoising label-book rules in model architecture.
-
Extension gate. If the model will run its deformable encoder/decoder, compile and run the repository's CUDA operator test as described in environment. A package import alone is not a numerical proof.
Stop on a failed strict gate. Report the exact failed check and apply the corresponding recovery in troubleshooting rather than silently falling back to an incompatible backend.
Operating procedure
- Treat
coco_pathas a read-only input to this route. The standard instance layout istrain2017/,val2017/, andannotations/; the expected JSON names areinstances_train2017.jsonandinstances_val2017.json. The test split usestest2017/andimage_info_test-dev2017.jsonwhen requested. - Validate annotation references and image filenames before importing the
dataset loader. Do not use the repository's optional
DATA_COPY_SHILONGpath here: its helper removes/recreates paths and is outside this skill's safety boundary. - For a custom dataset, decide the maximum category ID and config class
convention together. This repository's
num_classesis a classifier width / maximum-object-ID-plus-one convention, not simply the count of category names. Recheckdn_labelbook_sizeafter changing it. - Confirm transforms are appropriate for the run. Training uses random flip,
multiscale resize and a random crop branch; validation/evaluation uses a
deterministic largest configured resize followed by normalization. The
resulting boxes are normalized
(center_x, center_y, width, height). - Compile the extension only after confirming a CUDA-enabled PyTorch, a matching toolkit, a compatible host compiler (use GCC <= 12 when required by the toolkit), valid CUDA and CCCL include directories, and a free GPU. Keep build outputs in the normal build area; this route provides no cleanup, copy, download, or deletion helper.
- Route training launches, optimizer/scheduler settings, and checkpoints to the parent skill's training route. Route prediction, post-processing, and COCO/panoptic evaluation to its inference/evaluation route. This sub-skill supplies their setup facts only.
Expected handoff
Record the following for the next route: validated root and split(s), JSON files checked, image/annotation counts and warnings, whether masks/panoptic paths were checked, config name and salient shape settings, package/CUDA observations, extension import and numerical-test status, and unresolved backend limitations. Never record private machine prefixes, private dataset locations, or credentials.
References
- COCO data formats and targets
- DINO model architecture and compatibility
- Environment installation and extension build
- Troubleshooting and recovery
Scope and limitations
This is a preparation and validation route. It deliberately excludes dataset
acquisition, checkpoint acquisition, training/evaluation launch commands,
checkpoint surgery, destructive copy helpers, and claims that a CPU execution
is an equivalent substitute for DINO's CUDA multi-scale deformable attention.
The supplied scripts are read-only except for their --fixture mode, which
creates and removes only a temporary self-test fixture.
Evidence provenance
This skill was distilled from the repository README installation/data sections;
requirements.txt; datasets/coco.py, coco_panoptic.py, transforms.py,
dataset.py, and data_util.py; the deformable-attention setup, test,
function, and module files under models/dino/ops/; models/dino/backbone.py,
deformable_transformer.py, and dino.py; util/slconfig.py; all
config/DINO/*.py; tools/README.md; and the verified environment report
for this repository. The report established a successful CUDA extension build
and import, COCO dependency imports, and pip check; it did not establish a
full training or evaluation result.
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).