Skip to content

Commit a7d1b79

Browse files
mikekgfbmalfet
authored andcommitted
use new script to run docs, and run for CPU and CUDA (#756)
* use new script to run docs, and run for CPU and CUDA * typo
1 parent f1bbcd7 commit a7d1b79

File tree

2 files changed

+87
-20
lines changed

2 files changed

+87
-20
lines changed

.ci/scripts/run-docs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# /bin/bash -x
2+
3+
if [ "X$1" == "X" ]; then
4+
echo "Must specify document to run"
5+
exit 1
6+
fi
7+
8+
if [ "$1" == "readme" ]; then
9+
echo "::group::Create script to run README"
10+
python3 scripts/updown.py --create-sections --file README.md --replace 'llama3:stories15M,-l 3:-l 2,meta-llama/Meta-Llama-3-8B-Instruct:stories15M' --suppress huggingface-cli,HF_TOKEN > ./run-readme.sh
11+
# for good measure, if something happened to updown processor,
12+
# and it did not error out, fail with an exit 1
13+
echo "exit 1" >> ./run-readme.sh
14+
echo "::endgroup::"
15+
16+
echo "::group::Run README"
17+
echo "*******************************************"
18+
cat ./run-readme.sh
19+
echo "*******************************************"
20+
bash -x ./run-readme.sh
21+
echo "::endgroup::"
22+
23+
exit 0
24+
fi
25+
26+
if [ "$1" == "quantization" ]; then
27+
echo "::group::Create script to run quantization"
28+
python3 scripts/updown.py --create-sections --file docs/quantization.md --replace llama3:stories15M --suppress huggingface-cli,HF_TOKEN > ./run-quantization.sh
29+
# for good measure, if something happened to updown processor,
30+
# and it did not error out, fail with an exit 1
31+
echo "exit 1" >> ./run-quantization.sh
32+
echo "::endgroup::"
33+
34+
echo "::group::Run quantization"
35+
echo "*******************************************"
36+
cat ./run-quantization.sh
37+
echo "*******************************************"
38+
bash -x ./run-quantization.sh
39+
echo "::endgroup::"
40+
41+
exit 0
42+
fi

.github/workflows/run-readme-pr.yml

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,33 @@ jobs:
2727
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
2828
echo "::endgroup::"
2929
30-
echo "::group::Create script to run README"
31-
python3 scripts/updown.py --create-sections --file README.md --replace 'llama3:stories15M,-l 3:-l 2,meta-llama/Meta-Llama-3-8B-Instruct:stories15M' --suppress huggingface-cli,HF_TOKEN > ./run-readme.sh
32-
# for good measure, if something happened to updown processor,
33-
# and it did not error out, fail with an exit 1
34-
echo "exit 1" >> ./run-readme.sh
35-
echo "::endgroup::"
30+
.ci/scripts/run-docs readme
3631
37-
echo "::group::Run README"
38-
echo "*******************************************"
39-
cat ./run-readme.sh
32+
echo "::group::Completion"
33+
echo "tests complete"
4034
echo "*******************************************"
41-
bash -x ./run-readme.sh
4235
echo "::endgroup::"
4336
37+
test-readme-cpu:
38+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
39+
with:
40+
runner: linux.g5.4xlarge.nvidia.gpu
41+
secrets-env: "HF_TOKEN_PERIODIC"
42+
gpu-arch-type: cuda
43+
gpu-arch-version: "12.1"
44+
timeout: 60
45+
script: |
46+
echo "::group::Print machine info"
47+
uname -a
48+
echo "::endgroup::"
49+
50+
echo "::group::Install newer objcopy that supports --set-section-alignment"
51+
yum install -y devtoolset-10-binutils
52+
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
53+
echo "::endgroup::"
54+
55+
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs readme
56+
4457
echo "::group::Completion"
4558
echo "tests complete"
4659
echo "*******************************************"
@@ -63,20 +76,32 @@ jobs:
6376
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
6477
echo "::endgroup::"
6578
66-
echo "::group::Create script to run quantization"
67-
python3 scripts/updown.py --create-sections --file docs/quantization.md --replace llama3:stories15M --suppress huggingface-cli,HF_TOKEN > ./run-quantization.sh
68-
# for good measure, if something happened to updown processor,
69-
# and it did not error out, fail with an exit 1
70-
echo "exit 1" >> ./run-quantization.sh
71-
echo "::endgroup::"
79+
.ci/scripts/run-docs quantization
7280
73-
echo "::group::Run quantization"
74-
echo "*******************************************"
75-
cat ./run-quantization.sh
81+
echo "::group::Completion"
82+
echo "tests complete"
7683
echo "*******************************************"
77-
bash -x ./run-quantization.sh
7884
echo "::endgroup::"
7985
86+
test-quantization-cpu:
87+
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
88+
with:
89+
runner: linux.g5.4xlarge.nvidia.gpu
90+
gpu-arch-type: cuda
91+
gpu-arch-version: "12.1"
92+
timeout: 60
93+
script: |
94+
echo "::group::Print machine info"
95+
uname -a
96+
echo "::endgroup::"
97+
98+
echo "::group::Install newer objcopy that supports --set-section-alignment"
99+
yum install -y devtoolset-10-binutils
100+
export PATH=/opt/rh/devtoolset-10/root/usr/bin/:$PATH
101+
echo "::endgroup::"
102+
103+
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs quantization
104+
80105
test-gguf-any:
81106
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
82107
secrets: inherit

0 commit comments

Comments
 (0)