Skip to content

Commit

Permalink
Add torch to lit cfg for programming_examples (#1370)
Browse files Browse the repository at this point in the history
Co-authored-by: singagan <53442471+singagan@users.noreply.github.com>
Co-authored-by: Gagandeep Singh <gagan.posted@gmail.com>
  • Loading branch information
3 people authored Apr 23, 2024
1 parent 0e90fd8 commit 8da4f3b
Show file tree
Hide file tree
Showing 20 changed files with 1,686 additions and 1,305 deletions.
1 change: 1 addition & 0 deletions .github/workflows/buildAndTestRyzenAI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ jobs:
python -m venv aie-venv
source aie-venv/bin/activate
pip install -r python/requirements.txt
pip install -r python/requirements_ml.txt
pip install jupyter
sed -i.bak 's/OUTPUT_TIMEOUT = 10/OUTPUT_TIMEOUT = 100/g' \
$(python -c 'import site; print(site.getsitepackages()[0])')/jupyter_client/runapp.py
Expand Down
8 changes: 8 additions & 0 deletions programming_examples/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@
opencv_flags = ""
config.substitutions.append(("%opencv_flags", opencv_flags))

try:
import torch

config.available_features.add("torch")
except ImportError:
print("torch not found", file=sys.stderr)
pass

VitisSysrootFlag = ""
if "x86_64" in config.aieHostTarget:
config.substitutions.append(("%aieHostTargetTriplet%", "x86_64-unknown-linux-gnu"))
Expand Down
2 changes: 1 addition & 1 deletion programming_examples/ml/bottleneck/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ clean:
*.log aie_partition.json *.bin BOOT.BIN _x test.exe

run_py:
${powershell} python3 test.py
${powershell} python3 test.py -x build/final.xclbin -i build/insts.txt -k MLIR_AIE
7 changes: 0 additions & 7 deletions programming_examples/ml/bottleneck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,4 @@ make
To run the design:
```
make run_py
```

### Prerequisites
To install the dependencies, run the following command:
```
pip install -r requirements.txt
```
2 changes: 1 addition & 1 deletion programming_examples/ml/bottleneck/run.lit
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
// RUN: xchesscc_wrapper aie2 -I %aietools/include -DBIT_WIDTH=8 -DINT8_ACT -c %S/../../../aie_kernels/aie2/conv2dk1_skip.cc -o conv2dk1_skip.o
// RUN: %python %S/aie2.py | aie-opt -cse -canonicalize -o ./aie.mlir
// RUN: %python aiecc.py --xbridge --aie-generate-cdo --aie-generate-ipu --no-compile-host --xclbin-name=aie.xclbin --ipu-insts-name=insts.txt ./aie.mlir
// RUN: %run_on_ipu %python %S/test.py | FileCheck %s
// RUN: %run_on_ipu %python %S/test.py -x aie.xclbin -i insts.txt -k MLIR_AIE | FileCheck %s
// CHECK: PASS!
Loading

0 comments on commit 8da4f3b

Please sign in to comment.