xai-org/x-algorithm · error · ValueError

Unknown {dataset_type=}, must be one of {DATASET_TYPES}

Error message

Unknown {dataset_type=}, must be one of {DATASET_TYPES}

What it means

The gen-recs config's _make_dataset match over dataset_type fell through every case (registry lookup included), so the requested dataset type is not supported by this model family. The error lists the valid DATASET_TYPES for reference.

Source

Thrown at phoenix/xrex/configs/xrecsys_gen_recs.py:133

                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_kafka_partitions=mparams.get("num_kafka_partitions", 2048),
                output_vocab_size=mparams["output_vocab_size"],
                num_negatives_per_example=0,
                include_candidate_post_ids=True,
                multimodal_embedding_type="v5",
                offline_embedding_table_dir=offline_artifacts_dir,
                filter_candidates_require_embedding=True,
                date_range=date_range,
                num_global_negatives_per_example=num_global_negatives,
                candidate_negative_filter=candidate_negative_filter,
                candidate_negative_mode=candidate_negative_mode,
                **offline_kwargs,
            )
        case _:
            raise ValueError(f"Unknown {dataset_type=}, must be one of {DATASET_TYPES}")


MODEL_CFGS = {
    "xrecsys_gen_recs": _make_cfg(
        {
            "history_seq_len": 1023,
            "candidate_seq_len": 128,
            "num_layers": 8,
            "emb_size": 2560,
            "emb_table_width": 1024,
            "query_heads": 20,
            "kv_heads": 4,
            "base_batch_size": 32,
            "bs_per_device": 128,
            "ep": 512,
            "dp": 2,
            "total_samples": 1e11,
            "group_id": "gen_recs_xrecsys",

View on GitHub (pinned to 24c60942c5)

Solutions

  1. Check DATASET_TYPES in xrecsys_gen_recs and use one of its exact values
  2. If you copied a config from another model family, replace dataset_type with one valid for gen-recs (or use that family's config module)
  3. Register a custom dataset factory in config_registry if it should be supported
  4. Verify spelling and case — matching is exact

Example fix

# before
mparams = {"dataset_type": "ranking_kafka"}

# after
mparams = {"dataset_type": "aggregated_kafka"}  # a DATASET_TYPES member for this family
Defensive patterns

Strategy: validation

Validate before calling

from phoenix.xrex.configs import xrecsys_gen_recs

def validate_dataset_type(dataset_type: str) -> None:
    if dataset_type not in xrecsys_gen_recs.DATASET_TYPES:
        raise SystemExit(
            f"Invalid dataset_type {dataset_type!r} for gen_recs; valid: {xrecsys_gen_recs.DATASET_TYPES}"
        )

Type guard

def is_gen_recs_dataset_type(dataset_type: str) -> bool:
    return dataset_type in DATASET_TYPES

Try / catch

try:
    ds = _make_dataset(mparams, dataset_type, hash_table, config_name)
except ValueError as e:
    if "dataset_type" in str(e):
        raise SystemExit("dataset_type not supported by this model family") from e
    raise

Prevention

When it happens

Trigger: Calling _make_dataset in xrecsys_gen_recs with a dataset_type outside DATASET_TYPES / the registry — e.g. passing a ranking-family type like 'aggregated_kafka' to the generative-recs model, or a typo such as 'offline_kafka_dump'.

Common situations: Mixing config blocks between model families (ranking vs gen-recs) that support different dataset types; renaming of dataset types between versions; typo/case mismatch in the config string.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


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