@@ -1123,6 +1123,56 @@ jobs:
11231123 echo "Tests complete."
11241124
11251125 test-torchao-experimental-cpp :
1126+ strategy :
1127+ matrix :
1128+ runner : [macos-14-xlarge]
1129+ runs-on : ${{matrix.runner}}
1130+ steps :
1131+ - name : Checkout repo
1132+ uses : actions/checkout@v3
1133+ with :
1134+ submodules : true
1135+ - name : Setup Python
1136+ uses : actions/setup-python@v2
1137+ with :
1138+ python-version : 3.10.11
1139+ - name : Setup Xcode
1140+ if : runner.os == 'macOS'
1141+ uses : maxim-lobanov/setup-xcode@v1
1142+ with :
1143+ xcode-version : ' 15.3'
1144+ - name : Print machine info
1145+ run : |
1146+ uname -a
1147+ if [ $(uname -s) == Darwin ]; then
1148+ sysctl machdep.cpu.brand_string
1149+ sysctl machdep.cpu.core_count
1150+ fi
1151+ - name : Install torchchat
1152+ run : |
1153+ echo "Intalling pip3 packages"
1154+ ./install/install_requirements.sh
1155+ pip3 list
1156+ python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
1157+ - name : Install torchao-ops
1158+ id : install-torchao-ops
1159+ run : |
1160+ bash torchchat/utils/scripts/build_torchao_ops.sh
1161+ - name : Install runner
1162+ run : |
1163+ echo "Installing runner"
1164+ bash torchchat/utils/scripts/build_native.sh aoti link_torchao_ops
1165+ - name : Run inference
1166+ run : |
1167+ python torchchat.py download stories110M
1168+ wget -O ./tokenizer.model https://github.com/karpathy/llama2.c/raw/master/tokenizer.model
1169+ export PRMT="Once upon a time in a land far away"
1170+ echo "Export and run AOTI (C++ runner)"
1171+ 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}}'
1172+ ./cmake-out/aoti_run ./model.pt2 -z ./tokenizer.model -t 0 -i "${PRMT}"
1173+ echo "Tests complete."
1174+
1175+ test-torchao-experimental-et :
11261176 strategy :
11271177 matrix :
11281178 runner : [macos-14-xlarge]
@@ -1175,10 +1225,6 @@ jobs:
11751225 echo "Export and run ET (C++ runner)"
11761226 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}}'
11771227 ./cmake-out/et_run ./model.pte -z ./tokenizer.model -t 0 -i "${PRMT}"
1178- echo "Export and run AOTI (C++ runner)"
1179- 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}}'
1180- ./cmake-out/aoti_run ./model.pt2 -z ./tokenizer.model -t 0 -i "${PRMT}"
1181- echo "Tests complete."
11821228
11831229 test-torchao-experimental-mps :
11841230 strategy :
0 commit comments