code: def _preempt(
      self,
      seq_group: SequenceGroup,
      blocks_to_swap_out: Optional[Dict[int, int]] = None,
      preemption_mode: Optional[PreemptionMode] = None,
  ) -> None:
      # If preemption mode is not specified, we determine the mode as follows:
      # We use recomputation by default since it incurs lower overhead than
      # swapping. However, when the sequence group has multiple sequences
      # (e.g., beam search), recomputation is not currently supported. In
      # such a case, we use swapping instead.
      # FIXME(woosuk): This makes our scheduling policy a bit bizarre.
      # As swapped sequences are prioritized over waiting sequences,
      # sequence groups with multiple sequences are implicitly prioritized
      # over sequence groups with a single sequence.
      # TODO(woosuk): Support recomputation for sequence groups with multiple
      # sequences. This may require a more sophisticated CUDA kernel.
      if preemption_mode is None:
          if seq_group.get_max_num_running_seqs() == 1:
              preemption_mode = PreemptionMode.RECOMPUTE
          else:
              preemption_mode = PreemptionMode.SWAP
      if preemption_mode == PreemptionMode.RECOMPUTE:
          self._preempt_by_recompute(seq_group)
      elif preemption_mode == PreemptionMode.SWAP:
          self._preempt_by_swap(seq_group, blocks_to_swap_out)
      else:
          raise AssertionError("Invalid preemption mode.")
  
imports: import enum
  import time
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  from bigdl.llm.vllm.config import SchedulerConfig
  from bigdl.llm.vllm.core.policy import PolicyFactory
  from bigdl.llm.vllm.logger import init_logger
  from bigdl.llm.vllm.sequence import SequenceData, SequenceStatus
  from bigdl.llm.vllm.sequence import Sequence, SequenceGroup, SequenceGroupMetadata
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 10 for calling the FixedWindowScheduler obj's underlying member method code with example usage: obj._preempt(seq_group, blocks_to_swap_out, preemption_mode) without return types