def experiment_definitions():
    rm4 = combos(
        bind_nested("task", utils.tldr_task),
        bind("mpi", 1),
        bind_nested("reward_model_spec", utils.rm4()),
        bind(
            "input_path",
            "https://openaipublic.blob.core.windows.net/summarize-from-feedback/samples/sup4_ppo_rm4"
        ),
    )

    test = combos(
        bind_nested("task", utils.test_task),
        bind_nested("reward_model_spec", utils.random_teeny_model_spec()),
        bind("mpi", 1),
        bind(
            "input_path",
            "https://openaipublic.blob.core.windows.net/summarize-from-feedback/samples/test"
        ),
    )
    test_cpu = combos(
        test,
        bind_nested("reward_model_spec", utils.stub_model_spec()),
    )
    tldrtest = combos(
        bind_nested("task", utils.test_tldr_task),
        bind_nested("reward_model_spec",
                    utils.random_teeny_model_spec(n_shards=2)),
        bind("mpi", 2),
    )
    return locals()
Beispiel #2
0
def random_teeny_model_spec(**run_params):
    return combos(
        bind(
            "load_path",
            "https://openaipublic.blob.core.windows.net/summarize-from-feedback/models/random-teeny"
        ),
        *[bind(f"run_params.{k}", v) for (k, v) in run_params.items()],
    )
Beispiel #3
0
 def fn(name, trials, **extra_args):
     # Bind remaining extra arguments from the defaults and from the command line
     trials = combos(
         *[bind(k, v) for k, v in default_bindings.items()],
         trials,
         *[bind(k, v) for k, v in extra_args.items()],
     )
     exp_jobs = get_experiment_jobs(name, main_fn, trials)
     return jobs.multilaunch(exp_jobs)
def experiment_definitions():
    sup_xl = combos(
        bind_nested("model_spec", utils.sup4()),
        bind_nested("task", utils.tldr_task),
        bind("query_dataset_split", "valid"),
        bind("mpi", 1),
        bind("num_queries", 128),
        bind("sample.temperature", 0.01),
    )

    ppo_xl = combos(
        bind_nested("model_spec", utils.sup4_ppo_rm4()),
        bind_nested("task", utils.tldr_task),
        bind("query_dataset_split", "valid"),
        bind("mpi", 1),
        bind("num_queries", 128),
        bind("sample.temperature", 0.01),
    )

    test = combos(
        bind_nested("task", utils.test_task),
        bind_nested("model_spec", utils.random_teeny_model_spec(n_shards=2)),
        bind_nested("orig_model_spec", utils.random_teeny_model_spec(n_shards=2)),
        bind("query_dataset_split", "train"),
        bind("mpi", 2),
        bind("num_queries", 8),
        bind("responses_per_query", 2),
        bind("responses_per_query_per_batch", 1),
    )

    test_cpu = combos(
        test,
        bind("model_spec.device", "cpu"),
        bind("orig_model_spec.device", "cpu"),
        bind("fp16_activations", False),
    )
    return locals()
Beispiel #5
0
def load_model_spec(load_path, short_name=None, **run_params):
    return combos(
        bind("load_path", load_path),
        bind("short_name", short_name),
        *[bind(f"run_params.{k}", v) for (k, v) in run_params.items()],
    )
Beispiel #6
0
from functools import partial

from summarize_from_feedback import encoder
from summarize_from_feedback.utils.combos import combos, bind, options_shortdesc


def seeds(n):
    return options_shortdesc("seed", "s", range(1, 1 + n))


cnndm_task = combos(
    bind("query.format_str", "Article:\n{article}\n\nTL;DR:\n"),
    bind("query.dataset", "cnndm"),
    bind("query.length", 2047 - 128),
    bind("response.length", 128),
    bind("query.truncate_text", "\n"),
    bind("query.truncate_field", "article"),
    bind("query.pad_side", "left"),
    bind("response.truncate_token", 50256),  # endoftext
    bind("response.ref_format_str", "{reference}"),
)

cnndm_task_filtered = combos(
    cnndm_task,
    bind("query.dataset", "cnndm_filtered"),
    bind("query.length", 2047 - 64),
    bind("response.length", 64),
)

cnndm_task_filtered_short = combos(
    cnndm_task,