Skip to content

minimize the docker file size using torch CPU version #1246

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 3 commits into
base: dev
Choose a base branch
from

Conversation

praveshkumar1988
Copy link
Collaborator

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request aims to reduce the Docker file size by switching to the CPU versions of Torch packages.

  • Replaces Torch, TorchVision, and TorchAudio with their CPU-specific builds.
  • Adds a constraints file to enforce the use of CPU-only package versions.
Files not reviewed (1)
  • backend/Dockerfile: Language not supported

Comment on lines 1 to 4
torch==2.3.1+cpu
torchvision==0.18.1+cpu
torchaudio==2.3.1+cpu
-f https://download.pytorch.org/whl/torch_stable.html
Copy link
Preview

Copilot AI Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The '-f' option specifying the package index should be placed at the beginning of the file so that it applies to all package specifications.

Suggested change
torch==2.3.1+cpu
torchvision==0.18.1+cpu
torchaudio==2.3.1+cpu
-f https://download.pytorch.org/whl/torch_stable.html
-f https://download.pytorch.org/whl/torch_stable.html
torch==2.3.1+cpu
torchvision==0.18.1+cpu
torchaudio==2.3.1+cpu

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to minimize the Docker file size by switching to CPU-specific versions of PyTorch and its related libraries.

  • Updated the constraints to use torch, torchvision, and torchaudio CPU versions.
Files not reviewed (1)
  • backend/Dockerfile: Language not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimization for building more efficient backend image requires less disk space and time
1 participant