QTensor is an extended repository for Quantization-Aware Training (QAT) with TensorFlow. Focusing on using different quantizers with the goal of benchmarking different ones.
To get started with QTensor, clone the repository and run:
- Clone the repo
git clone https://github.com/username/qtensor.git
cd qtensor- Run the docker container
./docker/run.sh- Run examples
- Select a model under the models module, fo example
mlp. - Select one of the qconfigs associated with the selected model (the available ones are the keys of the
qconfigsdictionary e.g. for mlp). - Select a dataset to use to evaluate the model from the available datasets.
cd src/examples
./run.py --model mlp --qconfig qconfig --dataset mnist`
Note: Run
./run.py --helpfor extra options
To run and develop the document with latex, you can compile the file by running compile.sh.
If you use visual studio code as your IDE you can customize it so ctrl+enter compiles the latex document.
- add this
task.jsonfile to the.vscodedir in the root of the project.
{
"version": "2.0.0",
"tasks": [
{
"label": "compile latex",
"type": "shell",
"command": "docker/compile.sh",
"presentation": {
"echo": false,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
}
}
]
}
- Add this shortcut to your
keybindings
[{
"key": "ctrl+enter",
"command": "workbench.action.tasks.runTask",
"args": ["compile latex"]
}
]
Please before pushing, install pre-commits and run them
pip install pre-commit==2.20.0
pre-commit install
pre-commit run --all-files --verbose --show-diff-on-failure