Is there a way to access the files of a gpu studio kernel app instance from the jupyter studio instance ?

0

I would like to do all of my development on the cloud. I would like to be able to access and modify the library files of the conda enviornment when I am running a gpu based notebook. I was hoping that persisting the conda env on the efs would solve the issues as shown in this tutorial https://aws.amazon.com/blogs/machine-learning/four-approaches-to-manage-python-packages-in-amazon-sagemaker-studio-notebooks/ however, my kernel ended up dying - I was NOT using one of the DataScience images as I need to run on a gpu. I then realised that the tutorial does mention that not using one of the Data Science images would result in issues. Is there a way to be able to access/modify the files on the conda env on an image that is not one of the Data Science images using the UI / jupyter lab - I aware i can access the terminal of that image, but I want to be able to modify/ access the files using the ui of jupyter lab or integration with visual studio which runs on the studio instance.

  • the kernel actually dies even when I am using the Data Science 3.0 or Data Science 2.0

fuad
asked 5 months ago141 views
1 Answer
0

Hi

Greetings! Hope you are doing good!

I understand that you wanted to know Is there a way to be able to access/modify the files on the conda env on an image that is not one of the Data Science images using the UI / jupyter lab. After testing the same scenario at my end, I can also conclude that we can use this approach with only DataScience Images. As this approach(3) is limited to Data Science image. Hence, It is not possible to access/modify the file on the conda env using this approach.

I’d like to inform you that I have replicated the scenario at my testing environment. I tried to use the 3rd approach which is “Persist Conda environments to the Studio EFS volume” and I found out that we can use this approach only with DataScience Images. I tried to implement the same with other 3rd party GPU images like PyTorch or MXnet but I didn’t work. As this method is limited to Data Science image. Hence, It is not possible to access/modify the file on the conda env using this approach. You can either create a custom image or using LifeCycle Configuration to achieve this. You can use Approach 1 to create a custom image, You can provide all the required configuration to your image and build it. SageMaker Studio provide the functionality to bring your own image or custom image if you need additional library, packages etc. You can build the images based on your requirement. To create a custom image, you need to follow the certain steps which are listed in the below Link [1].

Other way is to use Lifecycle configuration, SageMaker LCC provides shell scripts that run only when you create the notebook instance or whenever you start one. When you create a notebook instance, you can create a new lifecycle configuration and the scripts it uses or apply one that you already have. You can make your Lifecycle script based on your use case. You can find more details to know how to create the LCC in Link [2]. This GitHub contains different sample LCC script.

We can conclude that unfortunately, we can’t direct access or modify the GPU based image. Alternately we can either make the custom image or we can use Lifecycle configuration.

Moving ahead to your 2nd query, you stated that you kernel died even you use the Data Science 3.0 or Data Science 2.0. I wanted to inform you that I tried the same images and I didn’t face any issue with the kernel. It might be an intermittent issue which can be fixed after restarting the JupyterServer. However, there could be many factors which can causes the kernel issue. To troubleshoot the issue, you can either check the CloudWatch logs or open a support case with Premium support team and we will happy to assist you. You can find the studio jupyterServer Cloud Watch logs at this location “/aws/sagemaker/studio/[domain-id]/[user-profile-name]/[app-type]/[app-name].

To understand the Log Amazon SageMaker Events with Amazon CloudWatch, follow the link [3].

REFERENECS:-

[1] https://aws.amazon.com/blogs/machine-learning/four-approaches-to-manage-python-packages-in-amazon-sagemaker-studio-notebooks/

[2] https://github.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-configuration-samples

[3] https://docs.aws.amazon.com/sagemaker/latest/dg/logging-cloudwatch.html

AWS
answered 5 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions