You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
get_code_hash fails when trying to create a TrainStep with a ModelTrainer defined with a source_code #5443
Describe the bug
A clear and concise description of what the bug is.
When creating a pipeline that contains a TrainStep using a ModelTrainer with a custom source_code defined, running pipeline.definition() or pipeline.upsert() fails.
The error comes from the utilities trying to get the code hash of the executed code and accessing an attribute that does not exist.
To reproduce
A clear, step-by-step set of instructions to reproduce the bug.
The provided code need to be complete and runnable, if additional data is needed, please include them in the issue.
Create a ModelTrainer with the source_code defined
Create a TrainStep using this ModelTrainer.train()
Add the TrainStep to a Pipeline
Upsert pipeline
Expected behavior
A clear and concise description of what you expected to happen.
Pipeline is upserted.
Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.
System information
A description of your system. Please provide:
SageMaker Python SDK version: 3.3.0
Framework name (eg. PyTorch) or algorithm (eg. KMeans):
Framework version:
Python version:
CPU or GPU:
Custom Docker image (Y/N):
Additional context
Add any other context about the problem here.
Partially fixed with the 3.3.1 release, but now there's some other validation that is failing.
I've modified the hyperparameter tuning example with a trainstep to showcase the issue:
A TrainStep built from a ModelTrainer with source_code now hashes correctly through pipeline.definition() / pipeline.upsert(), covered by unit tests. Please upgrade to the current release. Closing as resolved — reopen with a repro if you still see a failure on the latest version.
Activity
mikhailvorobiev1-max commentedon Jan 14, 2026
Partially fixed with the 3.3.1 release, but now there's some other validation that is failing.
I've modified the hyperparameter tuning example with a trainstep to showcase the issue:
mnist.py
v3-training-pipeline.ipynb
mohamedzeidan2021 commentedon Sep 1, 2026
Both the original error and the follow-up validation failure are fixed.
get_code_hashcrash (accessing a nonexistent attribute onSourceCode) was fixed in fix: Correct source code 'dependencies' parameter to 'requirements' #5467, shipped in 3.3.1 — the "partial fix" you observed.get_training_code_hash, where the requirements/dependencies value (a single path string, orNone) was being concatenated to a list. That was fixed in Fix handling of training step dependencies to allow successful pipeline creation #5618 and shipped in sagemaker-core v2.5.1 (Mar 2026).A
TrainStepbuilt from aModelTrainerwithsource_codenow hashes correctly throughpipeline.definition()/pipeline.upsert(), covered by unit tests. Please upgrade to the current release. Closing as resolved — reopen with a repro if you still see a failure on the latest version.