fix(train): complete PipelineSession support for V3 trainers (SFT/DPO… - #6235
fix(train): complete PipelineSession support for V3 trainers (SFT/DPO…#6235nayan3107 wants to merge 1 commit into
Conversation
610985d to
3f8b299
Compare
|
|
||
| MODEL_ID = "meta-textgeneration-llama-3-2-1b-instruct" | ||
|
|
||
| _BASE_SFT_SAMPLES = [ |
There was a problem hiding this comment.
nit: we could reuse some existing dataset or move this to a file
papriwal
left a comment
There was a problem hiding this comment.
One small heads-up on the new integ test's teardown (test_v3_trainer_pipeline.py). Nothing blocking; the production PipelineSession change looks good.
| ) | ||
| yield name | ||
| try: | ||
| sagemaker_session.sagemaker_client.delete_model_package_group( |
There was a problem hiding this comment.
Minor: since the *_create_and_execute tests register a model package into model_package_group, delete_model_package_group here may fail on a non-empty group (and the except Exception: pass would quietly hide it), potentially leaving the group and its model packages behind. Might be worth deleting the member model packages before the group so nothing accumulates in the CI account over time. Non-blocking.
|
Claude finished @nayan3107's task in 4m 5s —— View job Review: complete PipelineSession support for V3 trainersI reviewed the diff against 🔴 Tags conversion breaks when a user passes
|
3f8b299 to
64f5c50
Compare
|
Fixed -
|
…/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
64f5c50 to
c0bccf6
Compare
…/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.