Skip to content

Commit 69ca4d8

Browse files
committed
update benchmark test robot
1 parent a7dc96d commit 69ca4d8

File tree

6 files changed

+48
-32
lines changed

6 files changed

+48
-32
lines changed

tests/bench/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ Note: `tests/bench` source code is for test robot only, therefore `yaml` configu
1414
source .venv/bin/activate
1515

1616
python -m pytest -s tests/bench/benchmark_math/execute_benchmark_math.py
17+
python -m pytest -s tests/bench/benchmark_appworld/execute_benchmark_appworld.py
18+
python -m pytest -s tests/bench/benchmark_countdown/execute_benchmark_countdown.py
1719
python -m pytest -s tests/bench/benchmark_learn2ask/execute_benchmark_learn2ask.py
1820
python -m pytest -s tests/bench/benchmark_frozenlake/execute_benchmark_frozenlake.py
19-
python -m pytest -s tests/bench/benchmark_countdown/execute_benchmark_countdown.py
20-
python -m pytest -s tests/bench/benchmark_appworld/execute_benchmark_appworld.py
2121

22-
python -m pytest -s tests/bench/benchmark_countdown/execute_benchmark_countdown.py::TestBenchmarkCountdown::test_01_begin_verl
23-
python -m pytest -s tests/bench/benchmark_math/execute_benchmark_math.py::TestBenchmarkMath::test_01_begin_verl
24-
python -m pytest -s tests/bench/benchmark_appworld/execute_benchmark_appworld.py::TestBenchmarkAppworld::test_01_begin_verl
25-
python -m pytest -s tests/bench/benchmark_learn2ask/execute_benchmark_learn2ask.py::TestBenchmarkLearnToAsk::test_02_begin_verl
22+
VERL_PYTHON="./.venv/bin/python" python -m pytest -s tests/bench/benchmark_math/execute_benchmark_math.py::TestBenchmarkMath::test_01_begin_verl
23+
VERL_PYTHON="./.venv/bin/python" python -m pytest -s tests/bench/benchmark_appworld/execute_benchmark_appworld.py::TestBenchmarkAppworld::test_01_begin_verl
24+
VERL_PYTHON="./.venv/bin/python" python -m pytest -s tests/bench/benchmark_countdown/execute_benchmark_countdown.py::TestBenchmarkCountdown::test_01_begin_verl
25+
VERL_PYTHON="./.venv/bin/python" python -m pytest -s tests/bench/benchmark_learn2ask/execute_benchmark_learn2ask.py::TestBenchmarkLearnToAsk::test_01_begin_verl
26+
VERL_PYTHON="./.venv/bin/python" python -m pytest -s tests/bench/benchmark_frozenlake/execute_benchmark_frozenlake.py::TestBenchmarkFrozenLake::test_01_begin_verl
2627
```

tests/bench/benchmark_appworld/execute_benchmark_appworld.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99

1010
class TestBenchmarkAppworld(BenchmarkTestCase):
11+
1112
def test_01_begin_verl(self):
1213
# get probe target, so as to get timeout settings
1314
BACKBONE = "verl"
@@ -16,7 +17,7 @@ def test_01_begin_verl(self):
1617
# tests/bench/benchmark_appworld/benchmark_appworld.py
1718
# tests/bench/benchmark_appworld/benchmark_appworld.yaml
1819
TARGET_NAME = f"benchmark_appworld_{BACKBONE}"
19-
PYTHON_EXECUTABLE = ".verl/bin/python"
20+
PYTHON_EXECUTABLE = os.environ.get("VERL_PYTHON", ".verl/bin/python")
2021
multi_nodes = False
2122

2223
self.execute_benchmark(
@@ -37,7 +38,7 @@ def test_02_begin_trinity(self):
3738
TEST_TARGET = "tests/bench/benchmark_appworld/benchmark_appworld_2nodes.yaml"
3839
PROBE_TARGET = "tests/bench/benchmark_appworld/benchmark_appworld.py->TestProbe"
3940
TARGET_NAME = f"benchmark_appworld_{BACKBONE}"
40-
PYTHON_EXECUTABLE = ".venv/bin/python"
41+
PYTHON_EXECUTABLE = os.environ.get("TRINITY_PYTHON", ".venv/bin/python")
4142
multi_nodes = True
4243

4344
self.execute_benchmark(

tests/bench/benchmark_countdown/execute_benchmark_countdown.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1+
import os
12
import unittest
23

34
from tests.bench.benchmark_base import BenchmarkTestCase
45

56

7+
8+
69
class TestBenchmarkCountdown(BenchmarkTestCase, unittest.TestCase):
10+
711
def test_01_begin_verl(self):
812
BACKBONE = "verl"
913
TEST_TARGET = "tests/bench/benchmark_countdown/benchmark_countdown.yaml"
1014
PROBE_TARGET = "tests/bench/benchmark_countdown/benchmark_countdown.py->TestProbe"
1115
TARGET_NAME = f"benchmark_countdown_{BACKBONE}"
12-
PYTHON_EXECUTABLE = ".verl/bin/python"
16+
PYTHON_EXECUTABLE = os.environ.get("VERL_PYTHON", ".verl/bin/python")
17+
1318
self.execute_benchmark(
1419
backbone=BACKBONE,
1520
test_target=TEST_TARGET,
@@ -23,7 +28,8 @@ def test_02_begin_trinity(self):
2328
TEST_TARGET = "tests/bench/benchmark_countdown/benchmark_countdown.yaml"
2429
PROBE_TARGET = "tests/bench/benchmark_countdown/benchmark_countdown.py->TestProbe"
2530
TARGET_NAME = f"benchmark_countdown_{BACKBONE}"
26-
PYTHON_EXECUTABLE = ".venv/bin/python"
31+
PYTHON_EXECUTABLE = os.environ.get("TRINITY_PYTHON", ".venv/bin/python")
32+
2733
self.execute_benchmark(
2834
backbone=BACKBONE,
2935
test_target=TEST_TARGET,

tests/bench/benchmark_frozenlake/execute_benchmark_frozenlake.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
import unittest
1+
import os
22

33
from tests.bench.benchmark_base import BenchmarkTestCase
44

55

66
class TestBenchmarkFrozenLake(BenchmarkTestCase):
7-
def test_01_begin_trinity(self):
8-
BACKBONE = "trinity"
7+
8+
def test_01_begin_verl(self):
9+
BACKBONE = "verl"
910
TEST_TARGET = "tests/bench/benchmark_frozenlake/benchmark_frozenlake.yaml"
1011
PROBE_TARGET = "tests/bench/benchmark_frozenlake/benchmark_frozenlake.py->TestProbe"
1112
TARGET_NAME = f"benchmark_frozenlake_{BACKBONE}"
12-
PYTHON_EXECUTABLE = ".venv/bin/python"
13+
PYTHON_EXECUTABLE = os.environ.get("VERL_PYTHON", ".verl/bin/python")
14+
1315
self.execute_benchmark(
1416
backbone=BACKBONE,
1517
test_target=TEST_TARGET,
@@ -18,12 +20,13 @@ def test_01_begin_trinity(self):
1820
python_executable=PYTHON_EXECUTABLE,
1921
)
2022

21-
def test_02_begin_verl(self):
22-
BACKBONE = "verl"
23+
def test_02_begin_trinity(self):
24+
BACKBONE = "trinity"
2325
TEST_TARGET = "tests/bench/benchmark_frozenlake/benchmark_frozenlake.yaml"
2426
PROBE_TARGET = "tests/bench/benchmark_frozenlake/benchmark_frozenlake.py->TestProbe"
2527
TARGET_NAME = f"benchmark_frozenlake_{BACKBONE}"
26-
PYTHON_EXECUTABLE = ".verl/bin/python"
28+
PYTHON_EXECUTABLE = os.environ.get("TRINITY_PYTHON", ".venv/bin/python")
29+
2730
self.execute_benchmark(
2831
backbone=BACKBONE,
2932
test_target=TEST_TARGET,

tests/bench/benchmark_learn2ask/execute_benchmark_learn2ask.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import unittest
1+
import os
22

33
from tests.bench.benchmark_base import BenchmarkTestCase
44

55

66
class TestBenchmarkLearnToAsk(BenchmarkTestCase):
7-
def test_01_begin_trinity(self):
7+
8+
def test_01_begin_verl(self):
89
# get probe target, so as to get timeout settings
9-
BACKBONE = "trinity"
10+
BACKBONE = "verl"
1011
TEST_TARGET = "tests/bench/benchmark_learn2ask/benchmark_learn2ask.yaml"
1112
PROBE_TARGET = "tests/bench/benchmark_learn2ask/benchmark_learn2ask.py->TestProbe"
1213
TARGET_NAME = f"benchmark_learn2ask_{BACKBONE}"
13-
# PYTHON_EXECUTABLE = "python"
14-
PYTHON_EXECUTABLE = ".venv/bin/python"
14+
PYTHON_EXECUTABLE = os.environ.get("VERL_PYTHON", ".verl/bin/python")
15+
1516
self.execute_benchmark(
1617
backbone=BACKBONE,
1718
test_target=TEST_TARGET,
@@ -20,14 +21,14 @@ def test_01_begin_trinity(self):
2021
python_executable=PYTHON_EXECUTABLE,
2122
)
2223

23-
def test_02_begin_verl(self):
24+
def test_02_begin_trinity(self):
2425
# get probe target, so as to get timeout settings
25-
BACKBONE = "verl"
26+
BACKBONE = "trinity"
2627
TEST_TARGET = "tests/bench/benchmark_learn2ask/benchmark_learn2ask.yaml"
2728
PROBE_TARGET = "tests/bench/benchmark_learn2ask/benchmark_learn2ask.py->TestProbe"
2829
TARGET_NAME = f"benchmark_learn2ask_{BACKBONE}"
29-
# PYTHON_EXECUTABLE = "python"
30-
PYTHON_EXECUTABLE = ".verl/bin/python"
30+
PYTHON_EXECUTABLE = os.environ.get("TRINITY_PYTHON", ".venv/bin/python")
31+
3132
self.execute_benchmark(
3233
backbone=BACKBONE,
3334
test_target=TEST_TARGET,

tests/bench/benchmark_math/execute_benchmark_math.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
import os
12
from tests.bench.benchmark_base import BenchmarkTestCase
23

34

45
class TestBenchmarkMath(BenchmarkTestCase):
5-
def test_02_begin_trinity(self):
6+
7+
def test_01_begin_verl(self):
68
# get probe target, so as to get timeout settings
7-
BACKBONE = "trinity"
9+
BACKBONE = "verl"
810
TEST_TARGET = "tests/bench/benchmark_math/benchmark_math.yaml"
911
PROBE_TARGET = "tests/bench/benchmark_math/benchmark_math.py->TestProbe"
1012
TARGET_NAME = f"benchmark_math_{BACKBONE}"
11-
PYTHON_EXECUTABLE = ".venv/bin/python"
13+
PYTHON_EXECUTABLE = os.environ.get("VERL_PYTHON", ".verl/bin/python")
14+
1215
self.execute_benchmark(
1316
backbone=BACKBONE,
1417
test_target=TEST_TARGET,
@@ -17,13 +20,14 @@ def test_02_begin_trinity(self):
1720
python_executable=PYTHON_EXECUTABLE,
1821
)
1922

20-
def test_01_begin_verl(self):
23+
def test_02_begin_trinity(self):
2124
# get probe target, so as to get timeout settings
22-
BACKBONE = "verl"
25+
BACKBONE = "trinity"
2326
TEST_TARGET = "tests/bench/benchmark_math/benchmark_math.yaml"
2427
PROBE_TARGET = "tests/bench/benchmark_math/benchmark_math.py->TestProbe"
2528
TARGET_NAME = f"benchmark_math_{BACKBONE}"
26-
PYTHON_EXECUTABLE = ".verl/bin/python"
29+
PYTHON_EXECUTABLE = os.environ.get("TRINITY_PYTHON", ".venv/bin/python")
30+
2731
self.execute_benchmark(
2832
backbone=BACKBONE,
2933
test_target=TEST_TARGET,

0 commit comments

Comments
 (0)