This work aims to port PyTorch to HammerBlade.
This assumes that you have a working COSIM installed. Then you can either put hb-pytorch
under bsg_bladerunner
, or set BRG_BSG_BLADERUNNER_DIR
to your bladerunner
path.
- Clone hb-pytorch repo
git clone -b hb-device [email protected]:cornell-brg/hb-pytorch.git
- Create python virtual environment
python3.6 -m venv ./venv_pytorch
python3.6 -m venv ./venv_pytorch
- Install dependencies
pip install numpy pyyaml mkl mkl-include setuptools cmake cffi typing sklearn tqdm pytest
- Init pytorch third party dependencies
git submodule update --init --recursive
- Setup building environment variables. You need to edit
hb-pytorch/setup_cosim_build_env.sh
and setBSG_MANYCORE_DIR
to<bsg_bladerunner>/bsg_replicant/libraries
- Build pytorch. This step can take up to 15 minutes
cd hb-pytorch && python setup.py install
- Goto hb-pytorch directory
cd hb-pytorch
- Run pytest
source ./run-hb-pytest.sh
fragments/
environment.mk
baseline-README.md
run-hb-pytest.sh
(source
this one to run pytest!)hb_device/torch/
hb_device/torch/kernel
hb_device/torch/tests/
hb_device/torch/tests/targets.py
(Register a new test here!)
c10/hammerblade/