class_docstr: An LLM engine that receives requests and generates texts.
  
  This is the main class for the vLLM engine. It receives requests
  from clients and generates texts from the LLM. It includes a tokenizer, a
  language model (possibly distributed across multiple GPUs), and GPU memory
  space allocated for intermediate states (aka KV cache). This class utilizes
  iteration-level scheduling and efficient memory management to maximize the
  serving throughput.
  
  The `LLM` class wraps this class for offline batched inference and the
  `AsyncLLMEngine` class wraps this class for online serving.
  
  NOTE: The config arguments are derived from the `EngineArgs` class. For the
  comprehensive list of arguments, see `EngineArgs`.
  
  Args:
      model_config: The configuration related to the LLM model.
      cache_config: The configuration related to the KV cache memory
          management.
      parallel_config: The configuration related to distributed execution.
      scheduler_config: The configuration related to the request scheduler.
      distributed_init_method: The initialization method for distributed
          execution. See `torch.distributed.init_process_group` for details.
      placement_group: Ray placement group for distributed execution.
          Required for distributed execution.
      log_stats: Whether to log statistics.
code: def _log_system_stats(
      self,
      prompt_run: bool,
      num_batched_tokens: int,
  ) -> None:
      now = time.monotonic()
      # Log the number of batched input tokens.
      if prompt_run:
          self.num_prompt_tokens.append((now, num_batched_tokens))
      else:
          self.num_generation_tokens.append((now, num_batched_tokens))
  
      elapsed_time = now - self.last_logging_time
      if elapsed_time < _LOGGING_INTERVAL_SEC:
          return
  
      # Discard the old stats.
      self.num_prompt_tokens = [
          (t, n)
          for t, n in self.num_prompt_tokens
          if now - t < _LOGGING_INTERVAL_SEC
      ]
      self.num_generation_tokens = [
          (t, n)
          for t, n in self.num_generation_tokens
          if now - t < _LOGGING_INTERVAL_SEC
      ]
  
      if len(self.num_prompt_tokens) > 1:
          total_num_tokens = sum(
              n for _, n in self.num_prompt_tokens[:-1]
          )
          window = now - self.num_prompt_tokens[0][0]
          avg_prompt_throughput = total_num_tokens / window
      else:
          avg_prompt_throughput = 0.0
      if len(self.num_generation_tokens) > 1:
          total_num_tokens = sum(
              n for _, n in self.num_generation_tokens[:-1]
          )
          window = now - self.num_generation_tokens[0][0]
          avg_generation_throughput = total_num_tokens / window
      else:
          avg_generation_throughput = 0.0
  
      # bigdl-llm change start
      # summary: removing logging of pagetable related arguments
      # total_num_gpu_blocks = self.cache_config.num_gpu_blocks
      # num_free_gpu_blocks = (
      #     self.scheduler.block_manager.get_num_free_gpu_blocks())
      # num_used_gpu_blocks = total_num_gpu_blocks - num_free_gpu_blocks
      # gpu_cache_usage = num_used_gpu_blocks / total_num_gpu_blocks
  
      # total_num_cpu_blocks = self.cache_config.num_cpu_blocks
      # if total_num_cpu_blocks > 0:
      #     num_free_cpu_blocks = (
      #         self.scheduler.block_manager.get_num_free_cpu_blocks())
      #     num_used_cpu_blocks = total_num_cpu_blocks - num_free_cpu_blocks
      #     cpu_cache_usage = num_used_cpu_blocks / total_num_cpu_blocks
      # else:
      #     cpu_cache_usage = 0.0
  
      # bigdl-llm change end
  
      logger.info(
          "Avg prompt throughput: "
          f"{avg_prompt_throughput:.1f} tokens/s, "
          "Avg generation throughput: "
          f"{avg_generation_throughput:.1f} tokens/s, "
          f"Running: {len(self.scheduler.running)} reqs, "
          f"Pending: {len(self.scheduler.waiting)} reqs, "
      )
      self.last_logging_time = now
  
imports: import time
  from typing import TYPE_CHECKING, Any, Iterable, List, Optional, Tuple, Union, Dict
  from bigdl.llm.vllm.config import ModelConfig, SchedulerConfig
  from bigdl.llm.vllm.core.scheduler import SchedulerOutputs, FixedWindowScheduler
  from bigdl.llm.vllm.engine.arg_utils import EngineArgs
  from bigdl.llm.vllm.logger import init_logger
  from bigdl.llm.vllm.outputs import RequestOutput
  from bigdl.llm.vllm.sampling_params import SamplingParams
  from bigdl.llm.vllm.sequence import SamplerOutput, Sequence, SequenceGroup, SequenceGroupMetadata, SequenceStatus, SequenceOutputs
  from bigdl.llm.vllm.transformers_utils.tokenizer import get_tokenizer, detokenize_incrementally
  from bigdl.llm.vllm.utils import Counter
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 15 for calling the LLMEngine obj's underlying member method code with example usage: obj._log_system_stats(prompt_run, num_batched_tokens) without return types