From fbbd52c678c0b938236d3f9405c94da858d429d4 Mon Sep 17 00:00:00 2001 From: Hashim Sharif <hsharif3@miranda.cs.illinois.edu> Date: Fri, 26 Mar 2021 17:21:55 -0500 Subject: [PATCH] Adding CNN model description in developer docs --- hpvm/docs/developerdocs/cnn-models.rst | 16 ++++++++++++++++ hpvm/docs/developerdocs/index.rst | 1 + 2 files changed, 17 insertions(+) create mode 100644 hpvm/docs/developerdocs/cnn-models.rst diff --git a/hpvm/docs/developerdocs/cnn-models.rst b/hpvm/docs/developerdocs/cnn-models.rst new file mode 100644 index 0000000000..de0847031a --- /dev/null +++ b/hpvm/docs/developerdocs/cnn-models.rst @@ -0,0 +1,16 @@ + +CNN Model Weights +=================== + +The CNN weights (and input) files can be downloaded from here: https://databank.illinois.edu/datasets/IDB-6565690 + +The extracted `model_params` directory is to be copied to `hpvm/hpvm/test/dnn_benchmarks/model_params` - the CNN benchmark expect the model weights at this specific location. The automatic HPVM install (`install.sh`) does the data download, extraction, and copying automatically. + +We support CNN weights in 3 formats: + +* `.h5` file format: The entire CNN model is stored as a single `.h5` file. The Keras models are shipped as `.h5` files. These can be found under `model_params/keras` + +* `.pth.tar` file format: The PyTorch models are shipped as `pth.tar` files and can be found under `model_params/pytorch` + +* `.bin` serialized binary file format: This format is used by the HPVM binaries. Convolution, Dense, and BatchNormalization parameters for each layer are stored as individual files. The weights are serialized FP32 values layed out serially in `NCHW` format. Our frontends (Keras and PyTorch) convert `.h5` and `pth.tar` files into `.bin` files in the frontend translation phase. The `.bin` weights can be found under the respective subdirectory for each benchmark under `model_params/` + diff --git a/hpvm/docs/developerdocs/index.rst b/hpvm/docs/developerdocs/index.rst index 6c0cf5aa69..77083aa7d1 100644 --- a/hpvm/docs/developerdocs/index.rst +++ b/hpvm/docs/developerdocs/index.rst @@ -5,3 +5,4 @@ Developer Documents :maxdepth: 1 approximation-implementation + cnn-models -- GitLab