nn-Meter/examples/README.md

2.0 KiB

Examples for nn-Meter

In this folder, we provide several examples to show the usage of nn-Meter package.

The first example 1. Use nn-Meter Predictor for models with different format shows the basic python binding usage of nn-meter with models with different format of Tensorflow, PyTorch and ONNX model.

To evaluate the effectiveness of a prediction model on an arbitrary DNN model, we need a representative dataset that covers a large prediction scope. nn-Meter collects and generates 26k CNN models. (Please refer the paper for the dataset generation method.)

We release the dataset, and provide an interface of nn_meter.dataset for users to get access to the dataset. Users can also download the data from the Download Link on their own.

Example 2. Use nn-Meter with the bench dataset shows how to use nn-Meter to predict latency for the bench dataset.

Since the dataset is encoded in a graph format, we also provide an example 3. Use nn-Meter bench dataset for GNN training of using GNN to predict the model latency with the bench dataset.

Finally, we provide more hardware-ware NAS examples in NNI.

Examples list

  1. Use nn-Meter for models with different format
  2. Use nn-Meter with the bench dataset
  3. Use bench dataset for GNN training
  4. Use nn-Meter to construct latency constraint in SPOS NAS
  5. Use nn-Meter to construct latency penalty in ProxylessNAS