microsoft/VibeVoice · error · ValueError

missing `sample` as a required keyword argument

Error message

 missing `sample` as a required keyword argument

What it means

`_dpm_solver_first_order_update` (the single-step DPM-Solver update) needs the current `sample`; it checks the keyword, then args[2], then raises this ValueError. It is an internal method invoked by `step()` — hitting it means direct/subclass invocation dropped the sample argument. Standard pipeline usage cannot trigger it.

Source

Thrown at vibevoice/schedule/dpm_solver.py:654

        One step for the first-order DPMSolver (equivalent to DDIM).

        Args:
            model_output (`torch.Tensor`):
                The direct output from the learned diffusion model.
            sample (`torch.Tensor`):
                A current instance of a sample created by the diffusion process.

        Returns:
            `torch.Tensor`:
                The sample tensor at the previous timestep.
        """
        timestep = args[0] if len(args) > 0 else kwargs.pop("timestep", None)
        prev_timestep = args[1] if len(args) > 1 else kwargs.pop("prev_timestep", None)
        if sample is None:
            if len(args) > 2:
                sample = args[2]
            else:
                raise ValueError(" missing `sample` as a required keyword argument")
        if timestep is not None:
            deprecate(
                "timesteps",
                "1.0.0",
                "Passing `timesteps` is deprecated and has no effect as model output conversion is now handled via an internal counter `self.step_index`",
            )

        if prev_timestep is not None:
            deprecate(
                "prev_timestep",
                "1.0.0",
                "Passing `prev_timestep` is deprecated and has no effect as model output conversion is now handled via an internal counter `self.step_index`",
            )

        sigma_t, sigma_s = self.sigmas[self.step_index + 1], self.sigmas[self.step_index]
        alpha_t, sigma_t = self._sigma_to_alpha_sigma_t(sigma_t)
        alpha_s, sigma_s = self._sigma_to_alpha_sigma_t(sigma_s)
        lambda_t = torch.log(alpha_t) - torch.log(sigma_t)

View on GitHub (pinned to 94da20d98b)

Solutions

  1. Pass sample: `scheduler._dpm_solver_first_order_update(model_output, sample=sample)` (timestep args are deprecated no-ops).
  2. Prefer relying on the public `step()` which supplies sample internally.
  3. In overrides, forward `sample=sample` explicitly rather than relying on positional order.

Example fix

# before
prev = sched._dpm_solver_first_order_update(mo, t, t_prev)

# after
prev = sched._dpm_solver_first_order_update(mo, sample=sample)
Defensive patterns

Strategy: validation

Validate before calling

assert sample is not None, "sample tensor is required"
prev = scheduler._dpm_solver_first_order_update(model_output, sample=sample)

Type guard

import torch

def has_sample(sample) -> bool:
    return isinstance(sample, torch.Tensor)

Prevention

When it happens

Trigger: Calling `scheduler._dpm_solver_first_order_update(model_output, timestep, prev_timestep)` without `sample=...`, or a custom `step()` override forwarding only two positional args.

Common situations: Custom scheduler subclasses for batched audio tokens; research code reimplementing step() but reusing the first-order update helper.

Related errors


AI-assisted analysis of microsoft/VibeVoice@94da20d98b (2026-08-15). Data as JSON: /api/errors/0e69796fdd3fb732. Report an issue: GitHub.