Alternate fixed-rate scaling configurations across repeats
This commit is contained in:
+5
-3
@@ -433,11 +433,13 @@ def block(args, output, config, variant, repeats):
|
|||||||
|
|
||||||
def series(args, output):
|
def series(args, output):
|
||||||
every = range(args.first_repeat, args.first_repeat + args.repeats)
|
every = range(args.first_repeat, args.first_repeat + args.repeats)
|
||||||
for config in args.configs.split(","):
|
configs = args.configs.split(",")
|
||||||
if len(args.variants) == 1:
|
if not args.rates:
|
||||||
|
for config in configs:
|
||||||
block(args, output, config, args.variants[0], every)
|
block(args, output, config, args.variants[0], every)
|
||||||
continue
|
return
|
||||||
for repeat in every:
|
for repeat in every:
|
||||||
|
for config in configs:
|
||||||
for variant in args.variants:
|
for variant in args.variants:
|
||||||
block(args, output, config, variant, [repeat])
|
block(args, output, config, variant, [repeat])
|
||||||
|
|
||||||
|
|||||||
@@ -52,3 +52,29 @@ def test_disturbed_runs_never_enter_summary(
|
|||||||
scaling.block(args, output, "1x1", "base", [1])
|
scaling.block(args, output, "1x1", "base", [1])
|
||||||
output.writerows.assert_not_called()
|
output.writerows.assert_not_called()
|
||||||
assert args.rejected.writerow.call_count == 2
|
assert args.rejected.writerow.call_count == 2
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
("fixed", "expected"),
|
||||||
|
[
|
||||||
|
(True, [("4x1", [2]), ("8x0.5", [2]), ("4x1", [3]), ("8x0.5", [3])]),
|
||||||
|
(False, [("4x1", [2, 3]), ("8x0.5", [2, 3])]),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
def test_series_order(
|
||||||
|
scaling: ModuleType,
|
||||||
|
monkeypatch: pytest.MonkeyPatch,
|
||||||
|
fixed: bool,
|
||||||
|
expected: list[tuple[str, list[int]]],
|
||||||
|
) -> None:
|
||||||
|
args = SimpleNamespace(
|
||||||
|
first_repeat=2,
|
||||||
|
repeats=2,
|
||||||
|
configs="4x1,8x0.5",
|
||||||
|
variants=["pinned"],
|
||||||
|
rates="3040,4560" if fixed else None,
|
||||||
|
)
|
||||||
|
block = Mock()
|
||||||
|
monkeypatch.setattr(scaling, "block", block)
|
||||||
|
scaling.series(args, Mock())
|
||||||
|
assert [(call.args[2], list(call.args[4])) for call in block.call_args_list] == expected
|
||||||
|
|||||||
Reference in New Issue
Block a user