Skip to content

build: Upgrade TRL version from 0.14 to 0.16#527

Merged
dushyantbehl merged 16 commits intofoundation-model-stack:mainfrom
Abhishek-TAMU:upgrade_trl
Apr 14, 2025
Merged

build: Upgrade TRL version from 0.14 to 0.16#527
dushyantbehl merged 16 commits intofoundation-model-stack:mainfrom
Abhishek-TAMU:upgrade_trl

Conversation

@Abhishek-TAMU
Copy link
Copy Markdown
Collaborator

@Abhishek-TAMU Abhishek-TAMU commented Apr 10, 2025

Description of the change

  • Upgrade TRL version from 0.14.0 to 0.15.2 for supporting Vision Model Support PR.

  • Undocumented Prompt tuning.

  • Replace Prompt Tuning with LoRA tuning in unit test case where features other than Prompt Tuning is tested and Prompt tuning gives error.

  • Commented out test cases specifically testing Prompt tuning where Prompt tuning gives error.

Related issue number

Issue: https://github.ibm.com/ai-foundation/watson-fm-stack-tracker/issues/1718

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

Abhishek-TAMU and others added 2 commits April 10, 2025 13:34
@github-actions
Copy link
Copy Markdown

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions Bot added the build label Apr 10, 2025
@Abhishek-TAMU Abhishek-TAMU requested review from dushyantbehl and removed request for aluu317, anhuong and fabianlim April 10, 2025 17:37
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
@Abhishek-TAMU Abhishek-TAMU changed the title build: Upgrade TRL version from 0.14.0 to 0.15.2 build: Upgrade TRL version from 0.14 to 0.16 Apr 11, 2025
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Comment thread tests/test_sft_trainer.py
Copy link
Copy Markdown
Collaborator

@dushyantbehl dushyantbehl left a comment

Choose a reason for hiding this comment

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

Need to clear out the PT support with TRL if its not working.

Else LGTM.

Comment thread tests/artifacts/predefined_data_configs/duplicate_columns.yaml Outdated
Comment thread tests/test_sft_trainer.py
Comment thread tuning/sft_trainer.py
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Comment thread tests/build/test_launch_script.py Outdated
_validate_training_output(checkpoint, "ft")


@pytest.mark.skipif(True, reason="This test is always skipped")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.skipif(True, reason="This test is always skipped")
@pytest.mark.skipif(True, reason="This test is deprecated so always skipped")

Comment thread tests/test_sft_trainer.py Outdated
############################# Prompt Tuning Tests #############################


@pytest.mark.skipif(True, reason="This test is always skipped")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.skipif(True, reason="This test is always skipped")
@pytest.mark.skipif(True, reason="This test is deprecated so always skipped")

Comment thread tests/test_sft_trainer.py Outdated
assert "### Text: @NortonSupport Thanks much.\n\n### Label:" in output_inference


@pytest.mark.skipif(True, reason="This test is always skipped")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.skipif(True, reason="This test is always skipped")
@pytest.mark.skipif(True, reason="This test is deprecated so always skipped")

Comment thread tests/test_sft_trainer.py Outdated
assert "### Text: @NortonSupport Thanks much.\n\n### Label:" in output_inference


@pytest.mark.skipif(True, reason="This test is always skipped")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.skipif(True, reason="This test is always skipped")
@pytest.mark.skipif(True, reason="This test is deprecated so always skipped")

Comment thread tests/test_sft_trainer.py
tuning_config = peft_config.PromptTuningConfig(
prompt_tuning_init="TEXT",
prompt_tuning_init_text="hello",
num_virtual_tokens=0,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To the above as well

Suggested change
num_virtual_tokens=0,
@pytest.mark.skipif(True, reason="This test is deprecated so always skipped")

Comment thread tests/test_sft_trainer.py Outdated
_validate_training(tempdir, check_eval=True)


@pytest.mark.skipif(True, reason="This test is always skipped")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.skipif(True, reason="This test is always skipped")
@pytest.mark.skipif(True, reason="This test is deprecated so always skipped")

Comment thread tuning/data/data_preprocessing_utils.py Outdated
)

# packing for non tokenized dataset doesn't require a collator with SFTrainer.
# With SFTTrainer, packing for a tokenized dataset uses default Collator,
Copy link
Copy Markdown
Collaborator

@dushyantbehl dushyantbehl Apr 14, 2025

Choose a reason for hiding this comment

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

With SFTTrainer, packing for both tokenized and non tokenized dataset use default collator, DataCollatorForLanguageModeling, and we do not need to pass any explicit collator in that case.

Copy link
Copy Markdown
Collaborator

@dushyantbehl dushyantbehl left a comment

Choose a reason for hiding this comment

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

Minor nits requested but looks okay.

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
@Abhishek-TAMU
Copy link
Copy Markdown
Collaborator Author

@dushyantbehl Fixed the PR changes.

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Copy link
Copy Markdown
Collaborator

@dushyantbehl dushyantbehl left a comment

Choose a reason for hiding this comment

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

LGTM.

@dushyantbehl dushyantbehl merged commit 5bb5489 into foundation-model-stack:main Apr 14, 2025
9 checks passed
@Abhishek-TAMU Abhishek-TAMU deleted the upgrade_trl branch April 14, 2025 18:06
kmehant pushed a commit that referenced this pull request Apr 28, 2025
* Upgrade TRL version

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Add attention mask in dataset

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Version increase to 0.16.1

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Prompt tuning arg assign num_virtual_tokens=0

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Prompt tuning arg assign num_virtual_tokens=0

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* undocumented Prompt tuning and commented its unit tests

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Remove DataCollatorForSeq2Seq for tokenized dataset with packing

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Remove DataCollatorForSeq2Seq for tokenized dataset with packing

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Skipped PT tests

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* PR Changes

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* PR Changes

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Fix lint

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Remove enable_reduce_loss_sum and _is_peft_model check

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

---------

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
dushyantbehl pushed a commit to dushyantbehl/fms-hf-tuning that referenced this pull request Jun 23, 2025
)

* Upgrade TRL version

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Add attention mask in dataset

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Version increase to 0.16.1

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Prompt tuning arg assign num_virtual_tokens=0

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Prompt tuning arg assign num_virtual_tokens=0

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* undocumented Prompt tuning and commented its unit tests

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Remove DataCollatorForSeq2Seq for tokenized dataset with packing

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Remove DataCollatorForSeq2Seq for tokenized dataset with packing

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Skipped PT tests

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* PR Changes

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* PR Changes

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Fix lint

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

* Remove enable_reduce_loss_sum and _is_peft_model check

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>

---------

Signed-off-by: Abhishek <maurya.abhishek@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants