Skip to content

Sagemaker AI Notebook : Cell execution takes forever.

0

Hi all,

In Sagemaker AI, I have noticed that executing notebook cells takes forever very often times. Even a simple execution(e.g., 3+1) is not finished forever. To solve this, I reopen the notebook and execute the cell again, which works. But the problem happens very often times that it is very annoying to reopen it. Does anyone know the cause behind it?

Best, DL

asked 8 months ago166 views

2 Answers
0

Instead of reopening the whole notebook, try:

  1. Restart the kernel (quickest fix) From the notebook menu → Kernel → Restart Kernel

  2. If it keeps happening, reset the Studio app: aws sagemaker list-apps --domain-id <domain-id> --user-profile-name <user>

aws sagemaker delete-app
--domain-id <domain-id>
--user-profile-name <user>
--app-type KernelGateway
--app-name <app-name>

It will auto-recreate on next launch.

answered 8 months ago

AWS
EXPERT

reviewed 8 months ago

  • Unfortunately, none of these works. listing apps gives an empty list. So nothing to reset. Only closing the tab and reopening it works temporarily. By the way, when the cell is executing(denoted by "*" sign on the cell), kernel_status on the top-right says idle.

0

When notebook cells in SageMaker AI take forever to execute, even for simple operations, this typically indicates resource or kernel issues. Here are several potential causes and solutions:

Check Resource Utilization: The notebook instance may be running out of resources. Monitor your notebook instance's resource utilization to see if CPU, memory, or other resources are being exhausted. This can cause the kernel to become unresponsive.

Review Jupyter Logs: Check your Jupyter logs for kernel-related issues. You can monitor these logs in Amazon CloudWatch Logs, or access them directly by running tail -f /var/log/jupyter.log on your instance. This can help identify what's causing the kernel to hang.

Reduce Output: If your previous cells generated large amounts of output, this can cause subsequent cells to hang or execute slowly. Try reducing the amount of output your code prints.

Browser and Network Issues: Clear your browser cache and cookies, as these can sometimes interfere with notebook functionality. Also check for any firewalls or network configurations that might be blocking communication between your browser and the notebook instance.

Update Your Instance: Consider updating your notebook instance to ensure you're running the latest software versions, which may include bug fixes and performance improvements.

Instance Type: If you're working with large datasets or computationally intensive operations, you may need a larger instance type with more resources allocated to it.

If the problem persists after trying these solutions, you may want to contact AWS Support with details including your notebook instance ARN, Jupyter and Python versions, and any relevant error messages from the logs.
Sources
Resolve missing output from cells in SageMaker AI notebook | AWS re:Post

answered 8 months ago

AWS
EXPERT

reviewed 8 months 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.