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

ESM2 Finetuning refactor #574

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

ESM2 Finetuning refactor #574

wants to merge 16 commits into from

Conversation

farhadrgh
Copy link
Collaborator

@farhadrgh farhadrgh commented Jan 6, 2025

Description

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor
  • Documentation update
  • Other (please describe):

CI Pipeline Configuration

Configure CI behavior by checking relevant boxes below. This will automatically apply labels.

Note

By default, the notebooks validation tests are skipped unless explicitly enabled.

Usage

TODO: Add code snippet

Pre-submit Checklist

  • I have tested these changes locally
  • I have updated the documentation accordingly
  • I have added/updated tests as needed
  • All existing tests pass successfully

Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
@farhadrgh
Copy link
Collaborator Author

Ported over the changes from #546

farhadrgh and others added 9 commits January 6, 2025 12:52
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
@farhadrgh farhadrgh marked this pull request as ready for review January 9, 2025 17:58
farhadrgh and others added 4 commits January 9, 2025 10:49
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
Signed-off-by: Farhad Ramezanghorbani <[email protected]>
@farhadrgh
Copy link
Collaborator Author

/build-ci

@farhadrgh farhadrgh requested a review from sichu2023 January 13, 2025 16:25
@@ -180,12 +180,12 @@ def get_loss_reduction_class(self) -> Type[RegressorLossReduction]:
return RegressorLossReduction


class InMemorySingleValueDataset(Dataset):
class InMemorySingleValueDataset(InMemoryCSVDataset):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move this into dataset.py or anywhere under data?

@@ -205,12 +190,12 @@ def get_loss_reduction_class(self) -> Type[ClassifierLossReduction]:
return ClassifierLossReduction


class InMemoryPerTokenValueDataset(Dataset):
class InMemoryPerTokenValueDataset(InMemoryCSVDataset):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly should we move this under dataset.py? Like esm2/data/finetune/dataset.py or similar.

Comment on lines +611 to +618
dataset_class_options: Dict[str, Type[InMemoryCSVDataset]] = SUPPORTED_DATASETS

def dataset_class_type(desc: str) -> Type[InMemoryCSVDataset]:
try:
return dataset_class_options[desc]
except KeyError:
raise argparse.ArgumentTypeError(
f"Do not recognize key {desc}, valid options are: {dataset_class_options.keys()}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config_class: Type[BioBertConfig] = ESM2FineTuneSeqConfig,
metric_tracker: Callback | None = None,
overlap_grad_reduce: bool = True,
overlap_param_gather: bool = False, # TODO waiting for a NeMo fix
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dataset_class=args.dataset_class,
config_class=args.config_class,
overlap_grad_reduce=not args.no_overlap_grad_reduce,
overlap_param_gather=args.overlap_param_gather,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +574 to +578
parser.add_argument(
"--overlap-param-gather",
action="store_true",
default=False,
) # TODO waiting for a NeMo fix
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants