class_docstr: Stats for a sharding planner execution.
class_docstr_tok: ["Stats","for","a","sharding","planner","execution","."]
code: def _log_storage_reservation_stats(
      self,
      storage_reservation: StorageReservation,
      topology: Topology,
      reserved_hbm_percent: float,
      dense_storage: Storage,
      kjt_storage: Storage,
  ) -> None:
      device_storage = topology.devices[0].storage
      usable_hbm = round(
          bytes_to_gb(
              int((1 - reserved_hbm_percent) * device_storage.hbm)
          ),
          3,
      )
      usable_ddr = round(bytes_to_gb(int(device_storage.ddr)), 3)
      usable_memory = f"HBM: {usable_hbm} GB, DDR: {usable_ddr} GB"
      usable_hbm_percentage = (
          f"Percent of Total HBM: {(1 - reserved_hbm_percent):.0%}"
      )
      self._stats_table.append(f"#{'' : ^{self._width-2}}#")
      self._stats_table.append(
          f"# {'Usable Memory:' : <{self._width-3}}#"
      )
      self._stats_table.append(
          f"#    {usable_memory : <{self._width-6}}#"
      )
      self._stats_table.append(
          f"#    {usable_hbm_percentage : <{self._width-6}}#"
      )
  
      if isinstance(storage_reservation, HeuristicalStorageReservation):
          dense_hbm = round(bytes_to_gb(dense_storage.hbm), 3)
          dense_ddr = round(bytes_to_gb(dense_storage.ddr), 3)
          dense_storage_text = (
              f"HBM: {dense_hbm} GB, DDR: {dense_ddr} GB"
          )
          self._stats_table.append(f"#{'' : ^{self._width-2}}#")
          self._stats_table.append(
              f"# {'Dense Storage (per rank): ' : <{self._width-3}}#"
          )
          self._stats_table.append(
              f"#    {dense_storage_text : <{self._width-6}}#"
          )
  
          kjt_hbm = round(bytes_to_gb(kjt_storage.hbm), 3)
          kjt_ddr = round(bytes_to_gb(kjt_storage.ddr), 3)
          kjt_storage_text = f"HBM: {kjt_hbm} GB, DDR: {kjt_ddr} GB"
          self._stats_table.append(f"#{'' : ^{self._width-2}}#")
          self._stats_table.append(
              f"# {'KJT Storage (per rank): ' : <{self._width-3}}#"
          )
          self._stats_table.append(
              f"#    {kjt_storage_text : <{self._width-6}}#"
          )
  
imports: import logging
  from collections import defaultdict
  from typing import Any, cast, Dict, List, Optional, Tuple, Union
  from torch import nn
  from torchrec.distributed.planner.constants import BIGINT_DTYPE, NUM_POOLINGS
  from torchrec.distributed.planner.shard_estimators import _calculate_shard_io_sizes
  from torchrec.distributed.planner.storage_reservations import FixedPercentageStorageReservation, HeuristicalStorageReservation, InferenceStorageReservation
  from torchrec.distributed.planner.types import ParameterConstraints, Perf, ShardingOption, Stats, Storage, StorageReservation, Topology
  from torchrec.distributed.planner.utils import _find_imbalance_tables, bytes_to_gb, bytes_to_mb, sharder_name
  from torchrec.distributed.types import ModuleSharder, ParameterSharding, ShardingPlan, ShardingType
label_desc: Use image node_id 5 for calling the EmbeddingStats obj's underlying member method code with example usage: obj._log_storage_reservation_stats(storage_reservation, topology, reserved_hbm_percent, dense_storage, kjt_storage) without return types