Skip to main content

JupyterHub GPU Resource Usage Analyzer

Project description

GPU Resource Analysis Service

Sponsored by Enverge.ai - Simpler, greener, cheaper AI training platform. Enverge harnesses excess green energy for powerful, cost-effective computing on GPUs, enabling environmentally friendly AI model development, training, and fine-tuning. Currently in private alpha with limited spots available.

API endpoint to analyze PyTorch code for GPU resource usage.

Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Configure in jupyterhub_config.py:
c.JupyterHub.services = [
    {
        'name': 'gpu-check',
        'url': 'http://127.0.0.1:8005',
        'command': ['python', '-m', 'gpu_check.gpu_check_service'],
        'environment': {
            'JUPYTERHUB_SERVICE_PREFIX': '/services/gpu-check',
            'JUPYTERHUB_SERVICE_PORT': '8005'
        }
    }
]

API

POST /services/gpu-check

Analyzes PyTorch code for GPU resource usage.

Request:

{
    "code": "your_python_code_here"
}

Response:

{
    "has_resource_usage": true,
    "operations": {
        "compute": ["operation1", "operation2"],
        "memory": ["operation1", "operation2"],
        "transfer": ["operation1", "operation2"],
        "query": ["operation1", "operation2"]
    },
    "device_variables": ["variable1", "variable2"],
    "error": null
}

Usage in JupyterLab Extension

The service can be accessed from your JupyterLab extension using the authenticated endpoint:

const response = await fetch('/services/gpu-check', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({ code: 'your_code_here' })
});
const result = await response.json();

GET /health

Health check endpoint.

Response:

{
    "status": "healthy"
}

API Documentation

Once the server is running, you can access the interactive API documentation at:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterhub_enverge_gpu_check-0.0.2.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyterhub_enverge_gpu_check-0.0.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file jupyterhub_enverge_gpu_check-0.0.2.tar.gz.

File metadata

File hashes

Hashes for jupyterhub_enverge_gpu_check-0.0.2.tar.gz
Algorithm Hash digest
SHA256 23589cad6a0ad6e453bad5669c7c2f50368b32e7ca10a4c8845c170c7e841be9
MD5 2e5d514187fd07be438748e8e15ab213
BLAKE2b-256 b5e5321ba0e177f1e997ba3f69e39e5651087b5f498c589be272821a5d42aaea

See more details on using hashes here.

File details

Details for the file jupyterhub_enverge_gpu_check-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterhub_enverge_gpu_check-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 470b367f81386810d64f70b8a0c679213f309f5d97052337c3eb335f00127814
MD5 987d3472ae2ed5099638915fdf894be2
BLAKE2b-256 a413734aaf798ff41258c09e5cded5b4d70d23ed3d209fbdd9094e792433bfce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page