xai-org/x-algorithm · error · ValueError

enable_stale_post is unsupported on grpc_recsys, which does

Error message

enable_stale_post is unsupported on grpc_recsys, which does not transport per-post feature arrays (int64/bool/categorical/float)

What it means

The grpc_recsys dataset path builds a PhoenixGrpcDataset which does not transport per-post feature arrays (int64/bool/categorical/float). Setting enable_stale_post=True in mparams for a grpc_recsys config is therefore rejected at dataset construction time.

Source

Thrown at phoenix/xrex/configs/data_feeds.py:229

        history_seq_len=mparams["history_seq_len"],
        candidate_seq_len=mparams["candidate_seq_len"],
        input_vocab_size=mparams["input_vocab_size"],
        num_continuous_actions=mparams["num_continuous_actions"],
        num_negatives_per_example=mparams.get("num_negatives_per_example", 1),
        num_kafka_partitions=1024,
        output_vocab_size=mparams["output_vocab_size"],
        multimodal_embedding_type=mparams.get("multimodal_embedding_type"),
        use_post_sid=use_post_sid,
        sid_num_levels=sid_num_levels,
        compute_post_unexplored_label=mparams.get("compute_post_unexplored_label", False),
        enable_stale_post=mparams.get("enable_stale_post", False),
    )


def _ranking_grpc_recsys(mparams, hash_table, use_post_sid, sid_num_levels, config_name):
    del config_name
    if mparams.get("enable_stale_post", False):
        raise ValueError(
            "enable_stale_post is unsupported on grpc_recsys, which does not transport per-post feature arrays (int64/bool/categorical/float)"
        )
    return PhoenixGrpcDataset(
        hash_table=hash_table,
        history_seq_len=mparams["history_seq_len"],
        candidate_seq_len=mparams["candidate_seq_len"],
        server_address=_GRPC_DATALOADER_ADDRESS,
        input_vocab_size=mparams["input_vocab_size"],
        pad_token=PAD_TOKEN,
        output_vocab_size=mparams["output_vocab_size"],
        num_continuous_actions=mparams["num_continuous_actions"],
        num_negatives_per_example=mparams.get("num_negatives_per_example", 1),
        num_data_loaders=8,
        num_kafka_partitions=1024,
        multimodal_embedding_type=mparams.get("multimodal_embedding_type"),
        use_post_sid=use_post_sid,
        sid_num_levels=sid_num_levels,
    )

View on GitHub (pinned to 24c60942c5)

Solutions

  1. Set enable_stale_post: False (or remove the key — it defaults to False) in the grpc_recsys config's mparams
  2. If stale posts are required, switch dataset_type to a family that transports per-post feature arrays (e.g. aggregated_kafka)
  3. Grep the target dataset class before enabling optional features: confirm the constructor accepts enable_stale_post

Example fix

# before
MODEL_CFGS = {..., "dataset_type": "grpc_recsys", "enable_stale_post": True}

# after
MODEL_CFGS = {..., "dataset_type": "grpc_recsys"}  # enable_stale_post defaults to False
Defensive patterns

Strategy: validation

Validate before calling

def validate_mparams(mparams: dict, dataset_type: str) -> None:
    if dataset_type == "grpc_recsys" and mparams.get("enable_stale_post", False):
        raise SystemExit(
            "enable_stale_post is not supported on grpc_recsys; remove it or switch dataset_type"
        )

Type guard

def supports_stale_post(dataset_type: str) -> bool:
    return dataset_type != "grpc_recsys"

Try / catch

try:
    ds = _make_dataset(mparams, dataset_type, hash_table, config_name)
except ValueError as e:
    if "enable_stale_post" in str(e):
        mparams = {k: v for k, v in mparams.items() if k != "enable_stale_post"}
        ds = _make_dataset(mparams, dataset_type, hash_table, config_name)  # degrade gracefully
    else:
        raise

Prevention

When it happens

Trigger: Building a grpc_recsys dataset (via _ranking_grpc_recsys, typically through the RANKING_DATASET_FACTORIES registry in _make_dataset) with mparams containing enable_stale_post: True.

Common situations: Copying a config block from a kafka/offline dataset family that supports stale posts into a grpc_recsys config; flipping enable_stale_post globally for an experiment without checking per-dataset support; merging config defaults that assume all dataset types share features.

Related errors


AI-assisted analysis of xai-org/x-algorithm@24c60942c5 (2026-08-28). Data as JSON: /api/errors/139823737cd0eafd. Report an issue: GitHub.