fix(train): complete PipelineSession support for V3 trainers (SFT/DPO… - #6235
Open
nayan3107 wants to merge 1 commit into
Open
fix(train): complete PipelineSession support for V3 trainers (SFT/DPO…#6235nayan3107 wants to merge 1 commit into
nayan3107 wants to merge 1 commit into
Conversation
nayan3107
had a problem deploying
to
manual-approval
September 2, 2026 19:22 — with
GitHub Actions
Error
nayan3107
had a problem deploying
to
manual-approval
September 2, 2026 19:22 — with
GitHub Actions
Error
nayan3107
had a problem deploying
to
manual-approval
September 2, 2026 19:22 — with
GitHub Actions
Error
…/RLAIF/RLVR) Add @runnable_by_pipeline decorator and PascalCase request serialization so TrainingStep can consume step_args from V3 fine-tuning trainers. Changes: - Add @runnable_by_pipeline decorator on train() for all 4 trainers - Build PascalCase serialized request (remove session/region, pop job name) - Fix Tags to PascalCase (JumpStart returns lowercase key/value) - Add source_code=None to BaseTrainer (required by get_code_hash) - Add consumer tests (TrainingStep.arguments validation) - Add regular session regression tests Fixes: aws#6163
nayan3107
force-pushed
the
fix/pipeline-session-v3-trainers
branch
from
September 2, 2026 22:29
610985d to
3f8b299
Compare
nayan3107
requested a deployment
to
manual-approval
September 2, 2026 23:36 — with
GitHub Actions
Waiting
nayan3107
requested a deployment
to
manual-approval
September 2, 2026 23:37 — with
GitHub Actions
Waiting
nayan3107
requested a deployment
to
manual-approval
September 2, 2026 23:37 — with
GitHub Actions
Waiting
This file contains hidden or 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
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.
…/RLAIF/RLVR)
Add @runnable_by_pipeline decorator and PascalCase request serialization so TrainingStep can consume step_args from V3 fine-tuning trainers.
Changes:
Fixes: #6163
Issue #, if available:
Description of changes:
fix(train): complete PipelineSession support for V3 trainers
Follow-up to #6213. Completes PipelineSession integration so V3 fine-tuning
trainers (SFTTrainer, DPOTrainer, RLAIFTrainer, RLVRTrainer) work with
TrainingStep in SageMaker Pipelines.
Fixes #6163
Changes
@runnable_by_pipelinedecorator ontrain()for all 4 trainers — matchesModelTrainer/Processor/Transformer pattern. Decorator captures function reference
PascalCase request serialization inside
train()body — removes non-serializablesession/region, popstraining_job_name(engine generates at runtime), convertssnake_case keys to PascalCase via
to_pascal_case()+serialize().Tags PascalCase fix —
_get_jumpstart_tags()returns lowercasekey/valuedicts (not Tag objects), so
_serialize_dict()doesn't auto-convert them. Manuallyconverts to
Key/Valuebefore serialization.source_code = Nonein BaseTrainer —get_code_hash()in pipeline compilationaccesses
model_trainer.source_codedirectly. ModelTrainer defines this field;BaseTrainer didn't. Fine-tuning trainers use built-in containers with no customer code.
Testing
Unit tests (12 new, all existing pass):
train()returns_StepArgumentswith func + trainer capturedTrainingStep(step_args=...).argumentsproduces valid PascalCase dictwith no session/region leaked, Tags in correct
Key/ValueformatTrainingJob.create()still called normally (no regression)Manual E2E (real AWS, us-west-2, account 243179453435):
Pipeline created and execution
rg29qr88isq5started successfully.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.