I am currently running code on amazon sagemaker jupyter notebook (not jupyterLab, just a plain jupyter notebook) on the ‘ml.t3.2xlarge’ instance. There is one line of code shown below, where I am simply deploying an LLM on my data frame. But because the data frame is huge, the line of code runs very slowly on ‘ml.t3.2xlarge’. I want to ensure that this line of code is run on ‘ml.p3.2xlarge’ and the result is stored back in S3.
df_new['predicted_values'] = df_original.progress_apply(lambda x: LLM_pretrained_model.predict( x['comment_body'] )
How can I run this one cell in another instance?
2
Answers
I figured that the solution is to create a processing job - but that is a whole another thing by itself :(
Changing the instance will depend what SageMaker component you are using:
1/ Studio Classic: https://docs.aws.amazon.com/sagemaker/latest/dg/notebooks-run-and-manage-switch-instance-type.html
2/ Studio Spaces: https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated-running.html#studio-updated-running-view
3/ Notebook Instance – Update instance type: https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-update.html