fix(train): add PipelineSession support to V3 trainers (SFT/DPO/RLAIF… - #6213
Open
nayan3107 wants to merge 1 commit into
Open
fix(train): add PipelineSession support to V3 trainers (SFT/DPO/RLAIF…#6213nayan3107 wants to merge 1 commit into
nayan3107 wants to merge 1 commit into
Conversation
nayan3107
had a problem deploying
to
manual-approval
August 25, 2026 19:53 — with
GitHub Actions
Error
nayan3107
had a problem deploying
to
manual-approval
August 25, 2026 19:53 — with
GitHub Actions
Error
nayan3107
had a problem deploying
to
manual-approval
August 25, 2026 19:53 — with
GitHub Actions
Error
nayan3107
force-pushed
the
fix/pipeline-session-v3-trainers
branch
from
August 25, 2026 19:54
d07c756 to
d3eef6a
Compare
nayan3107
had a problem deploying
to
manual-approval
August 25, 2026 20:01 — with
GitHub Actions
Error
nayan3107
had a problem deploying
to
manual-approval
August 25, 2026 20:02 — with
GitHub Actions
Error
nayan3107
had a problem deploying
to
manual-approval
August 25, 2026 20:02 — with
GitHub Actions
Error
rohangujarathi
previously approved these changes
Aug 25, 2026
…/RLVR) When a PipelineSession is passed as sagemaker_session, the serverless training path in SFTTrainer, DPOTrainer, RLAIFTrainer, and RLVRTrainer now intercepts the CreateTrainingJob request and returns step arguments instead of immediately launching a training job. This enables V3 trainers to be used with SageMaker Pipelines TrainingStep, matching the existing behavior of ModelTrainer, Processor, Transformer, and HyperparameterTuner. The fix follows the established SDK pattern: isinstance check for PipelineSession, call _intercept_create_request with the request args, and return session.context (the captured step arguments). Fixes: aws#6163
nayan3107
force-pushed
the
fix/pipeline-session-v3-trainers
branch
from
August 25, 2026 21:13
d3eef6a to
63c6c59
Compare
nayan3107
requested a deployment
to
manual-approval
August 25, 2026 21:30 — with
GitHub Actions
Waiting
nayan3107
requested a deployment
to
manual-approval
August 25, 2026 21:31 — with
GitHub Actions
Waiting
rohangujarathi
approved these changes
Aug 25, 2026
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.
…/RLVR)
When a PipelineSession is passed as sagemaker_session, the serverless training path in SFTTrainer, DPOTrainer, RLAIFTrainer, and RLVRTrainer now intercepts the CreateTrainingJob request and returns step arguments instead of immediately launching a training job.
This enables V3 trainers to be used with SageMaker Pipelines TrainingStep, matching the existing behavior of ModelTrainer, Processor, Transformer, and HyperparameterTuner.
The fix follows the established SDK pattern: isinstance check for PipelineSession, call _intercept_create_request with the request args, and return session.context (the captured step arguments).
Issue #, if available:
Fixes: #6163
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Testing
Unit Tests (167 pass, 0 regressions):
TestXxxTrainerPipelineSessionclasses added verifying:TrainingJob.create()is NOT called when PipelineSession is usedsession._intercept_create_request()IS called with correctcreate_argsandfunc_name="train"session.context(_JobStepArguments) — usable withTrainingStepE2E Manual Validation (real AWS, us-west-2):
Verified scenarios: