From b1d3a0dd3d3ff3e1d8950f069c2249f99eec1e51 Mon Sep 17 00:00:00 2001 From: Hari Haran Rathinakumar Date: Fri, 10 Apr 2026 12:05:54 +0000 Subject: [PATCH 1/2] fix: update SFT notebook to use new API parameter names (RHOAIENG-37015) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- examples/kfto-sft-llm/sft.ipynb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/kfto-sft-llm/sft.ipynb b/examples/kfto-sft-llm/sft.ipynb index a4f0067e4..941e152e8 100644 --- a/examples/kfto-sft-llm/sft.ipynb +++ b/examples/kfto-sft-llm/sft.ipynb @@ -42,9 +42,9 @@ "# Model\n", "model_name_or_path: Meta-Llama/Meta-Llama-3.1-8B-Instruct\n", "model_revision: main\n", - "torch_dtype: bfloat16\n", + "dtype: bfloat16\n", "attn_implementation: flash_attention_2 # one of eager (default), sdpa or flash_attention_2\n", - "use_liger: false # use Liger kernels\n", + "use_liger_kernel: false # use Liger kernels\n", "\n", "# PEFT / LoRA\n", "use_peft: true\n", @@ -69,8 +69,7 @@ " append_concat_token: false # add additional separator token\n", "\n", "# SFT\n", - "max_seq_length: 1024 # max sequence length for model and packing of the dataset\n", - "dataset_batch_size: 1000 # samples to tokenize per batch\n", + "max_length: 1024 # max sequence length for model and packing of the dataset\n", "packing: false\n", "\n", "# Training\n", @@ -175,7 +174,7 @@ " revision=model_args.model_revision,\n", " trust_remote_code=model_args.trust_remote_code,\n", " attn_implementation=model_args.attn_implementation,\n", - " torch_dtype=model_args.torch_dtype,\n", + " dtype=model_args.dtype,\n", " use_cache=False if training_args.gradient_checkpointing or\n", " training_args.fsdp_config.get(\"activation_checkpointing\",\n", " False) else True,\n", @@ -701,4 +700,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} +} \ No newline at end of file From 26f629396fab201a8529c540cc6514601ea2b9f8 Mon Sep 17 00:00:00 2001 From: Hari Haran Rathinakumar Date: Fri, 10 Apr 2026 13:15:09 +0100 Subject: [PATCH 2/2] Add newline at end of file --- examples/kfto-sft-llm/sft.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/kfto-sft-llm/sft.ipynb b/examples/kfto-sft-llm/sft.ipynb index 941e152e8..396d0c0a1 100644 --- a/examples/kfto-sft-llm/sft.ipynb +++ b/examples/kfto-sft-llm/sft.ipynb @@ -700,4 +700,4 @@ }, "nbformat": 4, "nbformat_minor": 5 -} \ No newline at end of file +}