Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remaining test config parameters #131

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
189 changes: 121 additions & 68 deletions taskcluster/translations_taskgraph/actions/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,127 @@ def can_train(parameters):
# TODO: this should probably be specified in ci/config.yml
"enum": ["clean-corpus", "clean-mono", "bicleaner", "bicleaner-ai", "merge-corpus", "merge-devset", "merge-mono", "train-vocab", "train-backwards", "evaluate-backwards"],
},
"experiment": {
"type": "object",
"default": defaults["experiment"],
"properties": {
"name": {
"type": "string",
"description": "A name for the experiment",
},
"src": {
"type": "string",
"description": "The src locale to train",
},
"trg": {
"type": "string",
"description": "The trg locale to train",
},
"teacher-ensemble": {
"type": "number",
"description": "Number of teachers to train",
},
"backward-model": {
"type": "string",
"description": "???",
},
"vocab": {
"type": "string",
"description": "???",
},
"mono-max-sentences-src": {
"type": "number",
"description": "limits per downloaded src dataset",
},
"mono-max-sentences-trg": {
"type": "number",
"description": "limits per downloaded trg dataset",
},
"split-length": {
"type": "number",
"description": "???",
},
"spm-sample-size": {
"type": "number",
"description": "vocabularly training sample size",
},
"best-model": {
"type": "string",
"description": "best model to use for training",
},
"bicleaner": {
"properties": {
"default-threshold": {
"type": "number",
"description": "bicleaner threshold",
},
"dataset-thresholds": {
"type": "object",
"additionalProperties": {
"type": "number",
}
},
},
"required": [
"default-threshold",
],
},
},
"required": [
"name",
"src",
"trg",
"bicleaner",
],
},
"marian-args": {
"type": "object",
"default": defaults["marian-args"],
"properties": {
"training-backward": {
"type": "object",
"additionalProperties": {
"type": "string",
},
},
"training-teacher-base": {
"type": "object",
"additionalProperties": {
"type": "string",
},
},
"training-teacher-finetuned": {
"type": "object",
"additionalProperties": {
"type": "string",
},
},
"training-student": {
"type": "object",
"additionalProperties": {
"type": "string",
},
},
"training-student-finetuned": {
"type": "object",
"additionalProperties": {
"type": "string",
},
},
"decoding-backward": {
"type": "object",
"additionalProperties": {
"type": "string",
},
},
"decoding-teacher": {
"type": "object",
"additionalProperties": {
"type": "string",
},
},
},
},
"datasets": {
"type": "object",
"default": defaults["datasets"],
Expand Down Expand Up @@ -98,74 +219,6 @@ def can_train(parameters):
},
},
},
"marian-args": {
"type": "object",
"default": defaults["marian-args"],
"properties": {
"training-backward": {
"type": "object",
"additionalProperties": {
"type": "string",
},
},
},
},
"experiment": {
"type": "object",
"default": defaults["experiment"],
"properties": {
"src": {
"type": "string",
"description": "The src locale to train",
},
"trg": {
"type": "string",
"description": "The trg locale to train",
},
"bicleaner": {
"properties": {
"default-threshold": {
"type": "number",
"description": "bicleaner threshold",
},
"dataset-thresholds": {
"type": "object",
"properties": {
"opus_ada83/v1": {
"type": "number",
},
"mtdata_Neulab-tedtalks_train-1-eng-rus": {
"type": "number",
},
},
"additionalProperties": {
"type": "number",
}
},
},
},
"best-model": {
"type": "string",
"description": "best model to use for training",
},
"spm-sample-size": {
"type": "number",
"description": "vocabularly training sample size",
},
"mono-max-sentences-src": {
"type": "number",
"description": "limits per downloaded src dataset",
},
"mono-max-sentences-trg": {
"type": "number",
"description": "limits per downloaded trg dataset",
},
},
"required": [
"src",
"trg",
],
},
},
"required": [
"target-stage",
Expand Down
65 changes: 55 additions & 10 deletions taskcluster/translations_taskgraph/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,24 @@ def get_defaults(_):
"training_config": {
"target-stage": "evaluate-backwards",
"experiment": {
"name": "training pipeline test config",
"src": "ru",
"trg": "en",
"teacher-ensemble": 2,
"backward-model": "",
"vocab": "",
"mono-max-sentences-trg": 200000,
"mono-max-sentences-src": 100000,
"split-length": 100000,
"spm-sample-size": 100000,
"best-model": "chrf",
"bicleaner": {
"default-threshold": 0.5,
"dataset-thresholds": {
"opus_ada83/v1": 0.0,
"mtdata_Neulab-tedtalks_train-1-eng-rus": 0.6,
},
},
"best-model": "chrf",
"spm-sample-size": 100000,
"mono-max-sentences-trg": 200000,
"mono-max-sentences-src": 100000,
},
"marian-args": {
"training-backward": {
Expand All @@ -36,6 +41,37 @@ def get_defaults(_):
"valid-freq": "100",
"after": "500u",
},
"training-teacher-base": {
"disp-freq": "10",
"save-freq": "100",
"valid-freq": "100",
"after": "500u",
},
"training-teacher-finetuned": {
"disp-freq": "10",
"save-freq": "100",
"valid-freq": "100",
"after": "500u",
},
"training-student": {
"disp-freq": "10",
"save-freq": "100",
"valid-freq": "100",
"after": "500u",
},
"training-student-finetuned": {
"disp-freq": "10",
"save-freq": "100",
"valid-freq": "100",
"after": "500u",
},
"decoding-backward": {
"mini-batch-words": "2000",
},
"decoding-teacher": {
"mini-batch-words": "1000",
"precision": "float16",
},
},
# These will never be used in practice, but specifying them ensures
# that we always generate at least one task for each kind, which helps
Expand Down Expand Up @@ -70,23 +106,32 @@ def get_defaults(_):
Required("target-stage"): str,
Required("marian-args"): {
Optional("training-backward"): {str: str},
Optional("training-teacher-base"): {str: str},
Optional("training-teacher-finetuned"): {str: str},
Optional("training-student"): {str: str},
Optional("training-student-finetuned"): {str: str},
Optional("decoding-backward"): {str: str},
Optional("decoding-teacher"): {str: str},
},
Required("experiment"): {
Required("name"): str,
Required("src"): str,
Required("trg"): str,
Required("teacher-ensemble"): int,
Required("backward-model"): str,
Required("vocab"): str,
Required("mono-max-sentences-trg"): int,
Required("mono-max-sentences-src"): int,
Required("split-length"): int,
Required("spm-sample-size"): int,
Required("best-model"): str,
Required("bicleaner"): {
Required("default-threshold"): float,
Optional("dataset-thresholds"): {
str: float,
},
},
Required("best-model"): str,
Required("spm-sample-size"): int,
Required("mono-max-sentences-trg"): int,
Required("mono-max-sentences-src"): int,
},
Optional("bicleaner_threshold"): str,
Optional("train_vocab_sample_size"): str,
Optional("datasets"): {
str: [str],
},
Expand Down