Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add torch to lit cfg for programming_examples #1370

Merged
merged 11 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading