Skip to content

Commit 8213499

Browse files
committed
Update
[ghstack-poisoned]
2 parents cc3f03f + ca99c1c commit 8213499

36 files changed

+436
-196
lines changed

.github/scripts/ci_test_xpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export CXX=/usr/bin/g++
88
export SCCACHE_DISABLE=1
99

1010
python3 -m pip install torch torchvision torchaudio pytorch-triton-xpu --index-url https://download.pytorch.org/whl/nightly/xpu --force-reinstall --no-cache-dir
11-
cd torchao && python3 setup.py install && cd ..
11+
cd torchao && pip install . --no-build-isolation && cd ..
1212

1313
python3 -c "import torch; import torchao; print(f'Torch version: {torch.__version__}')"
1414

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# All rights reserved.
3+
#
4+
# This source code is licensed under the BSD 3-Clause license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
7+
#!/bin/bash
8+
set -e
9+
source eval_env_checks.sh
10+
check_lmms_eval
11+
12+
usage() {
13+
echo "Usage: $0 --model_id <model_id> --model_type <model_type> [--tasks <tasks> (comma-separated, e.g. mmlu,arc_challenge, default mmlu)] [--use_cache]"
14+
exit 1
15+
}
16+
17+
MODEL_ID_ARRAY=()
18+
MODEL_TYPE=""
19+
TASK_ARRAY=("chartqa") # default can be overwritten by user input
20+
BATCH_SIZE=1
21+
USE_CACHE=false # default: do not use cache
22+
# Parse arguments
23+
while [[ $# -gt 0 ]]; do
24+
case "$1" in
25+
--model_ids)
26+
shift
27+
while [[ $# -gt 0 && ! "$1" =~ ^-- ]]; do
28+
MODEL_ID_ARRAY+=("$1")
29+
shift
30+
done
31+
;;
32+
--model_type)
33+
MODEL_TYPE="$2"
34+
shift 2
35+
;;
36+
--batch_size)
37+
BATCH_SIZE="$2"
38+
shift 2
39+
;;
40+
--tasks)
41+
shift
42+
TASK_ARRAY=()
43+
while [[ $# -gt 0 && ! "$1" =~ ^-- ]]; do
44+
TASK_ARRAY+=("$1")
45+
shift
46+
done
47+
;;
48+
--use_cache)
49+
USE_CACHE=true
50+
shift
51+
;;
52+
*)
53+
echo "Unknown argument: $1"
54+
usage
55+
exit 1
56+
;;
57+
esac
58+
done
59+
if [[ ${#MODEL_ID_ARRAY[@]} -eq 0 ]]; then
60+
echo "Error: --model_ids is required"
61+
usage
62+
exit 1
63+
fi
64+
if [[ -z "$MODEL_TYPE" ]]; then
65+
echo "Error: --model_type is required"
66+
usage
67+
exit 1
68+
fi
69+
RESULTS_DIR="$(pwd)/mm_quality_eval_results"
70+
for MODEL_ID in "${MODEL_ID_ARRAY[@]}"; do
71+
# Replace all '/' with '_'
72+
SAFE_MODEL_ID="${MODEL_ID//\//_}"
73+
echo "======================== Eval Multi-modal Model Quality $MODLE_ID ======================"
74+
for TASK in "${TASK_ARRAY[@]}"; do
75+
OUTPUT_FILE="$(pwd)/${SAFE_MODEL_ID}_mm_quality_${TASK}.log"
76+
EVAL_CACHE_DB_PREFIX="/tmp/${SAFE_MODEL_ID}_mm_quality_${TASK}"
77+
mkdir -p "${EVAL_CACHE_DB_PREFIX}"
78+
echo "Running multi-modal model quality (accuracy) evaluation for model $MODEL_ID on task $TASK"
79+
80+
MAIN_PORT=12356
81+
LMMS_EVAL_CMD="accelerate launch \
82+
--main_process_port \"$MAIN_PORT\" \
83+
-m lmms_eval \
84+
--model \"$MODEL_TYPE\" \
85+
--model_args \"pretrained=$MODEL_ID\" \
86+
--tasks \"$TASK\" \
87+
--batch_size \"$BATCH_SIZE\" \
88+
--output_path \"$RESULTS_DIR\""
89+
90+
if $USE_CACHE; then
91+
LMMS_EVAL_CMD="$LMMS_EVAL_CMD --use_cache \"$EVAL_CACHE_DB_PREFIX\""
92+
fi
93+
94+
eval "$LMMS_EVAL_CMD" > "$OUTPUT_FILE" 2>&1
95+
echo "Quality eval output for task '$TASK' saved to $OUTPUT_FILE"
96+
done
97+
echo "======================== Eval Model Quality $MODEL_ID End =================="
98+
done

.github/workflows/1xH100_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
pip install uv
4747
pip install ${{ matrix.torch-spec }}
4848
uv pip install -r dev-requirements.txt
49-
pip install .
49+
pip install . --no-build-isolation
5050
pytest test/integration --verbose -s
5151
pytest test/dtypes/test_affine_quantized_float.py --verbose -s
5252
python test/quantization/quantize_/workflows/float8/test_float8_tensor.py

.github/workflows/1xL4_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
pip install uv
4747
pip install ${{ matrix.torch-spec }}
4848
uv pip install -r dev-requirements.txt
49-
pip install .
49+
pip install . --no-build-isolation
5050
pytest test/integration --verbose -s
5151
pytest test/dtypes/test_affine_quantized_float.py --verbose -s
5252
./test/float8/test_everything_single_gpu.sh

.github/workflows/4xH100_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ jobs:
4444
pip install uv
4545
pip install ${{ matrix.torch-spec }}
4646
uv pip install -r dev-requirements.txt
47-
pip install .
47+
pip install . --no-build-isolation
4848
./test/float8/test_everything_multi_gpu.sh
4949
./test/prototype/mx_formats/test_mx_dtensor.sh

.github/workflows/build_wheels_linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- packaging/**
99
- .github/workflows/build_wheels_linux.yml
1010
- setup.py
11+
- .github/scripts/**
1112
push:
1213
branches:
1314
- nightly

.github/workflows/dashboard_perf_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
${CONDA_RUN} python -m pip install --upgrade pip
3131
${CONDA_RUN} pip install ${{ matrix.torch-spec }}
3232
${CONDA_RUN} pip install -r dev-requirements.txt
33-
${CONDA_RUN} pip install .
33+
${CONDA_RUN} pip install . --no-build-isolation
3434
# SAM 2.1
3535
${CONDA_RUN} pip install -r examples/sam2_amg_server/requirements.txt
3636

.github/workflows/doc_build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ jobs:
4343
- name: Install dependencies
4444
run: |
4545
python -m pip install torch
46-
python -m pip install setuptools==78.1.1 --force-reinstall
47-
python -m pip install -e .
46+
python -m pip install -e . --no-build-isolation
4847
pip install -r dev-requirements.txt
4948
python -m pip install -r docs/requirements.txt
5049
- name: Build docs

.github/workflows/nightly_smoke_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ jobs:
3838
python -m pip install --upgrade pip
3939
pip install ${{ matrix.torch-spec }}
4040
pip install -r dev-requirements.txt
41-
python setup.py install
41+
pip install . --no-build-isolation
4242
pytest test --verbose -s

.github/workflows/regression_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
python -m pip install --upgrade pip
5151
pip install ${{ matrix.torch-spec }}
5252
pip install -r dev-requirements.txt
53-
pip install .
53+
pip install . --no-build-isolation
5454
export CONDA=$(dirname $(dirname $(which conda)))
5555
export LD_LIBRARY_PATH=$CONDA/lib/:$LD_LIBRARY_PATH
5656
pytest test --verbose -s
@@ -114,7 +114,7 @@ jobs:
114114
pip install ${{ matrix.torch-spec }}
115115
sed -i '${{ matrix.dev-requirements-overrides }}' dev-requirements.txt
116116
pip install -r dev-requirements.txt
117-
pip install .
117+
pip install . --no-build-isolation
118118
export CONDA=$(dirname $(dirname $(which conda)))
119119
export LD_LIBRARY_PATH=$CONDA/lib/:$LD_LIBRARY_PATH
120120
pytest test --verbose -s

0 commit comments

Comments
 (0)