huggingface/transformers · error · ValueError

Unknown logit_processor_kwargs: {unknown_keys}. {self.suppor

Error message

Unknown logit_processor_kwargs: {unknown_keys}. {self.supported_keys = } and {self.ignored_keys = }If you expect a key to not be ignored, make sure its default value (in the generation config) is not None. Eg. if temperature is None or 1.0 at creation time, no processor will be created for temperature

What it means

Raised by CB logits-processor check_kwargs when logit_processor_kwargs contains keys that are neither in supported_keys nor in ignored_keys. supported_keys only contains processors that were actually instantiated, which depends on the generation config defaults: if a param like temperature defaults to None or 1.0, no processor exists for it and passing it is treated as unknown.

Source

Thrown at src/transformers/generation/continuous_batching/cb_logits_processors.py:171

            return None
        # Validate types for supported keys, detect unsupported keys
        problematic_keys = set()
        for key, value in kwargs.items():
            if key not in self.supported_keys:
                problematic_keys.add(key)
            else:
                expected_type = self.supported_keys[key]
                if not isinstance(value, expected_type):
                    raise TypeError(
                        f"logit_processor_kwargs['{key}'] has type {type(value).__name__}, expected {expected_type.__name__}"
                    )
        # Stop if there are only supported keys
        if not problematic_keys:
            return
        # Check if there are unknown keys
        unknown_keys = problematic_keys - self.ignored_keys
        if unknown_keys:
            raise ValueError(
                f"Unknown logit_processor_kwargs: {unknown_keys}. {self.supported_keys = } and {self.ignored_keys = }"
                "If you expect a key to not be ignored, make sure its default value (in the generation config) is not "
                "None. Eg. if temperature is None or 1.0 at creation time, no processor will be created for temperature"
            )
        # If there are none, throw a warning about the ignored keys
        logger.warning(
            f"Ignored logit_processor_kwargs: {problematic_keys}. {self.supported_keys = } and {self.ignored_keys = }"
        )

    def fill_defaults(self, int32_tensor: torch.Tensor) -> None:
        """Fills the given tensor int32 tensor with the default values for this processor."""
        i = 0
        for processor in self.logits_processor:
            if isinstance(processor, ContinuousBatchingLogitsProcessor):
                processor.fill_defaults(int32_tensor[i])
                i += 1

    def prepare_tensor_args(

View on GitHub (pinned to a597f97485)

Solutions

  1. Set the parameter in the GenerationConfig (e.g. model.generation_config.temperature = 0.8) before creating the manager so the processor gets created
  2. Remove the offending key from logit_processor_kwargs — the message prints supported_keys and ignored_keys, use them
  3. Construct GenerationConfig(temperature=..., top_p=...) at model load time rather than relying on call-time kwargs

Example fix

# before
model.generation_config = GenerationConfig(do_sample=False)  # temperature stays None
kwargs = {"temperature": 0.8}

# after
model.generation_config = GenerationConfig(do_sample=True, temperature=1.0)
kwargs = {"temperature": 0.8}
Defensive patterns

Strategy: validation

Validate before calling

gc = model.generation_config
# make sure processors exist for the sampling params you plan to pass
if 'temperature' in my_kwargs and (gc.temperature is None or gc.temperature == 1.0):
    gc.temperature = 1.0  # non-None default creates the processor

Try / catch

try:
    manager = model.continuous_batching(logit_processor_kwargs=lpk)
except ValueError as e:
    if 'Unknown logit_processor_kwargs' in str(e):
        for k in list(lpk):
            setattr(model.generation_config, k, lpk[k])  # create the processors
        manager = model.continuous_batching(logit_processor_kwargs=lpk)
    else:
        raise

Prevention

When it happens

Trigger: Passing logit_processor_kwargs={'top_p': 0.9} while the GenerationConfig has top_p=1.0 (no top_p processor created), so 'top_p' is not in supported_keys and not in ignored_keys. Same for any sampling param whose default disabled its processor.

Common situations: Enabling sampling via kwargs at call time while the generation config was created with greedy defaults; upgrading versions where the supported-keys registry changed; mixing HF generate kwargs with logit_processor_kwargs.

Related errors


AI-assisted analysis of huggingface/transformers@a597f97485 (2026-08-14). Data as JSON: /api/errors/32e20bbf8e42bae3. Report an issue: GitHub.