code: def test_prefetch_compute(self) -> None:
      class MyCacheStatistics(CacheStatistics):
          def __init__(
              self, expected_lookups: int, cacheability: float
          ) -> None:
              self._expected_lookups = expected_lookups
              self._cacheability = cacheability
  
          @property
          def expected_lookups(self) -> int:
              return self._expected_lookups
  
          def expected_miss_rate(self, clf: float) -> float:
              return clf
  
          @property
          def cacheability(self) -> float:
              return self._cacheability
  
      tables = [
          EmbeddingBagConfig(
              num_embeddings=100,
              embedding_dim=10,
              name="table_0",
              feature_names=["feature_0"],
          ),
          EmbeddingBagConfig(
              num_embeddings=100,
              embedding_dim=10,
              name="table_1",
              feature_names=["feature_1"],
          ),
      ]
      constraints = {
          "table_0": ParameterConstraints(
              compute_kernels=[
                  EmbeddingComputeKernel.FUSED_UVM_CACHING.value
              ],
              cache_params=CacheParams(
                  load_factor=0.1,
                  stats=MyCacheStatistics(
                      expected_lookups=200_000, cacheability=0.2
                  ),
              ),
          ),
          # simulate promoting a uvm caching table to HBM during scaleup.
          "table_1": ParameterConstraints(
              compute_kernels=[EmbeddingComputeKernel.FUSED.value],
              cache_params=CacheParams(
                  load_factor=None,
                  stats=MyCacheStatistics(
                      expected_lookups=200_000, cacheability=0.2
                  ),
              ),
          ),
      }
      enumerator = EmbeddingEnumerator(
          topology=self.topology,
          batch_size=BATCH_SIZE,
          estimator=self.estimator,
          constraints=constraints,
      )
      model = TestSparseNN(tables=tables, weighted_tables=[])
      sharding_options = enumerator.enumerate(
          module=model,
          sharders=[
              cast(
                  ModuleSharder[torch.nn.Module],
                  EmbeddingBagCollectionSharder(
                      fused_params={"cache_load_factor": 0.2}
                  ),
              )
          ],
      )
  
      expected_prefetch_computes = {
          ("table_0", "fused_uvm_caching", "column_wise"): [
              0.014608981562595743
          ],
          ("table_0", "fused_uvm_caching", "row_wise"): [
              0.007304490781297871,
              0.007304490781297871,
          ],
          ("table_0", "fused_uvm_caching", "table_column_wise"): [
              0.014608981562595743
          ],
          ("table_0", "fused_uvm_caching", "table_row_wise"): [
              0.007304490781297871,
              0.007304490781297871,
          ],
          ("table_0", "fused_uvm_caching", "table_wise"): [
              0.014608981562595743
          ],
          ("table_1", "fused", "column_wise"): [0.0],
          ("table_1", "fused", "row_wise"): [0.0, 0.0],
          ("table_1", "fused", "table_column_wise"): [0.0],
          ("table_1", "fused", "table_row_wise"): [0.0, 0.0],
          ("table_1", "fused", "table_wise"): [0.0],
      }
  
      prefetch_computes = {
          (
              sharding_option.name,
              sharding_option.compute_kernel,
              sharding_option.sharding_type,
          ): [
              shard.perf.prefetch_compute if shard.perf else -1
              for shard in sharding_option.shards
          ]
          for sharding_option in sharding_options
      }
      self.assertEqual(expected_prefetch_computes, prefetch_computes)
  
imports: import unittest
  from typing import cast
  import torch
  import torchrec.optim
  from torchrec.distributed.embedding import EmbeddingCollectionSharder
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel
  from torchrec.distributed.embeddingbag import EmbeddingBagCollectionSharder
  from torchrec.distributed.fbgemm_qcomm_codec import CommType, get_qcomm_codecs_registry, QCommsConfig
  from torchrec.distributed.planner.constants import BATCH_SIZE
  from torchrec.distributed.planner.enumerators import EmbeddingEnumerator
  from torchrec.distributed.planner.shard_estimators import _calculate_storage_specific_sizes, EmbeddingOffloadStats, EmbeddingPerfEstimator
  from torchrec.distributed.planner.types import ParameterConstraints, Perf, Topology
  from torchrec.distributed.quant_embeddingbag import QuantEmbeddingBagCollectionSharder
  from torchrec.distributed.test_utils.test_model import TestSparseNN
  from torchrec.distributed.tests.test_quant_model_parallel import _quantize
  from torchrec.distributed.tests.test_sequence_model import TestSequenceSparseNN
  from torchrec.distributed.types import CacheParams, CacheStatistics, ModuleSharder, ShardingType
  from torchrec.modules.embedding_configs import EmbeddingBagConfig, EmbeddingConfig
label_desc: Use image node_id 6 for calling the TestEmbeddingPerfEstimator obj's underlying member method code with example usage: obj.test_prefetch_compute() and returns: self, clf, self