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/false,
    "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.1.tar.gz (9.7 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.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for jupyterhub_enverge_gpu_check-0.0.1.tar.gz
Algorithm Hash digest
SHA256 5bbeadb4ee9baf90b74f1a93e5c3352db65d709d3d0b1b28f0b6cd1ca0c523fe
MD5 316a76a3a0db6aca55fcb9f6faaba00a
BLAKE2b-256 72bc2936e601cd871f852d5b8eb6e32e338a58fefbd4479de6456f4e4d91f6ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyterhub_enverge_gpu_check-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f12f37e7f0d1ee68c8375a978c181b29d8320b32297ae016684f464ff36ab9
MD5 50babb8838110af309bd674d25a20472
BLAKE2b-256 3bb66f6c59ff4b6bbf4c3ecdeca7b86fd60802975c8d76e6851457b170608c34

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