Skip to content

EncoderScheduler silently swallows unknown scheduler_params (typos / precompile_params ignored without warning) #1326

Description

@Rodrian7

Summary

EncoderScheduler.__init__ accepts **kwargs and only reads kwargs.get("tokenizers", "tokenizer"). Every other key passed in is silently discarded. Because stage.py always forwards precompile_params=... plus **scheduler_params to the scheduler constructor, any of the following fail silently for an encoder stage:

  • A typo in the YAML key (e.g. tokenizer instead of tokenizers) falls back to the default "tokenizer" with no warning — the configured value is ignored.
  • precompile_params (and any other key) is absorbed by **kwargs and dropped; it has no effect on the encoder stage at all.

This is not a correctness bug today, but it's a latent foot-gun: a misconfigured text_encoder stage looks like it's honoring the YAML when it isn't.

Evidence

  • python/sgl_jax/srt/multimodal/manager/scheduler/encoder_scheduler.py__init__(..., **kwargs), uses only kwargs.get("tokenizers", "tokenizer").
  • python/sgl_jax/srt/multimodal/manager/stage.py (~L181) — scheduler_class(..., precompile_params=precompile_params, **self.stage_config.scheduler_params) is applied uniformly to all schedulers.

Suggested fix

Validate/observe unexpected kwargs in EncoderScheduler.__init__, e.g.:

known_keys = {"tokenizers"}
unknown = set(kwargs) - known_keys
if unknown:
    logger.warning(
        "EncoderScheduler received unexpected kwargs (ignored): %s", sorted(unknown)
    )

Optionally, audit whether the uniform precompile_params=... forwarding in stage.py makes sense for schedulers that don't consume it.

Context

Spotted during review of #1316 (wan text-encoder rewire to text_encoder scheduler). Not introduced by that PR — pre-existing interface behavior. Filing separately to keep #1316 scoped to the mis-wiring fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions