Skip to content

jansel/convolution-autotuner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convolution Autotuner Experiment

This repo contains some experiments to autotune simple convolution implementations using OpenTuner. It is currently a work in progress (or abandoned if you are reading this in the far future), but currently can demonstrate speedups over PyTorch on over 40 of the slowest 50 convolutions found in TorchBench for CPU inference. The generated code is simple C++ and does not depend on a more complex system, this makes it easy to understand and can be used to drive speedups in other systems.

Results from my local Intel Core i7-8086K CPU are here.

Setup

Install miniconda if not already installed. Python 3.7+ is required.

  1. Create a conda environment
conda create --name convtuner
conda activate convtuner
  1. Install PyTorch nightly (or replace this setp with PyTorch from source)
conda install pytorch cpuonly -c pytorch-nightly
  1. Install opentuner/sympy/pandas
pip install opentuner sympy pandas

Running

Usage can be found with --help:

usage: main.py [-h] [--verbose] [--times TIMES] [--repeat REPEAT] [--case CASE] [--autotune] [--dummy] [--limit LIMIT]
               [--test-limit TEST_LIMIT] [--testcases-filename TESTCASES_FILENAME]

optional arguments:
  -h, --help            show this help message and exit
  --verbose, -v
  --times TIMES
  --repeat REPEAT
  --case CASE
  --autotune
  --dummy
  --limit LIMIT, -l LIMIT
  --test-limit TEST_LIMIT
  --testcases-filename TESTCASES_FILENAME

Some examples:

  • ./main.py --limit=10 - runs the slowest 10 shapes from testcases.csv using pre-tuned configs found in the configs folder.
  • ./main.py --limit=10 --autotune - same as above, but regenerates the config using autotuning
  • ./main.py --case=3 --autotune - runs just the third testcase
  • ./main.py --case=3 --verbose - runs just the third testcase, and prints out the generated source code

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published