Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 91e9909

Browse files
authored
Merge branch 'main' into benchmarking_script
2 parents 3888de3 + 70260eb commit 91e9909

File tree

242 files changed

+11290
-3695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

242 files changed

+11290
-3695
lines changed

.ci/scripts/convert_checkpoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ function convert_checkpoint() {
2222
return 0
2323
fi
2424

25-
[ -f "build/convert_hf_checkpoint.py" ] || exit 1
25+
[ -f "torchchat/cli/convert_hf_checkpoint.py" ] || exit 1
2626

2727
if [ -f "checkpoints/$MODEL_REPO/model.pth" ]; then
2828
echo "Converted checkpoint already exists. Skipping conversion for $MODEL_REPO."
2929
return 0
3030
fi
3131
echo "Convert Huggingface checkpoint for $MODEL_REPO"
32-
python3 build/convert_hf_checkpoint.py --checkpoint-dir "checkpoints/$MODEL_REPO"
32+
python3 torchchat/cli/convert_hf_checkpoint.py --checkpoint-dir "checkpoints/$MODEL_REPO"
3333
}
3434

3535

.ci/scripts/run-docs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fi
77

88
if [ "$1" == "readme" ]; then
99
echo "::group::Create script to run README"
10-
python3 scripts/updown.py --create-sections --file README.md --replace 'llama3:stories15M,-l 3:-l 2' --suppress huggingface-cli,HF_TOKEN > ./run-readme.sh
10+
python3 torchchat/utils/scripts/updown.py --create-sections --file README.md --replace 'llama3.1:stories15M,-l 3:-l 2' --suppress huggingface-cli,HF_TOKEN > ./run-readme.sh
1111
# for good measure, if something happened to updown processor,
1212
# and it did not error out, fail with an exit 1
1313
echo "exit 1" >> ./run-readme.sh
@@ -25,7 +25,7 @@ fi
2525

2626
if [ "$1" == "quantization" ]; then
2727
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
28+
python3 torchchat/utils/scripts/updown.py --create-sections --file docs/quantization.md --replace llama3:stories15M --suppress huggingface-cli,HF_TOKEN > ./run-quantization.sh
2929
# for good measure, if something happened to updown processor,
3030
# and it did not error out, fail with an exit 1
3131
echo "exit 1" >> ./run-quantization.sh
@@ -43,7 +43,7 @@ fi
4343

4444
if [ "$1" == "gguf" ]; then
4545
echo "::group::Create script to run gguf"
46-
python3 scripts/updown.py --file docs/GGUF.md --replace 'llama3:stories15M,-l 3:-l 2' --suppress huggingface-cli,HF_TOKEN > ./run-gguf.sh
46+
python3 torchchat/utils/scripts/updown.py --file docs/GGUF.md --replace 'llama3:stories15M,-l 3:-l 2' --suppress huggingface-cli,HF_TOKEN > ./run-gguf.sh
4747
# for good measure, if something happened to updown processor,
4848
# and it did not error out, fail with an exit 1
4949
echo "exit 1" >> ./run-gguf.sh
@@ -60,7 +60,7 @@ fi
6060

6161
if [ "$1" == "advanced" ]; then
6262
echo "::group::Create script to run advanced"
63-
python3 scripts/updown.py --file docs/ADVANCED-USERS.md --replace 'llama3:stories15M,-l 3:-l 2' --suppress huggingface-cli,HF_TOKEN > ./run-advanced.sh
63+
python3 torchchat/utils/scripts/updown.py --file docs/ADVANCED-USERS.md --replace 'llama3:stories15M,-l 3:-l 2' --suppress huggingface-cli,HF_TOKEN > ./run-advanced.sh
6464
# for good measure, if something happened to updown processor,
6565
# and it did not error out, fail with an exit 1
6666
echo "exit 1" >> ./run-advanced.sh
@@ -72,14 +72,14 @@ if [ "$1" == "advanced" ]; then
7272
echo "*******************************************"
7373
bash -x ./run-advanced.sh
7474
echo "::endgroup::"
75-
fi
75+
fi
7676

7777
if [ "$1" == "evaluation" ]; then
7878

7979
exit 0
80-
80+
8181
echo "::group::Create script to run evaluation"
82-
python3 scripts/updown.py --file docs/evaluation.md --replace 'llama3:stories15M,-l 3:-l 2' --suppress huggingface-cli,HF_TOKEN > ./run-evaluation.sh
82+
python3 torchchat/utils/scripts/updown.py --file torchchat/utils/docs/evaluation.md --replace 'llama3:stories15M,-l 3:-l 2' --suppress huggingface-cli,HF_TOKEN > ./run-evaluation.sh
8383
# for good measure, if something happened to updown processor,
8484
# and it did not error out, fail with an exit 1
8585
echo "exit 1" >> ./run-evaluation.sh
@@ -91,4 +91,3 @@ if [ "$1" == "evaluation" ]; then
9191
echo "*******************************************"
9292
bash -x ./run-evaluation.sh
9393
fi
94-

.ci/scripts/validate.sh

Lines changed: 41 additions & 41 deletions
Large diffs are not rendered by default.

.github/workflows/more-tests.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
echo "::group::Download checkpoints"
3030
# Install requirements
31-
./install_requirements.sh cuda
31+
./install/install_requirements.sh cuda
3232
pip3 list
3333
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
3434
echo "::endgroup::"
@@ -49,37 +49,37 @@ jobs:
4949
for DTYPE in bfloat16 float16 float32; do
5050
###################################################################
5151
# group with different temperatures
52-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0
53-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9
54-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0
55-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100
56-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200
57-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500
52+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0
53+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9
54+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0
55+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100
56+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200
57+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500
5858
###################################################################
5959
# group with different temperatures and prefill, and compile
6060
# and prefill compile
61-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --compile --compile-prefill
62-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --compile --compile-prefill
63-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --compile --compile-prefill
64-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --compile --compile-prefill
65-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --compile --compile-prefill
66-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --compile --compile-prefill
61+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --compile --compile-prefill
62+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --compile --compile-prefill
63+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --compile --compile-prefill
64+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --compile --compile-prefill
65+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --compile --compile-prefill
66+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --compile --compile-prefill
6767
###################################################################
6868
# group with different temperatures and sequential prefill
69-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --sequential-prefill
70-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --sequential-prefill
71-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --sequential-prefill
72-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --sequential-prefill
73-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --sequential-prefill
74-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --sequential-prefill
69+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --sequential-prefill
70+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --sequential-prefill
71+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --sequential-prefill
72+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --sequential-prefill
73+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --sequential-prefill
74+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --sequential-prefill
7575
###################################################################
7676
# group with different temperatures and prefill, and compile
77-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --sequential-prefill --compile
78-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --sequential-prefill --compile
79-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --sequential-prefill --compile
80-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --sequential-prefill --compile
81-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --sequential-prefill --compile
82-
python generate.py --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --sequential-prefill --compile
77+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0 --sequential-prefill --compile
78+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 0.9 --sequential-prefill --compile
79+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --temperature 1.0 --sequential-prefill --compile
80+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 100 --sequential-prefill --compile
81+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 200 --sequential-prefill --compile
82+
python torchchat.py generate --checkpoint-path ${MODEL_PATH} --device cpu --dtype ${DTYPE} --top-k 500 --sequential-prefill --compile
8383
8484
done
8585

.github/workflows/periodic.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
echo "$(uname -a)"
4848
- name: Install dependencies
4949
run: |
50-
./install_requirements.sh
50+
./install/install_requirements.sh
5151
pip3 list
5252
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
5353
- name: Download checkpoints
@@ -80,7 +80,7 @@ jobs:
8080
echo "$(uname -a)"
8181
- name: Install dependencies
8282
run: |
83-
./install_requirements.sh
83+
./install/install_requirements.sh
8484
pip3 list
8585
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
8686
- name: Download checkpoints
@@ -126,7 +126,7 @@ jobs:
126126
echo "::endgroup::"
127127
128128
echo "::group::Install required packages"
129-
./install_requirements.sh cuda
129+
./install/install_requirements.sh cuda
130130
pip3 list
131131
python3 -c 'import torch;print(f"torch: {torch.__version__, torch.version.git_version}")'
132132
echo "::endgroup::"

0 commit comments

Comments
 (0)