snorkel
Operate Snorkel weak-supervision, data transform, classification, and slicing workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- snorkel
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Operate Snorkel weak-supervision, data transform, classification, and slicing workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/installation-and-optional-dependencies.md3.4 KB
- 参考文档references/repo-provenance.md1.8 KB
- 参考文档references/repo-routing-metadata.json406 B
- 参考文档references/troubleshooting.md4.0 KB
- 脚本scripts/check_snorkel_install.py3.6 KB
03 SKILL.md 正文
Snorkel
Use this repo skill when the task is about the installed Snorkel Python package:
- programmatic labels and weak supervision
- labeling functions, label matrices, LF analysis, and label models
- data-point mappers, preprocessors, spaCy preprocessing, and augmentation transforms
- PyTorch-backed Snorkel datasets, task graphs, classifiers, trainers, loggers, and metrics
- slicing functions, slice monitoring, and slice-aware classifiers
- optional Dask, local Spark, or spaCy paths owned by Snorkel APIs
Do not use this skill for generic PyTorch training, general Spark cluster administration, spaCy pipeline training unrelated to Snorkel preprocessors, cleanlab label-quality auditing, or source-repository maintenance unless the user explicitly names Snorkel APIs.
Quick install check
Snorkel requires Python >=3.11.
pip install snorkel
python scripts/check_snorkel_install.py
Optional paths:
python scripts/check_snorkel_install.py --check-spacy-model
python scripts/check_snorkel_install.py --check-spark
Read references/installation-and-optional-dependencies.md before adding Dask, spaCy, Spark, or TensorBoard-related dependencies.
Route by task
| User intent or signal | Read next | Why |
|---|---|---|
LabelingFunction, labeling_function, LFApplier, PandasLFApplier, LabelModel, weak labels, label matrix L, LF coverage/overlap/conflict, majority voters |
sub-skills/labeling/SKILL.md |
Owns programmatic labels and label-model workflows. |
Mapper, lambda_mapper, preprocessor, SpacyPreprocessor, TransformationFunction, TFApplier, augmentation policy, synthetic label matrix |
sub-skills/data-transforms/SKILL.md |
Owns data-point transforms that support labeling, slicing, and augmentation. |
DictDataset, DictDataLoader, Operation, Task, MultitaskClassifier, Trainer, Scorer, metrics, checkpointing, TensorBoard, soft-label training |
sub-skills/classification/SKILL.md |
Owns discriminative model, trainer, logging, and evaluation APIs. |
SlicingFunction, SFApplier, slice_dataframe, add_slice_labels, convert_to_slice_tasks, SliceAwareClassifier, score_slices |
sub-skills/slicing/SKILL.md |
Owns slice creation, slice labels, and slice-aware modeling. |
Common cross-workflow paths
Weak supervision to classifier training
- Use
labelingto define LFs and produce anLmatrix. - Use
labelingto inspectLFAnalysisand fitLabelModelor a voter. - Use
labelingto filter unlabeled rows. - Use
classificationto buildDictDataset/DictDataLoaderwith hard or probabilistic labels. - Use
classificationto train/evaluate aMultitaskClassifierorTrainer.
Text labeling or slicing with spaCy
- Use
data-transformsforSpacyPreprocessordetails and model setup. - Use
labelingforNLPLabelingFunctionorspark_nlp_labeling_function. - Use
slicingforNLPSlicingFunctionornlp_slicing_function. - Use root troubleshooting if the model or language package cannot load.
Slice-aware classification
- Use
slicingto create SFs and anSrecarray. - Use
classificationto understand the baseTask, module pool, and tensor dataset. - Use
slicingto create slice labels andSliceAwareClassifierdataloaders. - Use
classificationorslicingscoring depending on whether the user wants overall metrics or slice-specific metrics.
References and scripts
- Source snapshot and refresh baseline:
references/repo-provenance.md - Router metadata for managed imports:
references/repo-routing-metadata.json - Installation and optional dependencies:
references/installation-and-optional-dependencies.md - Cross-cutting troubleshooting:
references/troubleshooting.md - Root install checker:
scripts/check_snorkel_install.py
Validation approach
Start with the smallest safe check:
- Run the root install checker.
- Run the nearest sub-skill smoke script.
- If optional Dask, spaCy, or Spark paths are involved, verify those optional dependencies before blaming Snorkel code.
- For full native behavior checks, use the review artifacts produced during skill creation rather than adding source-checkout assumptions to runtime instructions.
Operational caveats
- Snorkel uses
-1as the abstain label across weak-label and metric helpers. LabelModelrequires at least three labeling functions and a label matrix consistent with the configured cardinality.DictDatasetlabels must betorch.Tensorvalues.SliceAwareClassifierandSliceCombinerModuleare binary-only in this version.- Spark coverage in this skill is local Spark wrapper behavior, not production cluster deployment.
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).