Directly in Ray:

ray submit config.yaml script.py --start --stop --port-forward 8265

In ssh in general:

ssh -L 8000:localhost:8265 gw.example.com

In GCP:

gcloud compute ssh ray-default-head-071df709 \\
    --project perseids-scholarship \\
    --zone europe-west2-a \\
    -- -L 8000:localhost:8265

In Azure:

ssh -L 8000:localhost.239:8265 ubuntu@vm-public-ip
# Before Ray
model.custom_att           # Works

# After Ray
model.custom_att           # Fails
model.module.custom_att    # Works
RuntimeError: CUDA out of memory. Tried to allocate 5.54 GiB (GPU 0; 15.90 GiB total capacity; 11.08 GiB already allocated; 4.10 GiB free; 11.09 GiB reserved in total by PyTorch)