Skip to content

Commit 084fb67

Browse files
committed
re-test new axlearn testings
1 parent bbd7483 commit 084fb67

File tree

3 files changed

+26
-32
lines changed

3 files changed

+26
-32
lines changed

.github/container/test-axlearn.sh

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ usage() {
1111
echo ""
1212
echo " OPTIONS DESCRIPTION"
1313
echo " -d, --directory DIR Directory to run tests in."
14-
echo " Default: 'axlearn/axlearn/common'."
14+
echo " Default: 'opt/axlearn'."
1515
echo " -t, --test-files FILES Pattern for test files to run."
16-
echo " Default: '*_test.py'."
16+
echo " Default: 'axlearn/common/*_test.py'."
1717
echo " -o, --output DIRECTORY Output directory for logs and summary."
1818
echo " Default: 'test_runs/<timestamp>'."
1919
echo " -h, --help Show this help message and exit."
@@ -39,7 +39,7 @@ run_tests() {
3939
}
4040

4141
# DEFAULT VALUES
42-
DIR='/opt/axlearn/axlearn/common'
42+
DIR='/opt/axlearn'
4343
TEST_FILES=()
4444
OUTPUT_DIRECTORY=''
4545

@@ -95,15 +95,6 @@ LOG_DIRECTORY="${OUTPUT_DIRECTORY}/logs"
9595

9696
mkdir -p "${LOG_DIRECTORY}"
9797

98-
if [ "${#TEST_FILES[@]}" -gt 0 ]; then
99-
echo " Test Files:"
100-
for f in "${TEST_FILES[@]}"; do
101-
echo " $f"
102-
done
103-
else
104-
echo " Test Files Pattern: '*_test.py' (default)"
105-
fi
106-
10798
# DEPENDENCIES
10899
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
109100
pip install timm transformers scikit-learn grain evaluate prefixed wandb
@@ -115,26 +106,28 @@ curl https://huggingface.co/FacebookAI/roberta-base/raw/main/merges.txt -o /opt/
115106
curl https://huggingface.co/FacebookAI/roberta-base/raw/main/vocab.json -o /opt/axlearn/axlearn/data/tokenizers/bpe/roberta-base-vocab.json
116107

117108
# RETRIEVE TEST FILES
109+
expanded_test_files=()
118110
if [ "${#TEST_FILES[@]}" -eq 0 ]; then
119-
TEST_FILES=("*_test.py")
111+
# if we are not giving anything for --test-files than we can match all those *_test.py files
112+
readarray -t expanded_test_files < <(find . -name "*_test.py" -type f)
113+
# otherwise let's check in the --test-files pattern
114+
else
115+
for pattern in "${TEST_FILES[@]}"; do
116+
readarray -t found_files < <(find . -name "$pattern" -type f)
117+
if [ ${#found_files[@]} -gt 0 ]; then
118+
expanded_test_files+=( "${found_files[@]}" )
119+
else
120+
echo "Warning: No files found matching pattern '$pattern'"
121+
fi
122+
done
120123
fi
121124

122-
expanded_test_files=()
123-
for pattern in "${TEST_FILES[@]}"; do
124-
# retrieve all the files
125-
files=( $pattern )
126-
if [ "${#files[@]}" -gt 0 ]; then
127-
expanded_test_files+=( "${files[@]}" )
128-
else
129-
echo "Warning: No files matched pattern '$pattern'"
130-
fi
131-
done
132-
133125
if [ "${#expanded_test_files[@]}" -eq 0 ]; then
134126
echo "No test files found to run."
135127
exit 1
136128
fi
137129

130+
# EXCLUDE PATTERNS
138131
EXCLUDE_PATTERNS=("array_serialization_test.py"
139132
"t5_test.py" # tensorflow bug
140133
"loss_test.py"
@@ -185,11 +178,12 @@ done
185178

186179

187180
# RUN TESTS
188-
TEST_8_DEVICES_FILES=("gda_test.py"
189-
"input_base_test.py"
190-
"input_dispatch_test.py"
191-
"trainer_test.py"
192-
"utils_test.py"
181+
TEST_8_DEVICES_FILES=(
182+
"axlearn/common/gda_test.py"
183+
"axlearn/common/input_base_test.py"
184+
"axlearn/common/input_dispatch_test.py"
185+
"axlearn/common/trainer_test.py"
186+
"axlearn/common/utils_test.py"
193187
)
194188
TEST_8_DEVICES_WITH_PATHS=()
195189
for file in "${TEST_8_DEVICES_FILES[@]}"; do

.github/eks-workflow-files/axlearn/axlearn-job.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222
LOG_DIR="/output/${RUN_ID}"
2323
mkdir -p ${LOG_DIR}
2424
# test on JAX, make sure 8 devices are visible
25-
pytest-xdist.sh 8 4 ${LOG_DIR}/axlearn-unittests.jsonl test-axlearn.sh --directory "." --output ${LOG_DIR} --test-files "/opt/axlearn/axlearn/common/*_test.py"
25+
pytest-xdist.sh 8 4 ${LOG_DIR}/axlearn-unittests.jsonl test-axlearn.sh --directory "." --output ${LOG_DIR} --test-files "axlearn/common/*_test.py"
2626
env:
2727
- name: RUN_ID
2828
value: PLACEHOLDER

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ jobs:
210210
CUDA_IMAGE: ${{ needs.metadata.outputs.CUDA_IMAGE }}
211211
MANIFEST_ARTIFACT_NAME: ${{ needs.metadata.outputs.MANIFEST_ARTIFACT_NAME }}
212212
SOURCE_URLREFS: ${{ needs.bump-manifest.outputs.SOURCE_URLREFS }}
213-
MODE: ${{ github.event_name == 'workflow_dispatch' && inputs.MODE || 'full' }}
213+
MODE: "axlearn" #${{ github.event_name == 'workflow_dispatch' && inputs.MODE || 'full' }}
214214
secrets: inherit
215215

216216
arm64:
@@ -222,7 +222,7 @@ jobs:
222222
CUDA_IMAGE: ${{ needs.metadata.outputs.CUDA_IMAGE }}
223223
MANIFEST_ARTIFACT_NAME: ${{ needs.metadata.outputs.MANIFEST_ARTIFACT_NAME }}
224224
SOURCE_URLREFS: ${{ needs.bump-manifest.outputs.SOURCE_URLREFS }}
225-
MODE: ${{ github.event_name == 'workflow_dispatch' && inputs.MODE || 'full' }}
225+
MODE: "axlearn" #${{ github.event_name == 'workflow_dispatch' && inputs.MODE || 'full' }}
226226
secrets: inherit
227227

228228
# Only merge if everything succeeds

0 commit comments

Comments
 (0)