-
Notifications
You must be signed in to change notification settings - Fork 428
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
Refactor in_context_learning_evaluation.py #2713
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oooh hoo hoo. I love a good refactor |
dakinggg
reviewed
Nov 15, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left first round of comments. Thank you for taking this on!
dakinggg
reviewed
Jan 25, 2024
fix spelling Co-authored-by: Daniel King <[email protected]>
fix spelling Co-authored-by: Daniel King <[email protected]>
fix spelling Co-authored-by: Daniel King <[email protected]>
fix spelling Co-authored-by: Daniel King <[email protected]>
fix spelling Co-authored-by: Daniel King <[email protected]>
fix spelling Co-authored-by: Daniel King <[email protected]>
dakinggg
approved these changes
Jan 26, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
ShashankMosaicML
pushed a commit
to ShashankMosaicML/composer
that referenced
this pull request
Feb 3, 2024
* extremely wip commit w/ ICLdataset class * more extremely broken wip * add split keys * first pass at moving QA to new format * linting * linting * tests pass! * fix repeated defaults, gold_idx --> gold * basic HF parsing but test not passing * fix cot. wip * del device and world_size from tests * change to .map * fix schema * tests passing w/ collate refactor * finish HF tests * add hf batch parsing * linting * add doc strings, rm hf_parsing_vars * revert question_prelimiter back to prelimiter * fix tests * add more docstrings * add doc strings, fix hf w/ categories * add doc strings and default check * linting * add temperature * remove need for hf:// on hf links * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * fix comments, add test for check hf uri, still wip * add gpu tests back * update fix_eos_on_preamble * update comments * add return types * typing, comments * init RAG Generation task * init _construct_context for RAG eval * fix context key, move hf test dataset, few docstrings * fix docstrings, add second path for schema * init collate_fn, _tokenize_example functions (bug exists) * fix typo in warning error * remove canonical_solution from batch * missed one canonical_sllution * remove encoded dataset to have just one dataset var * rename sample to example * improve comment * edit RAGtask * rm hf parsing func * fix docstring, rename fewshot fun * docstring * change default split_batch to check types * remove need to set split_keys * doc string update * improve comments * rm stacked_keys for tokenize_labels bool * initial wip in comments * make _conv_tokens_to_tensors func * wip - sketch out batch_mappings * linting and debugging statements to help me remember where I'm doing wip * all tests except one sus schema test passing * fix missing fewshot for schema * rm temperature add generation_kwargs * add defaults that are currently set in llm-foundry builders.py * fix defaults in tests, add some comments * tests wip * tests for new funcs * rm RAG task * more docstring * tests passing * wip * wip * add dict to data_spec * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Apply suggestions from code review comment improvements Co-authored-by: Daniel King <[email protected]> * default_batch to base_batch and some docstrings * update comments and fix test. move spacing to default get_answer * improved docstrings * finish schema/mc tests * address pr review comments * lintign * fixing import, add type * update comments * update keys * add typechecks for token ids * rm outdated test * fix tests * add microbatch test * pyright fixes * linting attempts * linting wip * fix linting * add early stopping and do_normalization documentation * fix linting * fix linting * fix final dist test issue * fix isort * fix linting * fix docstrings * fix docstrings * add warning filters * fix warnings * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * add capitalization * revert default changes * change update_generate_kwargs to public * fix type * move pad_tok_id error --------- Co-authored-by: Daniel King <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: Eitan Turok <[email protected]>
ShashankMosaicML
pushed a commit
to ShashankMosaicML/composer
that referenced
this pull request
Feb 3, 2024
* extremely wip commit w/ ICLdataset class * more extremely broken wip * add split keys * first pass at moving QA to new format * linting * linting * tests pass! * fix repeated defaults, gold_idx --> gold * basic HF parsing but test not passing * fix cot. wip * del device and world_size from tests * change to .map * fix schema * tests passing w/ collate refactor * finish HF tests * add hf batch parsing * linting * add doc strings, rm hf_parsing_vars * revert question_prelimiter back to prelimiter * fix tests * add more docstrings * add doc strings, fix hf w/ categories * add doc strings and default check * linting * add temperature * remove need for hf:// on hf links * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * fix comments, add test for check hf uri, still wip * add gpu tests back * update fix_eos_on_preamble * update comments * add return types * typing, comments * init RAG Generation task * init _construct_context for RAG eval * fix context key, move hf test dataset, few docstrings * fix docstrings, add second path for schema * init collate_fn, _tokenize_example functions (bug exists) * fix typo in warning error * remove canonical_solution from batch * missed one canonical_sllution * remove encoded dataset to have just one dataset var * rename sample to example * improve comment * edit RAGtask * rm hf parsing func * fix docstring, rename fewshot fun * docstring * change default split_batch to check types * remove need to set split_keys * doc string update * improve comments * rm stacked_keys for tokenize_labels bool * initial wip in comments * make _conv_tokens_to_tensors func * wip - sketch out batch_mappings * linting and debugging statements to help me remember where I'm doing wip * all tests except one sus schema test passing * fix missing fewshot for schema * rm temperature add generation_kwargs * add defaults that are currently set in llm-foundry builders.py * fix defaults in tests, add some comments * tests wip * tests for new funcs * rm RAG task * more docstring * tests passing * wip * wip * add dict to data_spec * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Apply suggestions from code review comment improvements Co-authored-by: Daniel King <[email protected]> * default_batch to base_batch and some docstrings * update comments and fix test. move spacing to default get_answer * improved docstrings * finish schema/mc tests * address pr review comments * lintign * fixing import, add type * update comments * update keys * add typechecks for token ids * rm outdated test * fix tests * add microbatch test * pyright fixes * linting attempts * linting wip * fix linting * add early stopping and do_normalization documentation * fix linting * fix linting * fix final dist test issue * fix isort * fix linting * fix docstrings * fix docstrings * add warning filters * fix warnings * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * add capitalization * revert default changes * change update_generate_kwargs to public * fix type * move pad_tok_id error --------- Co-authored-by: Daniel King <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: Eitan Turok <[email protected]>
ShashankMosaicML
pushed a commit
to ShashankMosaicML/composer
that referenced
this pull request
Feb 6, 2024
* extremely wip commit w/ ICLdataset class * more extremely broken wip * add split keys * first pass at moving QA to new format * linting * linting * tests pass! * fix repeated defaults, gold_idx --> gold * basic HF parsing but test not passing * fix cot. wip * del device and world_size from tests * change to .map * fix schema * tests passing w/ collate refactor * finish HF tests * add hf batch parsing * linting * add doc strings, rm hf_parsing_vars * revert question_prelimiter back to prelimiter * fix tests * add more docstrings * add doc strings, fix hf w/ categories * add doc strings and default check * linting * add temperature * remove need for hf:// on hf links * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * fix comments, add test for check hf uri, still wip * add gpu tests back * update fix_eos_on_preamble * update comments * add return types * typing, comments * init RAG Generation task * init _construct_context for RAG eval * fix context key, move hf test dataset, few docstrings * fix docstrings, add second path for schema * init collate_fn, _tokenize_example functions (bug exists) * fix typo in warning error * remove canonical_solution from batch * missed one canonical_sllution * remove encoded dataset to have just one dataset var * rename sample to example * improve comment * edit RAGtask * rm hf parsing func * fix docstring, rename fewshot fun * docstring * change default split_batch to check types * remove need to set split_keys * doc string update * improve comments * rm stacked_keys for tokenize_labels bool * initial wip in comments * make _conv_tokens_to_tensors func * wip - sketch out batch_mappings * linting and debugging statements to help me remember where I'm doing wip * all tests except one sus schema test passing * fix missing fewshot for schema * rm temperature add generation_kwargs * add defaults that are currently set in llm-foundry builders.py * fix defaults in tests, add some comments * tests wip * tests for new funcs * rm RAG task * more docstring * tests passing * wip * wip * add dict to data_spec * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py Co-authored-by: Daniel King <[email protected]> * Apply suggestions from code review comment improvements Co-authored-by: Daniel King <[email protected]> * default_batch to base_batch and some docstrings * update comments and fix test. move spacing to default get_answer * improved docstrings * finish schema/mc tests * address pr review comments * lintign * fixing import, add type * update comments * update keys * add typechecks for token ids * rm outdated test * fix tests * add microbatch test * pyright fixes * linting attempts * linting wip * fix linting * add early stopping and do_normalization documentation * fix linting * fix linting * fix final dist test issue * fix isort * fix linting * fix docstrings * fix docstrings * add warning filters * fix warnings * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * Update composer/datasets/in_context_learning_evaluation.py fix spelling Co-authored-by: Daniel King <[email protected]> * add capitalization * revert default changes * change update_generate_kwargs to public * fix type * move pad_tok_id error --------- Co-authored-by: Daniel King <[email protected]> Co-authored-by: root <[email protected]> Co-authored-by: Eitan Turok <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
composer/datasets/in_context_learning_evaluation.py
to inherit from a single classWhat issue(s) does this change relate to?
Comments
This is a pretty big change to the icl datasets. Please pick it apart with scrutiny, I will not be offended. Please note additional needed tests or code smells that you see.
All the tests pass and the eval_gauntlet runs. Before merging, I need to rerun EleutherAI/gpt-neo-125m on the gauntlet w/o my changes, as well as 7b w/ and w/o my changes.
Before submitting
No, some large comments explaining classes/functions (and thus their documentation as well) still need to be updated. In addition, we should properly add the right classes here.
Yes but please pick them apart and make me make more tests to ensure things are as we expect.
pre-commit
on your change? (see thepre-commit
section of prerequisites)MPT eval results:
Pre-refactor:
Run name:
test-eval-refactor-no-refactor-with-new-logging-mpt-BOGPfN
Core Average: 0.334786
Post-refactor:
Run name:
test-eval-refactor-with-new-logging-mpt-m6LcxC
Core Average: 0.334729
Llama2 eval results:
Pre-refactor:
Run name:
test-eval-refactor-no-refactor-with-logging-llama2-T3PGVn
Core Average: 0.404405
Post-refactor:
NOTE: runname was mislabeled - this is with the refactor (can note this with
mcli describe
)Run name:
test-eval-refactor-no-refactor-with-new-logging-llama2-xG8WHF
Core Average: 0.40438