evaluation-and-optimization
Guide AdalFlow evaluation metrics, datasets, parameters, gradients, prompt/few-shot/text-grad optimization, AdalComponent, Trainer, and optimize_anything workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- evaluation-and-optimization
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guide AdalFlow evaluation metrics, datasets, parameters, gradients, prompt/few-shot/text-grad optimization, AdalComponent, Trainer, and optimize_anything workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/datasets-and-benchmarks.md6.2 KB
- 参考文档references/evaluation-metrics.md6.7 KB
- 参考文档references/optimization-and-training.md11.5 KB
- 参考文档references/troubleshooting.md8.6 KB
- 脚本scripts/evaluation_metrics_smoke.py4.0 KB
03 SKILL.md 正文
AdalFlow evaluation and optimization
Use this sub-skill when the user wants to score task outputs, select or load AdalFlow benchmark datasets, make Parameter objects trainable, wrap a task in AdalComponent, run Trainer.diagnose or Trainer.fit, configure few-shot/text-gradient optimizers, or use optimize_anything for bounded text-artifact search.
Route boundaries
Stay here for:
AnswerMatchAcc,RetrieverEvaluator, and cautiousLLMasJudgeevaluation.- Dataset loaders for GSM8K, TREC, HotpotQA, and BBH-style tasks, including small-size and skip-expensive guidance.
Parameter,ParameterType,GradComponent,EvalFnToTextLoss,LLMAsTextLoss,BootstrapFewShot,TGDOptimizer,AdalComponent,Trainer, andoptimize_anythingworkflows.
Route away instead of duplicating guidance:
- RAG construction, document splitting, local/vector retrievers, and index pipelines: use
retrieval-rag-and-data-pipelines. - Provider model-client configuration, credentials,
Generator, and fake provider clients: usemodel-client-and-generator-workflows. - Tracing/logging artifacts and callback storage: use
tracing-observability-and-configuration.
Reference map
- Evaluation metrics: metric APIs, input shapes, output objects, and no-network smoke examples.
- Optimization and training:
Parameter/gradient concepts,AdalComponentcontracts,Trainer.fit/diagnose, few-shot/text-gradient optimizer setup, andoptimize_anything. - Datasets and benchmarks: loader classes, fields, optional dependencies, downloads, and benchmark constraints.
- Troubleshooting: evaluator shape errors, metric extras, dataset misses, checkpoint/resume, validation-set requirements, provider cost, runtime limits, and multiprocessing issues.
- Metric smoke script: service-free exact/fuzzy/F1/retriever metric check.
Safe operating defaults
- Score before optimizing. Build a deterministic metric with
AnswerMatchAccorRetrieverEvaluatorand run a tiny local smoke case before any model-backed judge or optimizer. - Treat live judging and text gradients as expensive.
LLMasJudge,LLMAsTextLoss, backward engines, teacher generators, andTGDOptimizercan invoke model providers. Require explicit provider setup, credentials, budget, sample limits, and cache/checkpoint choices. - Use bounded data. Dataset loaders may download external data and optional packages. Prefer
size=...or pre-existing local data for first tests. - Make
AdalComponentcontracts explicit.prepare_taskreturns(callable, kwargs)for one sample;prepare_evalreturns(eval_fn, kwargs)for inference scoring;prepare_lossreturns(loss_fn, kwargs)withParameterinputs and correcteval_inputvalues. - Prefer diagnosis before training.
Trainer.diagnoseis useful for identifying failing samples and prompt/output issues. Usenum_workers=1for minimal debugging, then raise concurrency only after stable. - Do not imply full benchmark training is safe. Benchmark scripts and full prompt optimization runs are optional, network/provider/dataset dependent, and should be reduced to a tiny user-approved run before scaling.
Minimal decision checklist
- What is being scored: final answer strings, structured labels, retrieved contexts/IDs, or model-judged quality?
- Is the metric service-free, optional-package-backed, or provider-backed?
- Are predictions raw values,
GeneratorOutput.data, orParameter.full_response.data? - Are trainable values marked with the right
ParameterType(PROMPTfor instructions,DEMOSfor examples)? - Does the training data provide stable
idfields and a real validation set? - What are the maximum samples, optimizer steps, worker count, and checkpoint/resume plan?
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).