Skip to content

get_code_hash fails when trying to create a TrainStep with a ModelTrainer defined with a source_code #5443

@mikhailvorobiev1-max

Description

@mikhailvorobiev1-max

PySDK Version

  • PySDK V2 (2.x)
  • PySDK V3 (3.x)

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.

  1. Create a ModelTrainer with the source_code defined
  2. Create a TrainStep using this ModelTrainer.train()
  3. Add the TrainStep to a Pipeline
  4. 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.

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions