Skip to content

Fix SFT notebook parameter names for current API (RHOAIENG-37015) - #739

Merged
openshift-merge-bot[bot] merged 4 commits into
opendatahub-io:mainfrom
hrathina:fix/RHOAIENG-37015-tensorboard-pytorch28
Apr 10, 2026
Merged

Fix SFT notebook parameter names for current API (RHOAIENG-37015)#739
openshift-merge-bot[bot] merged 4 commits into
opendatahub-io:mainfrom
hrathina:fix/RHOAIENG-37015-tensorboard-pytorch28

Conversation

@hrathina

@hrathina hrathina commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates SFT training notebook to use current transformers/trl API parameter names.

Resolves: RHOAIENG-37015

Changes

Updated Example Notebook

File: examples/kfto-sft-llm/sft.ipynb

YAML parameters:

  • torch_dtypedtype
  • use_ligeruse_liger_kernel
  • max_seq_lengthmax_length
  • Removed deprecated dataset_batch_size parameter

Python code:

  • torch_dtype=model_args.torch_dtypedtype=model_args.dtype

Background

The notebook was using deprecated parameter names from older versions of transformers/trl packages. These parameter names changed in recent versions:

  • transformers >= 4.50.0 uses dtype instead of torch_dtype
  • trl >= 0.24.0 uses new parameter names for SFTConfig

Testing

Tested with universal image:

  • Image: quay.io/opendatahub/odh-th06-cuda130-torch291-py312:odh-stable
  • Package versions: transformers==4.57.6, trl==0.24.0
  • Result: Notebook runs successfully with updated parameters
  • TensorBoard integration works correctly

Impact

  • ✅ Makes example notebook compatible with current transformers/trl versions
  • ✅ Works with universal images (th06-*)
  • ✅ No breaking changes (only fixes deprecated usage)

Note on Runtime Images

This PR only updates the example notebook. Runtime image package versions (e.g., py312-cuda128-torch280) are not changed, as those images are deprecated. Users are encouraged to migrate to universal images which already have the correct package versions.

Files Changed

  • examples/kfto-sft-llm/sft.ipynb - Updated 5 parameter names

Total: 5 insertions(+), 6 deletions(-)

Summary by CodeRabbit

  • Chores
    • Updated example training notebook to use standardized configuration parameter names.
    • Adjusted model initialization in the example to match renamed parameters.
    • Removed an unused training parameter from the example to simplify setup and reduce confusion for users.

@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 1251c681-ac8d-44de-85ce-973c62b4ef83

📥 Commits

Reviewing files that changed from the base of the PR and between b1d3a0d and 26f6293.

📒 Files selected for processing (1)
  • examples/kfto-sft-llm/sft.ipynb
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/kfto-sft-llm/sft.ipynb

📝 Walkthrough

Walkthrough

A Jupyter notebook for SFT training updates YAML/config names: torch_dtypedtype, use_ligeruse_liger_kernel, and max_seq_lengthmax_length. dataset_batch_size is removed from the YAML. The runtime model_kwargs passed into main() now use dtype=model_args.dtype instead of torch_dtype=model_args.torch_dtype. A trailing newline in the notebook was adjusted.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately describes the main change: updating notebook parameter names to align with current API versions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Ruff (0.15.9)
examples/kfto-sft-llm/sft.ipynb

Unexpected end of JSON input


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hrathina
hrathina force-pushed the fix/RHOAIENG-37015-tensorboard-pytorch28 branch from 5991f2f to 6f46a2a Compare April 9, 2026 18:29
@hrathina
hrathina force-pushed the fix/RHOAIENG-37015-tensorboard-pytorch28 branch from 6047d48 to 25ccfb7 Compare April 9, 2026 18:35
Update example notebook to use current transformers/trl API parameter names.

**Changes:**

Update SFT training example parameter names in examples/kfto-sft-llm/sft.ipynb:
- torch_dtype → dtype
- use_liger → use_liger_kernel
- max_seq_length → max_length
- Removed deprecated dataset_batch_size parameter

**Why:**

The notebook was using deprecated parameter names from older versions of
transformers/trl. Universal images (th06-*) already work correctly with
the updated API. This fix ensures the example notebook is compatible with
current package versions.

**Testing:**

Tested with universal image (quay.io/opendatahub/odh-th06-cuda130-torch291-py312:odh-stable)
which has transformers 4.57.6 and trl 0.24.0 - notebook runs successfully
with these parameter updates.

**Note:**

This only updates the example notebook. Runtime image package versions
(py312-cuda128-torch280) are not changed as that image is deprecated.
Users should migrate to universal images.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@hrathina
hrathina force-pushed the fix/RHOAIENG-37015-tensorboard-pytorch28 branch from 5c8123a to b1d3a0d Compare April 10, 2026 12:06
@openshift-ci openshift-ci Bot removed the lgtm label Apr 10, 2026
@hrathina hrathina changed the title Fix TensorBoard reporting failure in PyTorch 2.8 image (RHOAIENG-37015) Fix SFT notebook parameter names for current API (RHOAIENG-37015) Apr 10, 2026
@openshift-ci

openshift-ci Bot commented Apr 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kapil27, sutaakar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot removed the lgtm label Apr 10, 2026
@sutaakar

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Apr 10, 2026
@openshift-ci openshift-ci Bot removed the lgtm label Apr 10, 2026
@sutaakar

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Apr 10, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit a201b1e into opendatahub-io:main Apr 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants