tlc-pack / tenset

Apache License 2.0
90 stars 33 forks source link

Get started with cost model experiments #1

Closed merrymercy closed 3 years ago

merrymercy commented 3 years ago

Get started

This tutorial contains a minimal example of training a cost model and using it for search.

Dataset

Install and Download

  1. Build and install this repo following the install guide of TVM.
  2. Download dataset file.
    • You can download it from google drive
    • Or you can use the command line
      pip3 install gdown
      gdown https://drive.google.com/uc?id=1hciRGyXcGY9fK_owgvlJow8P_l8xYIVJ
  3. Put dataset_v3.1.zip under tvm-cost-model/scripts and run unzip dataset_v3.1.zip A new folder dataset will appear in tvm-cost-model/scripts.

Dataset Content

see this readme

Example experiment

Train a cost model and use it for search

Go to tvm-cost-model/scripts.

  1. Make a dataset You can either
    • create a sampled smaller dataset for fast experiments.
      python3 make_dataset.py --logs dataset/measure_records/e5-2673/*.json --sample-in-files 100
    • create a complete dataset by using all files. This takes a longer time and requires more memory.
      python3 make_dataset.py --logs dataset/measure_records/e5-2673/*.json
  2. Train a cost model
    python3 train_model.py
  3. Use the model for search
    python3 tune_network.py --network resnet_50 --n-trials 100 --cost-model xgb-no-update --load-model xgb.pkl

References

merrymercy commented 3 years ago

Try search for an avx-512 CPU

  1. install dataset_v3.1.zip following the instructions above.
  2. python3 make_dataset.py --preset batch-size-1 --sample-in-files 500
    python3 train_model.py
    python3 tune_network.py --network resnet_50 --n-trials 100 --target "llvm -mcpu=skylake-avx512" --cost-model xgb-no-update --load-model xgb.pkl
merrymercy commented 3 years ago

Dataset and hardware platforms

Folder Hardware platform VM instance type
platinum-8272 Intel platinum-8272 Azure D32s_v4
e5-2673 Intel e5-2673 Azure F16s
epyc-7452 AMD epyc-7452 Azure D16as_v4
k80 NVIDIA K80 AWS p2
catmaohphp commented 2 years ago

The dataset file is not available for download now.

merrymercy commented 2 years ago

@catmaohphp This issue is outdated. see https://github.com/tlc-pack/tenset/blob/main/docs/get_started_with_cost_model_experiments.md

catmaohphp commented 2 years ago

Thank you for your quick response!