Skip to content

Commit

Permalink
ensure test is red when error (#675)
Browse files Browse the repository at this point in the history
* ensure test is red when error

* macos version

* upgrade xcode

* fix workflow error

* suppress error in readme using updown skip
mikekgfb authored May 4, 2024
1 parent fc89ce7 commit a4eefc3
Showing 5 changed files with 64 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -35,7 +35,9 @@ jobs:
# echo "::endgroup::"
echo "::group::Create script"
python3 scripts/process-readme.py > ./we-run-this.sh
echo "set -eou pipefail" > ./we-run-this.sh
python3 scripts/process-readme.py >> ./we-run-this.sh
echo "exit 1" >> ./we-run-this.sh
echo "::endgroup::"
echo "::group::Run This"
56 changes: 56 additions & 0 deletions .github/workflows/run-readme-pr-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Run the README instructions - with stories - to ensure they work
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
test-readme-macos:
runs-on: macos-14-xlarge
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10.11'
- name: Setup Xcode
if: runner.os == 'macOS'
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.3'
- name: Run script
run: |
set -x
# NS: Remove previous installation of torch first
# as this script does not isntall anything into conda env but rather as system dep
pip3 uninstall -y torch || true
set -eou pipefail
echo "::group::Print machine info"
uname -a
sysctl machdep.cpu.brand_string
sysctl machdep.cpu.core_count
echo "::endgroup::"

# echo "::group::Install newer objcopy that supports --set-section-alignment"
# yum install -y devtoolset-10-binutils
# export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
# echo "::endgroup::"

echo "::group::Create script"
echo "set -eou pipefail" > ./readme-commands.sh
python3 scripts/process-readme.py >> ./readme-commands.sh
echo "exit 1" >> ./readme-commands.sh
echo "::endgroup::"

echo "::group::Run This"
grep -v login ./readme-commands.sh | sed -e '1,$s/llama3/stories15M/g' > ./we-run-this.sh
echo "*******************************************"
cat ./we-run-this.sh
echo "*******************************************"
bash -x ./we-run-this.sh

echo "tests complete"
echo "*******************************************"
echo "::endgroup::"
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
test-readme:
test-readme-any:
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
runner: linux.g5.4xlarge.nvidia.gpu
@@ -26,7 +26,8 @@ jobs:
# echo "::endgroup::"
echo "::group::Create script"
python3 scripts/process-readme.py > ./readme-commands.sh
echo "set -eou pipefail" > ./readme-commands.sh
python3 scripts/process-readme.py >> ./readme-commands.sh
echo "exit 1" >> ./readme-commands.sh
echo "::endgroup::"
47 changes: 0 additions & 47 deletions .github/workflows/run-readme2-mps.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -168,10 +168,12 @@ To build the runner binary on your Mac or Linux:
scripts/build_native.sh aoti
```

[skip default]: begin
Execute
```bash
cmake-out/aoti_run exportedModels/llama3.so -z ~/.torchchat/model-cache/meta-llama/Meta-Llama-3-8B-Instruct/tokenizer.model -l 3 -i "Once upon a time"
```
[skip default]: end

## Mobile Execution

0 comments on commit a4eefc3

Please sign in to comment.