mirror of
https://github.com/facebookresearch/fairseq.git
synced 2024-09-11 17:25:31 +03:00
Summary: this adds a hydra_train binary that uses hydra configs/command line overrides instead of argparse use case 1: built in configs + overrides from command line ``` python fairseq_cli/hydra_train.py distributed_training.distributed_world_size=1 dataset.batch_size=2 task.data=/private/home/myleott/data/data-bin/wikitext-103-roberta-bpe-bin/ model=transformer_lm/transformer_lm_gpt task=language_modeling optimization.max_update=5000 ``` use case 2: use an external config that is used instead of bundled configs (but dataclass defaults still work) ``` python fairseq_cli/hydra_train.py --config-path ~/fairseq-py-dev/lm --config-name wiki103 ``` the config file contains this: ``` # package _group_ model: _name: transformer_lm distributed_training: distributed_world_size: 1 dataset: batch_size: 2 task: _name: language_modeling data: /private/home/myleott/data/data-bin/wikitext-103-roberta-bpe-bin/ add_bos_token: false max_target_positions: 1024 optimization: max_update: 50000 lr: [ 0.25 ] criterion: cross_entropy optimizer: adam lr_scheduler: _name: cosine ``` use case 3: use an external config directory that provides additional configs for e.g. models python fairseq_cli/hydra_train.py distributed_training.distributed_world_size=1 dataset.batch_size=2 task.data=/private/home/myleott/data/data-bin/wikitext-103-roberta-bpe-bin/ model=transformer_lm/2_layers task=language_modeling optimization.max_update=5000 --config-dir ~/fairseq-py-dev/lm/hydra where ~/fairseq-py-dev/lm/hydra has the following structure: - model -- transformer_lm --- 2_layers.yaml and inside 2_layers.yaml is a copy of transformer_lm_gpt.yaml but with decoder_layers set to 2 Pull Request resolved: https://github.com/fairinternal/fairseq-py/pull/1393 Reviewed By: myleott Differential Revision: D24722252 Pulled By: alexeib fbshipit-source-id: 758ea431fa099cd7c0e4daf41eff680df1d3b841 |
||
---|---|---|
.. | ||
gpu | ||
speech_recognition | ||
__init__.py | ||
test_average_checkpoints.py | ||
test_backtranslation_dataset.py | ||
test_binaries.py | ||
test_bmuf.py | ||
test_character_token_embedder.py | ||
test_concat_dataset.py | ||
test_constraints.py | ||
test_convtbc.py | ||
test_dictionary.py | ||
test_export.py | ||
test_file_io.py | ||
test_fp16_optimizer.py | ||
test_inference_dropout.py | ||
test_iterators.py | ||
test_label_smoothing.py | ||
test_lstm_jitable.py | ||
test_memory_efficient_fp16.py | ||
test_metrics.py | ||
test_multi_corpus_sampled_dataset.py | ||
test_multihead_attention.py | ||
test_noising.py | ||
test_reproducibility.py | ||
test_resampling_dataset.py | ||
test_sequence_generator.py | ||
test_sequence_scorer.py | ||
test_sparse_multihead_attention.py | ||
test_token_block_dataset.py | ||
test_train.py | ||
test_utils.py | ||
utils.py |