Comments (3)
Hi @ lorenzwalthert, thanks for reaching out!
Not sure this behaviour applies to ExecutionVariables only or to all PipelineVariables.
For this, yes, the behavior applies to all PipelineVariables. This is because PipelineVariables
are placeholders in compile time and are only parsed in pipeline execution time. Thus, we can not do the following in SDK when defining a pipeline definition.
do arbitrary transformations involving Pipeline variables (e.g. taking a substring, performing aritmetic with float or int parameters, evaluating an if condition involving a PipelineVariable etc)
Currently we only provide the Join and JsonGet functions in SDK to perform operation on the PipelineVariables in execution time. We may not plan to add more such functions in the near future.
Hence, for other operations, leveraging a LambdaStep can be one solution.
Besides LambdaStep, as you're using training and processing steps, can you try out our recently launched new feature - @step
and see if it can get you out of this issue?
https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines-step-decorator.html.
In your case, the code can be similar to the following.
Note: because the custom_func runs in pipeline execution time when the ExecutionVariables.PIPELINE_EXECUTION_ID or exe_var has already been parsed, we can do any python primitive string operations to it.
from sagemaker.workflow.function_step import step
@step(
name="...",
keep_alive_period_in_seconds=600,
...
)
def custom_func(exe_var):
# Add your ML logics here, which will be run in a training job in pipeline execution time
return exe_var.[0:2] # <<<<<<<<<<<<<<<<<<<<<<<<<<<<
custom_func_output = custom_func(
exe_var=ExecutionVariables.PIPELINE_EXECUTION_ID,
)
pipeline = Pipeline(
name=pipeline_name,
steps=[custom_func_output],
sagemaker_session=sagemaker_sessione,
)
pipeline.create(role)
execution = pipeline.start()
from sagemaker-python-sdk.
Closing this issue as we did not get response in the last 3 week. Feel free to reopen if you have further questions. Thanks!
from sagemaker-python-sdk.
Thanks @qidewenwhen for your answer (and sorry for the late reply). I see that using a pipeline with the lightweight training job decorator (instead of the more verbose cassical syntax) is an option. But I don't really want these things to show up in my training jobs. I'd prefer processing job. I don't think that's possible (yet)? Anyways, my pipeline is pretty long, so I wondered if I can combine the decorator approach with existing classical pipeline syntax... The drawback of <5 min startup time for a training job remain, however. I believe that's where the lambda step could potentially shine (although I have not investigate it yet, and I'd require it to work in local mode too to be comaptible with my development loop).
from sagemaker-python-sdk.
Related Issues (20)
- Newline chars are not supported in sagemaker feature store string types
- SageMaker Batch currently doesn't support Model entity with container definitions which use ModelDataSource attribute
- 'base_job_name' parameter is not used to name the Processing Jobs that are created by the Model Monitoring Schedule
- (AutoMLV2) UnboundLocalError: local variable 'input_config' referenced before assignment
- Import/get data from bigquery
- Endless loop when try to deploy a sagemaker pipeline from a windows machine HOT 2
- HuggingFaceProcessor with ProcessingStep results in import errors (similar to issues/2656) HOT 3
- Error in using Clarify with AWS Jumpstart image classification models
- Forbidden Access to S3 bucket after domain initialization
- Can I create lambda step from ecr image by using Lambda class in lambda_help.py?
- sagemaker.model_monitor.DefaultModelMonitor suggest_baseline is not able to read Japanese text HOT 2
- Model.is_repack should return a bool but sometimes returns a None
- Allow user to configure compresslevel for tarfile in sagemaker.util.repack_model
- When using the model_id with the DJLModel class in the SageMaker Python SDK, the entry_point is not working, and the code specified is not loaded into the container
- Project description not available on pypi.org/project/sagemaker/2.229.0/
- 500 Error for Long Input Videos in SageMaker Serverless Inference
- Documentation & License to be updated on PyPI portal for 2.228 & 2.229 version - URGENT
- Time Series Explainability - Mean on Baselines
- Wrong file name in error message for invalid initialization_script in NotebookJobStep
- Wrong notebook being run in pipeline when creating NotebookJobStep with shared environment_variables dict
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sagemaker-python-sdk.