Skip to content

Commit

Permalink
Move test_result_analyzer.py to the test directory. (#6130)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysiraichi authored and golechwierowicz committed Jan 12, 2024
1 parent efd5e58 commit 1fbe935
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
5 changes: 0 additions & 5 deletions .circleci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ function run_torch_xla_python_tests() {
# echo "Running MNIST Test"
# python test/test_train_mp_mnist_amp.py --fake_data --num_epochs=1
fi
elif [[ "$RUN_XLA_OP_TESTS1" == "xla_op1" ]]; then
# Benchmark tests.
# Only run on CPU, for xla_op1.
echo "Running Benchmark tests."
./benchmarks/test/run_tests.sh
fi
fi
popd
Expand Down
12 changes: 0 additions & 12 deletions benchmarks/test/run_tests.sh

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions test/benchmarks/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function run_python_tests {
python3 "$CDIR/test_experiment_runner.py"
python3 "$CDIR/test_benchmark_experiment.py"
python3 "$CDIR/test_benchmark_model.py"
python3 "$CDIR/test_result_analyzer.py"
}

function run_tests {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import argparse
import functools
import json
import numpy
import unittest
import os
Expand All @@ -10,6 +10,8 @@
fns_skip_head = (numpy.mean, numpy.std)
fns_all = fns_whole + fns_skip_head

_DATALINE = None


def apply(fn, data):
return fn(data)
Expand All @@ -19,17 +21,17 @@ def apply_skip_head(fn, data):
return fn(data[1:])


@functools.cache
def get_dirname():
return os.path.dirname(__file__)


@functools.cache
def get_dataline():
import json
example_json = os.path.join(get_dirname(), "example.json")
with open(example_json, "r") as f:
return json.load(f)
global _DATALINE
if _DATALINE is None:
example_json = os.path.join(get_dirname(), "output-example.json")
with open(example_json, "r") as f:
_DATALINE = json.load(f)
return _DATALINE


class TestResultAnalyzer(unittest.TestCase):
Expand Down

0 comments on commit 1fbe935

Please sign in to comment.