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

Setting default values in training job config #104

Merged
merged 12 commits into from
Apr 2, 2024

Conversation

tharapalanivel
Copy link
Collaborator

@tharapalanivel tharapalanivel commented Mar 30, 2024

Description of the change

Setting the following defaults for training jobs, will get overwritten if user explicitly passes in a value

  • save_strategy = epoch
  • logging_strategy = epoch

Related issue number

How to verify the PR

Was the PR tested

  • I have added >=1 unit test(s) for every new method I have added.
  • I have ensured all unit tests pass

@tharapalanivel tharapalanivel marked this pull request as ready for review March 31, 2024 23:34
Signed-off-by: Thara Palanivel <[email protected]>
tuning/config/configs.py Show resolved Hide resolved
tuning/config/configs.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ssukriti Ssukriti left a comment

Choose a reason for hiding this comment

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

ok with code changes, suggestions around refactoring files and functions.

we can keep all build related code inside build folder and tests can be inside tests/build as well

Signed-off-by: Thara Palanivel <[email protected]>
Signed-off-by: Thara Palanivel <[email protected]>
Copy link
Collaborator

@Ssukriti Ssukriti left a comment

Choose a reason for hiding this comment

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

some questions - also @anhuong have you reviewed the refactor to launch_training as well?

tests/dummy_job_config.json Outdated Show resolved Hide resolved
tuning/config/configs.py Outdated Show resolved Hide resolved
build/utils.py Outdated Show resolved Hide resolved
tests/build/test_utils.py Outdated Show resolved Hide resolved
Signed-off-by: Thara Palanivel <[email protected]>
Ssukriti
Ssukriti previously approved these changes Apr 2, 2024
Copy link
Collaborator

@Ssukriti Ssukriti left a comment

Choose a reason for hiding this comment

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

approved from my end, just a remaining question on default for peft_method^. - I want to ensure we are testing fine tuning correctly, peft_method should be None for fine tuning.

  1. Does peft_method need to be passed explicitly as None then for fine tuning?
  2. or should we keep default to None, and pass "pt"/"Lora" explictly for prompt tuning/LoRA?
    I think second one makes more sense.

When @anhuong approves, we can merge

Signed-off-by: Thara Palanivel <[email protected]>
anhuong
anhuong previously approved these changes Apr 2, 2024
Copy link
Collaborator

@anhuong anhuong left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines 75 to 78
with open(json_path, "r", encoding="utf-8") as f:
contents = json.load(f)
peft_method_parsed = contents.get("peft_method")
logging.debug("Input params parsed: %s", contents)
job_config_dict = json.load(f)
elif json_env_var:
job_config_dict = txt_to_obj(json_env_var)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note to self: perhaps we should refactor this into build/utils as well since accelerate_launch and launch_training use the same method to parse the JSON

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! I'll add that in the follow-up tests PR that is in the queue next

Signed-off-by: Thara Palanivel <[email protected]>
@tharapalanivel tharapalanivel requested a review from anhuong April 2, 2024 20:47
@anhuong anhuong merged commit 3785363 into foundation-model-stack:main Apr 2, 2024
3 checks passed
anhuong pushed a commit to anhuong/fms-hf-tuning that referenced this pull request Apr 3, 2024
…#104)

* Allow for default params to be set

Signed-off-by: Thara Palanivel <[email protected]>

* Add tests

Signed-off-by: Thara Palanivel <[email protected]>

* Simplifying default params logic

Signed-off-by: Thara Palanivel <[email protected]>

* Setting use_flash_attn default

Signed-off-by: Thara Palanivel <[email protected]>

* Formatting

Signed-off-by: Thara Palanivel <[email protected]>

* Address review comments

Signed-off-by: Thara Palanivel <[email protected]>

* Moving tests

Signed-off-by: Thara Palanivel <[email protected]>

* Address review comments

Signed-off-by: Thara Palanivel <[email protected]>

* Address review comment

Signed-off-by: Thara Palanivel <[email protected]>

* Fix merge conflicts

Signed-off-by: Thara Palanivel <[email protected]>

---------

Signed-off-by: Thara Palanivel <[email protected]>
Signed-off-by: Anh-Uong <[email protected]>
anhuong pushed a commit to anhuong/fms-hf-tuning that referenced this pull request Apr 3, 2024
…#104)

* Allow for default params to be set

Signed-off-by: Thara Palanivel <[email protected]>

* Add tests

Signed-off-by: Thara Palanivel <[email protected]>

* Simplifying default params logic

Signed-off-by: Thara Palanivel <[email protected]>

* Setting use_flash_attn default

Signed-off-by: Thara Palanivel <[email protected]>

* Formatting

Signed-off-by: Thara Palanivel <[email protected]>

* Address review comments

Signed-off-by: Thara Palanivel <[email protected]>

* Moving tests

Signed-off-by: Thara Palanivel <[email protected]>

* Address review comments

Signed-off-by: Thara Palanivel <[email protected]>

* Address review comment

Signed-off-by: Thara Palanivel <[email protected]>

* Fix merge conflicts

Signed-off-by: Thara Palanivel <[email protected]>

---------

Signed-off-by: Thara Palanivel <[email protected]>
@tharapalanivel tharapalanivel deleted the default_params branch April 9, 2024 20:44
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.

3 participants