From 32f1795bc50498c99721b38d8892c15d36f35ce6 Mon Sep 17 00:00:00 2001 From: Hossein Firooz Date: Wed, 7 Feb 2024 10:05:34 +0200 Subject: [PATCH 1/3] VSCode Debugging - Adding GPU dev partition - How to debug with debugpy --- triton/apps/vscode.rst | 50 ++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/triton/apps/vscode.rst b/triton/apps/vscode.rst index e4158a623..f46432c4e 100644 --- a/triton/apps/vscode.rst +++ b/triton/apps/vscode.rst @@ -1,7 +1,7 @@ VSCode on Triton ================ -VSCode is a text editor and integrated development environment. It is +VSCode is a text editor and IDE (Integrated Development Environment). It is very popular these days, partly due to it's good usability. Installation @@ -47,8 +47,9 @@ select whatever resources you want (memory, CPU, etc) and run directly in the Slurm queue. This means you can directly perform calculations in that VSCode session and it runs properly (not on the login node). -This is useful for getting things done quickly, but running in a web -browser can be limited in some cases (interface, lifetime, etc.). +This is useful for getting things done quickly or do simple debugging, +but running in a web browser can be limited in some cases (interface, lifetime, etc.). +Another limitation is OOD VSCode does not support GPU computing. @@ -57,17 +58,17 @@ VSCode remote SSH **"Remote SSH"** is a nice way to work on a remote computer and provides both editing and shell access, but everything will run -directly on the login node on Triton. This is OK for editing, but not -for main computations (see the section above or below). **To repeat: -don't use this for running big computations.** +directly on the login node on Triton. This is OK for wiring code +and editing, but not for main computations (see the section above or below). +**To repeat: don't use this for running any big computations.** .. figure:: vscode--connected.png :alt: Screenshot saying "SSH: triton". If you see this in the lower left corner (or whatever the name of your cluster SSH config is), you are connected to the login node - (and should not do big calculations). It's possible the exact look - may be different for others. + (and again, should not do big calculations). It's possible the + exact look may be different for others. You can see `connection instructions (including screenshots) at the Sigma2 instructions @@ -96,7 +97,7 @@ This section contains original research and may not fully work, and **may only work on Linux/Mac right now (but Windows might work too since it uses OpenSSH)**. -In you ``~/.ssh/config``, add this block to define a server +In your ``~/.ssh/config``, add this block to define a server ``triton-vscode``. For more information ``.ssh/config``, including what these mean and what else you might need in here, see :doc:`/scicomp/ssh`:: @@ -136,8 +137,29 @@ Possible issues which may affect usage: variables set by Slurm. Make sure that they don't interfere with jobs you may run from this vscode session). -* If you request a GPU node or other high resources, this is reserved - the whole time even if you aren't using them. Consider this before - reserving large resources (unless you close the jobs soon), or you - might get an email from us asking if we can help you improve - research usage. +Sometimes you want to debug your code using GPU(s). To connect to a +GPU node, you can follow the above guide, and request a `gpudev` partition. +Note that `gpudev` partition has a strict time limitation: Every session +is maximum 30 minutes long. For more information, see :doc:`partitions +<../ref/partitions.rst>`. + + Host triton-gpu-debug + ProxyCommand ssh triton /share/apps/ssh-node-proxycommand --partition=gpudev --time=0:30:00 + StrictHostKeyChecking no + UserKnownHostsFile /dev/null + User USERNAME + + # You also need a triton alias here: + + Host triton + HostName triton.aalto.fi + # ... any other thing you need for connecting to triton. + User USERNAME + + + +VSCode debugging +-------------------------------------------------- + +Following this guide, you can attach a debugger to a running job. + From 479ccdd3d95d7fc3b96776a83d0be0174fc2b127 Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Tue, 13 Feb 2024 13:48:16 +0200 Subject: [PATCH 2/3] Apply suggestions from code review --- triton/apps/vscode.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/triton/apps/vscode.rst b/triton/apps/vscode.rst index f46432c4e..aab4e83f7 100644 --- a/triton/apps/vscode.rst +++ b/triton/apps/vscode.rst @@ -138,10 +138,10 @@ Possible issues which may affect usage: jobs you may run from this vscode session). Sometimes you want to debug your code using GPU(s). To connect to a -GPU node, you can follow the above guide, and request a `gpudev` partition. -Note that `gpudev` partition has a strict time limitation: Every session +GPU node, you can follow the above guide, and request a ``gpudev`` partition. +Note that ``gpudev`` partition has a strict time limitation: Every session is maximum 30 minutes long. For more information, see :doc:`partitions -<../ref/partitions.rst>`. +<../ref/partitions>`. Host triton-gpu-debug ProxyCommand ssh triton /share/apps/ssh-node-proxycommand --partition=gpudev --time=0:30:00 From a1fd1a0b7d5d7690e24b0fc490529736c73f3fe0 Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Tue, 13 Feb 2024 13:58:35 +0200 Subject: [PATCH 3/3] Update triton/apps/vscode.rst --- triton/apps/vscode.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/triton/apps/vscode.rst b/triton/apps/vscode.rst index aab4e83f7..5a42779fb 100644 --- a/triton/apps/vscode.rst +++ b/triton/apps/vscode.rst @@ -140,8 +140,8 @@ Possible issues which may affect usage: Sometimes you want to debug your code using GPU(s). To connect to a GPU node, you can follow the above guide, and request a ``gpudev`` partition. Note that ``gpudev`` partition has a strict time limitation: Every session -is maximum 30 minutes long. For more information, see :doc:`partitions -<../ref/partitions>`. +is maximum 30 minutes long. For more information, see :ref:`partitions +`. Host triton-gpu-debug ProxyCommand ssh triton /share/apps/ssh-node-proxycommand --partition=gpudev --time=0:30:00