Build speed_benchmark_torch for x86 instead of android?

In this thread, I learned how to compile for Android the file pytorch/binaries/speed_benchmark_torch.cc, which lets you benchmark the speed of torchscript models. However, for debugging purposes, I’d like to build this file for my desktop computer’s Intel CPU, so that I can better debug some failures I am getting.

Does anyone know how to compile speed_benchmark_torch.cc for desktop CPU?

1 Like

I figured out a way to do it. I do a fresh build of pytorch as follows:

cd pytorch
export BUILD_BINARY=1
python setup.py build_ext 

An x86 CPU compatible (rather than Android or iOS compatible) binary appears here:
pytorch/build/bin/speed_benchmark_torch

And, I was able to run it successfully on my desktop computer’s CPU.