dgxcloud: cancel() uses GET on the distributed suspend endpoint, and single-node ray jobs are polled under /workloads/trainings

Abierto
#704 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@dundysm ya está trabajando en esto.

Desde el 22/11/2026.

  • #705 de @dundysm — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python

Línea de trabajo

Start in nemo_run/core/execution/dgxcloud.py, comparing cancel() with status(), which already chooses trainings or distributed from nodes. Then check DGXCloudRayJob in nemo_run/run/ray/dgxcloud.py, where start() creates a distributed workload that the polling and cancel paths may read from trainings. Done means both paths use the collection the workload was created in, and a mocked-HTTP test confirms it. A fix is already open as PR #705, so check that before starting.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

community-request

describe the bug

DGXCloudExecutor talks to the run:ai workloads api on the wrong endpoint in two places:

  1. cancel() sends a GET to /workloads/distributed/{id}/suspend for every job. run:ai only exposes suspend as a POST (POST /api/v1/workloads/trainings/{workloadId}/suspend and POST /api/v1/workloads/distributed/{workloadId}/suspend), and create_training_job() submits single-node jobs to /workloads/trainings, so cancelling a single-node job hits an endpoint that does not know the workload. status() already picks trainings vs distributed from nodes; cancel() does not.
  2. DGXCloudRayJob.start() always creates a /workloads/distributed workload, even with nodes=1, but status(), wait(), stop() and logs() go through executor.status() / executor.cancel(), which infer trainings for a single node. status() treats the resulting non-200 as transient and returns None, so wait() never sees a terminal phase and polls forever, and stop() cannot suspend the job.

steps to reproduce (cpu only, mocked http)

from unittest.mock import MagicMock, patch
from nemo_run.core.execution.dgxcloud import DGXCloudExecutor
from nemo_run.run.ray.dgxcloud import DGXCloudRayJob

ex = DGXCloudExecutor(
    base_url="https://dgx.example.com/api/v1", kube_apiserver_url="https://k8s",
    client_id="a", client_secret="b", project_name="p",
    container_image="img", pvc_nemo_run_dir="/workspace/nemo_run", nodes=1,
)
with patch.object(DGXCloudExecutor, "get_auth_token", return_value="t"), \
     patch("requests.get", return_value=MagicMock(status_code=404)) as get:
    ex.cancel("job123")
    print(get.call_args.args[0])
    # GET .../workloads/distributed/job123/suspend (job was created under /workloads/trainings)

    DGXCloudRayJob(name="r", executor=ex, workload_id="wl1").status(display=False)
    print(get.call_args.args[0])
    # .../workloads/trainings/wl1, but the ray job was created under /workloads/distributed

expected behavior

cancel() posts to the suspend endpoint of the collection the workload was created in, and the ray job polls, streams and cancels its workload under /workloads/distributed regardless of node count.

i have a small fix with tests ready and will open a pr.

Lenguaje dominante
Python
Estrellas
268
Forks
121
Merge medio
3 h 42 min
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NVIDIA-NeMo/Run

Todos los issues de NVIDIA-NeMo/Run

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.