fix(kagent-feast-mcp): pin torch to CPU-only wheel to reduce image size by ~2.3GB#199
Open
Kunal-Somani wants to merge 1 commit intokubeflow:mainfrom
Open
Conversation
requirements.txt listed bare 'torch' which installs the full CUDA wheel (~2.5GB) by default. The Dockerfile uses python:3.10-slim — a CPU-only base image with no CUDA drivers. The embedding model runs on CPU regardless, so the CUDA payload is entirely dead weight. Pin torch to the official CPU-only index URL, reducing the installed wheel from ~2.5GB to ~200MB and the final Docker image from ~3.5GB to under 1GB with no change in runtime behavior. Fixes kubeflow#198 Signed-off-by: Kunal <kunal120222@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
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
Fixes #198
requirements.txtlisted baretorchwhich installs the full CUDA-enabled wheel (~2.5GB) by default. The Dockerfile usespython:3.10-slim— a CPU-only base image with no CUDA drivers. The embedding model (all-mpnet-base-v2) runs on CPU regardless, making the entire CUDA payload dead weight.Root Cause
# Before torch ← pip installs full CUDA wheel (~2.5GB) by defaultFROM python:3.10-slim ← CPU-only, no CUDA drivers availableFix
# After torch --index-url https://download.pytorch.org/whl/cpuImpact
No change in functionality — the model runs on CPU in both cases.
Checklist