@@ -1055,7 +1055,59 @@ jobs:
10551055 ./runner/build_android.sh
10561056 echo "Tests complete."
10571057
1058- test-torchao-experimental :
1058+ test-torchao-aoti-experimental :
1059+ strategy :
1060+ matrix :
1061+ runner : [macos-14-xlarge]
1062+ runs-on : ${{matrix.runner}}
1063+ steps :
1064+ - name : Checkout repo
1065+ uses : actions/checkout@v3
1066+ with :
1067+ submodules : true
1068+ - name : Setup Python
1069+ uses : actions/setup-python@v2
1070+ with :
1071+ python-version : 3.10.11
1072+ - name : Setup Xcode
1073+ if : runner.os == 'macOS'
1074+ uses : maxim-lobanov/setup-xcode@v1
1075+ with :
1076+ xcode-version : ' 15.3'
1077+ - name : Print machine info
1078+ run : |
1079+ uname -a
1080+ if [ $(uname -s) == Darwin ]; then
1081+ sysctl machdep.cpu.brand_string
1082+ sysctl machdep.cpu.core_count
1083+ fi
1084+ - name : Install torchchat
1085+ run : |
1086+ echo "Intalling pip3 packages"
1087+ ./install/install_requirements.sh
1088+ pip3 list
1089+ python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
1090+ - name : Install torchao-ops
1091+ id : install-torchao-ops
1092+ run : |
1093+ bash torchchat/utils/scripts/build_torchao_ops.sh
1094+ - name : Install runner AOTI
1095+ id : install-runner-aoti
1096+ run : |
1097+ bash torchchat/utils/scripts/build_native.sh aoti link_torchao_ops
1098+ - name : Run inference
1099+ run : |
1100+ python torchchat.py download stories110M
1101+ wget -O ./tokenizer.model https://github.com/karpathy/llama2.c/raw/master/tokenizer.model
1102+ export PRMT="Once upon a time in a land far away"
1103+ echo "Export and run AOTI (C++ runner)"
1104+ python torchchat.py export stories110M --output-aoti-package-path ./model.pt2 --dtype float32 --quantize '{"embedding:wx": {"bitwidth": 2, "groupsize": 32}, "linear:a8wxdq": {"bitwidth": 3, "groupsize": 128, "has_weight_zeros": false}}'
1105+ ./cmake-out/aoti_run ./model.pt2 -z ./tokenizer.model -t 0 -i "${PRMT}"
1106+ echo "Generate AOTI"
1107+ python torchchat.py generate stories110M --aoti-package-path ./model.pt2 --prompt "${PRMT}"
1108+ echo "Tests complete."
1109+
1110+ test-torchao-et-experimental :
10591111 strategy :
10601112 matrix :
10611113 runner : [macos-14-xlarge]
@@ -1100,10 +1152,6 @@ jobs:
11001152 run : |
11011153 echo "Installing runner"
11021154 bash torchchat/utils/scripts/build_native.sh et link_torchao_ops
1103- - name : Install runner AOTI
1104- id : install-runner-aoti
1105- run : |
1106- bash torchchat/utils/scripts/build_native.sh aoti link_torchao_ops
11071155 - name : Run inference
11081156 run : |
11091157 python torchchat.py download stories110M
@@ -1116,11 +1164,6 @@ jobs:
11161164 echo "Export and run ET (C++ runner)"
11171165 python torchchat.py export stories110M --output-pte-path ./model.pte --dtype float32 --quantize '{"embedding:wx": {"bitwidth": 2, "groupsize": 32}, "linear:a8wxdq": {"bitwidth": 3, "groupsize": 128, "has_weight_zeros": false}}'
11181166 ./cmake-out/et_run ./model.pte -z ./tokenizer.model -t 0 -i "${PRMT}"
1119- echo "Export and run AOTI (C++ runner)"
1120- python torchchat.py export stories110M --output-aoti-package-path ./model.pt2 --dtype float32 --quantize '{"embedding:wx": {"bitwidth": 2, "groupsize": 32}, "linear:a8wxdq": {"bitwidth": 3, "groupsize": 128, "has_weight_zeros": false}}'
1121- ./cmake-out/aoti_run ./model.pt2 -z ./tokenizer.model -t 0 -i "${PRMT}"
1122- echo "Generate AOTI"
1123- python torchchat.py generate stories110M --aoti-package-path ./model.pt2 --prompt "${PRMT}"
11241167 echo "Tests complete."
11251168
11261169 test-torchao-experimental-mps :
0 commit comments