sequence-models
Operate DeepCTR DIN, DIEN, DSIN, and BST sequence/session recommendation workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- sequence-models
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Operate DeepCTR DIN, DIEN, DSIN, and BST sequence/session recommendation workflows.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md5.1 KB
- 参考文档references/sequence-inputs.md6.2 KB
- 参考文档references/troubleshooting.md6.9 KB
- 脚本scripts/sequence_tiny_smoke.py8.4 KB
03 SKILL.md 正文
DeepCTR Sequence Models
Use this sub-skill when a task involves DeepCTR's sequence/session recommender models: DIN, BST, DIEN, or DSIN. It is specialized for input naming, sequence/session feature construction, attention/GRU caveats, and tiny synthetic smoke checks.
DeepCTR facts to preserve in downstream work: DeepCTR is a TensorFlow/Keras CTR/recommender package imported as deepctr; this skill targets DeepCTR 0.9.4. TensorFlow is a separate dependency. Use public tensorflow.keras APIs in new code.
Start Here
- Read references/sequence-inputs.md for exact input dictionaries,
hist_/sess_field names, padding,seq_length/sess_length, and embedding sharing examples. - Read references/api-reference.md for model constructor signatures and version-sensitive parameters.
- Read references/troubleshooting.md when a sequence model builds with wrong history behavior, has missing length inputs, fails on Dice/GRU/session shapes, or produces masking surprises.
- Use scripts/sequence_tiny_smoke.py for a bundled synthetic DIN/BST/DSIN build-fit-predict smoke check that does not require external data.
Model Selection Router
- Use DIN when each row has a candidate item/category and one flat padded history sequence; attention matches candidate behavior features to
hist_history fields. - Use BST when the same DIN-style
hist_history should be processed through Transformer layers before attention; includeseq_length. - Use DIEN when the task is interest evolution over a history sequence, especially GRU variants or auxiliary negative-sampling loss; treat full DIEN training as legacy/version-sensitive.
- Use DSIN when history is already split into multiple sessions; the model does not split raw event streams and requires
sess_<index>_<feature>fields plussess_length.
Boundary Routes
- For generic
SparseFeat,DenseFeat,VarLenSparseFeat, hashing, weighted sequences, or feature validation unrelated to DIN/BST/DIEN/DSIN naming, route todata-and-feature-columns. - For model
compile,fit, callbacks, save/load, custom objects, prediction, and TensorFlow environment management, route tokeras-model-workflows. - For multitask learning and TensorFlow Estimator workflows, route to their separate DeepCTR skill areas.
Critical Checks Before Building
- DIN/BST/DIEN: every behavior feature name in
history_feature_listmust have a matching history field named exactlyhist_+ feature name, for exampleitem_id->hist_item_id. - BST and DIEN require a
seq_lengthinput; setlength_name="seq_length"on historyVarLenSparseFeatcolumns and includex["seq_length"]. - DSIN: for every session index
0..sess_max_count-1and every behavior feature, includesess_<index>_<feature>and includex["sess_length"]. - Use
0only for padding in behavior sequence/session id arrays; encode valid behavior ids from1upward and setvocabulary_size >= max_id + 1. - Share candidate/history embeddings with
embedding_name, for exampleSparseFeat("hist_item_id", ..., embedding_name="item_id"), and keep shared vocabulary size, embedding dimension, and trainability compatible. - On newer TensorFlow versions, prefer
att_activation="sigmoid"for DIN/DIEN smoke/debug runs;diceis the DeepCTR default but more version-sensitive.
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).