sgl-project/sglang · error · NotImplementedError

manually stop is only supported yet

Error message

manually stop is only supported yet

What it means

Companion stub to manual_start: manual_stop raises NotImplementedError because only the automatic stop path is implemented in this profiler implementation.

Source

Thrown at python/sglang/srt/utils/profile_utils.py:142

            with_stack=with_stack,
            record_shapes=record_shapes,
            output_dir=output_dir,
            output_prefix=profile_prefix,
            profile_id=profile_id,
        )

        self.stage_based_trigger.configure(
            num_steps=num_steps,
            interesting_stages=profile_stages or ["prefill", "decode"],
        )

        return ProfileReqOutput(success=True, message="Succeeded")

    def manual_start(self):
        raise NotImplementedError("manually start is only supported yet")

    def manual_stop(self):
        raise NotImplementedError("manually stop is only supported yet")

    def _do_start(self, stage: Optional[str] = None):
        logger.info(
            f"Profiling starts{f' for {stage}' if stage else ''}. "
            f"Traces will be saved to: {self.profiler_kwargs['output_dir']} "
            f"(with profile id: {self.profiler_kwargs['profile_id']})",
        )

        assert self.profiler is None
        # Fold the per-phase c_/g_ aggregates into the step span while this
        # stage's profile is active (v2 auto-start path; reset in _do_stop).
        set_detailed_annotations_enabled(self.detailed_annotations)
        self.profiler = _ProfilerBase.create(
            **self.profiler_kwargs,
            ps=self.ps,
            cpu_group=self.cpu_group,
            first_rank_in_node=self.first_rank_in_node,
            output_suffix=f"-{stage}" if stage else "",

View on GitHub (pinned to 0132848349)

Solutions

  1. Use the automatic stop flow (default _stop_profile)
  2. Upgrade sglang and check whether manual stop landed
  3. Catch NotImplementedError in tooling and degrade gracefully

Example fix

# before
profiler.manual_stop()
# after
result = await profiler.stop()  # automatic path
Defensive patterns

Strategy: fallback

Validate before calling

null

Type guard

null

Try / catch

try:
    profiler.manual_stop()
except NotImplementedError:
    await profiler.stop()

Prevention

When it happens

Trigger: A /stop_profile request in manual mode, or direct profiler.manual_stop() calls.

Common situations: Clients that started profiling automatically but attempt a manual stop; scripts assuming start/stop symmetry that doesn't exist yet.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/aed8a808bde8219a. Report an issue: GitHub.