Feat/gpu adoption - #9
Merged
Merged
Conversation
… CUDA if available, else CPU; *cuda -> CUDA only; *cpu -> force CPU / Added get_device_name() -> cuda or cpu / Added get_device_info() for health endpoints
…embedding-api, go-prediction-api, trainer-api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds GPU-first execution across embedding, GO prediction, and training services with a shared
CAFA_DEVICEpolicy (auto|cuda|cpu).Changes
Centralized device resolution in
src/utils.py(get_device,get_device_info)Embedding API uses
get_device()with FP16 on CUDA; GO prediction API loads and infers on the resolved deviceHealth endpoints expose device, cuda_available, and GPU name for runtime verification
Docker images install CUDA PyTorch (cu132); Compose enables
gpus: allandCAFA_DEVICE=autoon GPU servicesTest plan
docker compose up --build -dsucceeds with NVIDIA Container ToolkitHealth checks report
"device": "cuda"for embedding and GO APIsPOST /api/v1/predict-go-from-sequencesreturns GO predictionsCPU fallback works with
CAFA_DEVICE=cpuwhen GPU is unavailable