training-evaluation-and-tuning
Run, evaluate, tune, reload, compare, and troubleshoot RecBole experiments with safe CPU-first workflows.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- training-evaluation-and-tuning
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Run, evaluate, tune, reload, compare, and troubleshoot RecBole experiments with safe CPU-first workflows.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/hyperparameter-tuning.md7.1 KB
- 参考文档references/training-and-evaluation.md10.8 KB
- 参考文档references/troubleshooting.md8.9 KB
- 脚本scripts/recbole_hyperopt_template.py13.9 KB
- 脚本scripts/recbole_save_load_recipe.py6.0 KB
- 脚本scripts/recbole_train_eval_smoke.py10.2 KB
03 SKILL.md 正文
RecBole training, evaluation, and tuning
Use this sub-skill when the user asks how to run or troubleshoot RecBole experiments after the model and dataset/config choices are known. It covers one-model train/evaluate jobs, API smoke tests, grouped model comparisons, checkpoints and save/load, case-study scoring, HyperTuning/Hyperopt/Ray, statistical significance, and CPU/GPU/distributed runtime choices.
Route here for
- "run BPR on ml-100k", "write a
run_recboleconfig", or "make a one-epoch CPU smoke test". - "load a saved RecBole checkpoint", "save dataset/dataloaders", or "get top-k items for a user".
- "tune RecBole hyperparameters", "write a
hyper.testfile", "why did Ray tuning fail?". - "compare two RecBole models statistically", "run repeated seeds", or "interpret valid/test metrics".
- "use GPU", "avoid GPU", "use distributed training", or "what do
nproc/world_size/ip/port/group_offsetmean?".
Do not handle here
- Atomic file schema, field names,
load_col, dataset acquisition, ordata_pathlayout details: route to../configuration-and-data/. - Model-family choice, custom recommender classes, custom trainers, or model registration: route to
../models-and-customization/. - Long benchmark campaigns without an explicit budget. Give a bounded plan first; significance tests, grouped runs, Ray tuning, and full HPO can multiply training cost.
Core public APIs
RecBole exposes these stable routes for this skill:
from recbole.quick_start import run, run_recbole, objective_function, load_data_and_model
run(model, dataset, config_file_list=None, config_dict=None, saved=True,
nproc=1, world_size=-1, ip='localhost', port='5678', group_offset=0)
run_recbole(model=None, dataset=None, config_file_list=None, config_dict=None,
saved=True, queue=None)
objective_function(config_dict=None, config_file_list=None, saved=True)
load_data_and_model(model_file)
At trainer level, the reference methods are:
Trainer.fit(train_data, valid_data=None, verbose=True, saved=True,
show_progress=False, callback_fn=None)
Trainer.evaluate(eval_data, load_best_model=True, model_file=None,
show_progress=False)
Safe default pattern
For a bounded CPU smoke test, prefer:
use_gpu: False- one or a few
epochs show_progress: Falsesaved=Falsewhen no checkpoint is needed- an explicit
checkpoint_dirwhensaved=True - a dedicated working directory so logs/checkpoints are not written into a source checkout by accident
Use the bundled wrapper first when the user wants an executable safe starting point:
python scripts/recbole_train_eval_smoke.py --dry-run-config
python scripts/recbole_train_eval_smoke.py --run --model BPR --dataset ml-100k --epochs 1 --work-dir ./recbole-runs/bpr-smoke
The wrapper imports installed RecBole from the active Python environment and does not rely on a repository checkout.
References and helpers
- Training, evaluation, save/load, case-study, and significance reference
- Hyperparameter tuning, Hyperopt, and Ray reference
- Troubleshooting reference
scripts/recbole_train_eval_smoke.py: CPU-first one-model wrapper aroundrun/run_recbole; no training side effects unless--runis passed.scripts/recbole_hyperopt_template.py: writes and validates HyperTuning parameter files; optional tiny Hyperopt run only with--run.scripts/recbole_save_load_recipe.py: validates a checkpoint path, prints the load/case-study API sequence, and can execute top-k scoring for supplied users.
Workflow outline
- Confirm model, dataset, data path/config file, and budget. If dataset/config details are missing, route to the configuration/data sibling first.
- For smoke runs, use CPU, small epochs,
show_progress=False,saved=False, and a non-checkout--work-dir. - Inspect the result dictionary keys:
best_valid_score,valid_score_bigger,best_valid_result, andtest_result.objective_functionadditionally returnsmodel. - For saved models, set
saved=Truepluscheckpoint_dir, optionallysave_dataset=Trueandsave_dataloaders=True, then reload withload_data_and_model(model_file). - For case studies, convert external user/item tokens with
dataset.token2id, runfull_sort_scoresorfull_sort_topk, and convert item ids back withdataset.id2token. - For HPO, start with a small validated parameter file and
algo='random'/lowmax_evalsunless the user explicitly wants exhaustive search. - For Ray, require absolute
data_pathand absolute fixed config file paths because Ray changes worker working directories. - For significance, run both models on matched seeds and apply a paired t-test to each common metric; warn that repeated training is expensive.
Verification focus cases
Future verification should include at least these synthetic usability cases:
- Create a no-checkpoint one-epoch CPU BPR run that returns valid/test metrics and writes only under a user-chosen run directory.
- Explain and fix a Ray tuning failure caused by relative
data_pathafter Ray changes the working directory tolocal_dir.
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).