To install the TPC package, run:
pip install edge-mdt-tpc
To initialize a TPC and integrate it with MCT, use the get_target_platform_capabilities function as follows:
from edgemdt_tpc import get_target_platform_capabilities
import model_compression_toolkit as mct
# Get a TPC object representing the imx500 hardware and use it for PyTorch model quantization in MCT
tpc = get_target_platform_capabilities(tpc_version='1.0', device_type='imx500')
# Apply MCT on your pre-trained model using the TPC
quantized_model, quantization_info = mct.ptq.pytorch_post_training_quantization(
in_module=pretrained_model, # Replace with your pretrained model.
representative_data_gen=dataset, # Replace with your representative dataset.
target_resource_utilization=tpc)TPC is our way of describing the hardware that will be used to run and infer with models that are optimized using the MCT. The TPC includes different parameters that are relevant to the hardware during inference (e.g., number of bits used in some operator for its weights/activations, fusing patterns, etc.)
The EdgeMDT-TPC package is licensed under Apache License Version 2.0. By contributing to the project, you agree to the license and copyright terms therein and release your contribution under these terms.

