You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,8 @@ If you want to add a new use case or a feature, see [CONTRIBUTING](CONTRIBUTING.
72
72
### Step 1: Install the library
73
73
Before starting the whole procedure, check that both `pip` and `python` commands point to Python version 3.7 or higher with `python --version` command.
74
74
75
+
> **Important:** Make sure you read the "Getting started" section and didn't skip the steps from [Setting up your AWS account with IAM and SSM configuration](IAM_SSM_Setup.md).
76
+
75
77
Install the latest stable version of library from the [PyPI repository](https://pypi.org/project/sagemaker-ssh-helper/):
*Note:* adding `lib` dir to Python path is required, because SageMaker inference is putting dependencies
288
290
into the `code/lib` directory, while SageMaker training put libs directly to `code`.
289
291
292
+
On the following screenshot you see the sample code for the inference code running in SageMaker endpoint on AWS Inferentia chip.
293
+
The user has connected to the endpoint with the `sm-ssh connect` command and executed the `neuron-ls`[command](https://awsdocs-neuron.readthedocs-hosted.com/en/latest/tools/neuron-sys-tools/neuron-ls.html):
294
+
295
+

296
+
297
+
You can find this sample code in the notebook [Deploy SD2.1 to Inferentia2 + SageMaker + HF Optimum Neuron + SageMaker SSH Helper](https://github.com/aws-samples/ml-specialized-hardware/blob/main/tutorials/04_ImageGenerationWithStableDiffusion/SDOnInf2AndHFOptimumNeuron_SMSSH.ipynb).
298
+
299
+
You can also notice on the screenshot that the user configured the remote Python interpreter that connects to SageMaker Studio, so the user also executes the notebook itself remotely inside SageMaker. This setup is further described in the section for [Local IDE Integration with SageMaker Studio](#studio).
300
+
290
301
### Multi-model endpoints
291
302
292
303
For multi-model endpoints, the setup procedure is slightly different from regular endpoints:
@@ -571,10 +582,16 @@ Make sure you've configured your ssh config as mentioned in the [~/.ssh/config](
571
582
572
583
A. Follow the [instructions in the PyCharm docs](https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-interpreter), to configure the remote interpreter in PyCharm.
573
584
574
-
In the field for host name, put the same value as for `fqdn` in the [`sm-ssh` command](#sm-ssh), e.g., `ssh-training-example-2023-07-25-03-18-04-490.training.sagemaker`, and use `root` as the username.
585
+
In the field for host name, put the same value as for `fqdn` in the [`sm-ssh` command](#sm-ssh), e.g., `ssh-training-manual-2023-10-02-14-38-56-744.training.sagemaker`, and use `root` as the username.
575
586
576
587

577
588
589
+
When PyCharm asks for the SSH key, point to the `~/.ssh/<fqdn>` private key file that was automatically generated for you by SSH Helper:
590
+
591
+

592
+
593
+
*Note:* If PyCharm says connection refused, it can be due to timeout. Check that you can connect to this host from your system terminal with `ssh` and `sm-ssh` and try configuring the remote interpreter again.
594
+
578
595
*Tip:* When you configure Python interpreter in PyCharm, it's recommended to configure [the deployment path mapping](https://www.jetbrains.com/help/pycharm/creating-local-server-configuration.html#mapping) for you project to point into `/root/project_name` instead of default `/tmp/pycharm_project_123`. This is how you will be able to see your project in SageMaker Studio and PyCharm will automatically sync your local dir to the remote dir.
579
596
580
597
*Tip:* Also instead of creating a new venv, point the Python interpreter to the existing location.
@@ -724,6 +741,12 @@ sm-ssh list studio.sagemaker
724
741
725
742
3. Using the remote Jupyter Notebook
726
743
744
+
In recent versions of PyCharm, Jupyter Notebook is tunnelled automatically through remote interpreter connection. You might need to add `--allow-root` argument to the command line, when your remote interpreter runs under root:
745
+
746
+

747
+
748
+
If you wish to connect to the existing notebook server started by SSH Helper or don't use PyCharm, proceed with the next configuration steps.
749
+
727
750
To make the remote Jupyter Server port `8889` forwarded to the local machine, use SSH:
0 commit comments