AGENT SKILL

data-and-feature-columns

Use this DeepCTR sub-skill for SparseFeat, DenseFeat, VarLenSparseFeat, hashing, embedding sharing, input dictionaries, and tabular or sequence feature-column validation.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
data-and-feature-columns
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use this DeepCTR sub-skill for SparseFeat, DenseFeat, VarLenSparseFeat, hashing, embedding sharing, input dictionaries, and tabular or sequence feature-column validation.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Data and Feature Columns

Use this sub-skill when the task is about preparing DeepCTR inputs before a model is chosen or trained: categorical ids, dense numerical vectors, variable-length sequences, feature hashing, vocabulary files, shared embeddings, and get_feature_names.

When to use this sub-skill

  • The user asks how to create SparseFeat, DenseFeat, or VarLenSparseFeat objects.
  • The user has a tabular CTR/recommender dataset and needs model input dictionaries.
  • The user is debugging missing input keys, bad shapes, string categorical values, sequence padding, length_name, weight_name, or shared embedding errors.
  • The user wants to validate a feature-column plan before routing to Keras, sequence, multitask, or Estimator workflows.

Route map

Minimal workflow

  1. List every raw feature and classify it as one categorical id, a dense scalar/vector, or a variable-length list of categorical ids.
  2. Encode one-id categorical fields as integers and use SparseFeat, or set use_hash=True with dtype="string" when hashing string values on the fly.
  3. Use DenseFeat(name, dimension) for dense vectors; make each input array shape match the declared dimension.
  4. Use VarLenSparseFeat(SparseFeat(...), maxlen=...) for multi-value or sequence ids. Pad every row to (batch_size, maxlen).
  5. Keep 0 reserved for padding when a sequence field relies on masking instead of an explicit length_name.
  6. Use the same embedding_name only when fields truly share one embedding table and have the same vocabulary size, embedding dimension, and trainability.
  7. Call get_feature_names(linear_feature_columns + dnn_feature_columns) and build model_input = {name: array for name in feature_names}.
  8. Route to:

JSON validation helper

For a quick preflight, create a JSON file like:

{
  "features": [
    {"type": "SparseFeat", "name": "item_id", "vocabulary_size": 1001, "embedding_dim": 8},
    {"type": "DenseFeat", "name": "score", "dimension": 1},
    {
      "type": "VarLenSparseFeat",
      "name": "hist_item_id",
      "maxlen": 4,
      "length_name": "seq_length",
      "sparsefeat": {"name": "hist_item_id", "vocabulary_size": 1001, "embedding_dim": 8, "embedding_name": "item_id"}
    }
  ]
}

Then run:

python sub-skills/data-and-feature-columns/scripts/validate_feature_spec.py feature_spec.json

The helper catches common structural mistakes; it does not replace a real TensorFlow model smoke test.

Guardrails

  • Do not use dtype="string" on SparseFeat or VarLenSparseFeat unless use_hash=True or values are pre-encoded.
  • Do not set maxlen to the vocabulary size; maxlen is the number of ids in one row's list.
  • Do not use 0 as a real category id for padded sequence features unless using an explicit length convention that still keeps masking consistent.
  • Do not tell future agents to run source repository examples. Use this skill's bundled references and scripts, then route to the owning workflow sub-skill.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351