fix(train): add PipelineSession support to V3 trainers (SFT/DPO/RLAIF… - #6213
Conversation
d07c756 to
d3eef6a
Compare
…/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
d3eef6a to
63c6c59
Compare
|
Claude finished @nayan3107's task in 3m 23s —— View job Code Review: PipelineSession support for V3 trainers
I appreciate the intent here — closing the gap so SFT/DPO/RLAIF/RLVR match 🔴 Blocking: the returned object cannot be consumed by
|
…/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: