Skip to content

[WIP][AQUA] GPU Shape Recommendation #1221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

elizjo
Copy link
Member

@elizjo elizjo commented Jul 7, 2025

Wrote an additional POST API and aqua command for recommending GPU shapes for a particular model

{
  "model_ocid" : "ocid1.datasciencemodel.oc1.<ocid>"
}
ads aqua recommend which_gpu --model_ocid 'ocid1.datasciencemodel.oc1.<ocid>' "" 

Returns

{
  "recommendations": [
    {
      "shape_details": {
        "core_count": null,
        "memory_in_gbs": null,
        "name": "VM.GPU2.1",
        "shape_series": "GPU",
        "gpu_specs": {
          "gpu_memory_in_gbs": 16,
          "gpu_count": 1,
          "gpu_type": "P100",
          "quantization": [
            "fp16"
          ],
          "ranking": {
            "cost": 10,
            "performance": 10
          }
        }
      },
      "configurations": [
        {
          "model_details": {
            "model_size_gb": 7.04,
            "kv_cache_size_gb": 6.711,
            "total_model_gb": 13.751
          },
          "deployment_params": {
            "quantization": "4bit",
            "max_model_len": 32768,
            "batch_size": 1
          },
          "recommendation": "While the selected compute shape is estimated to work (13.8GB used / 16.0GB allowed), the model configuration is close to the GPU memory limit. This estimation is theoretical; actual memory usage may vary at runtime.\n\nIf you encounter issues with this shape, consider the following options to reduce memory usage:\n\nBoth model weights and KV cache are significant contributors to memory use. (KV cache: 6.7GB, Weights: 7.0GB).\n\nTo reduce model size:\n1. Use a model with fewer parameters.\n2. No smaller quantized version exists. Use a model with fewer parameters."
        }
      ]
    }
  ],
  "troubleshoot": ""
}

TODO:
logic for extracting the config.json from the huggingface model needs to be improved
need to write a whole unit test module + conduct testing (business logic works, but API is untested)

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 7, 2025
Copy link

github-actions bot commented Jul 7, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-18.62%

@mrDzurb mrDzurb changed the title GPU Shape Recommendation [AQUA] GPU Shape Recommendation Jul 7, 2025
Copy link

github-actions bot commented Jul 8, 2025

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-18.62%

@mrDzurb mrDzurb changed the title [AQUA] GPU Shape Recommendation [WIP][AQUA] GPU Shape Recommendation Jul 15, 2025
@elizjo elizjo force-pushed the ODSC-74228/GPU-Shape-Recommendation branch from 2f54f8b to 26e08a2 Compare July 25, 2025 17:29
Copy link

📌 Cov diff with main:

Coverage-32%

📌 Overall coverage:

Coverage-58.28%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant