Skip to content
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

Pin torch and associated components' version to ensure predictable behaviors #69

Closed
w8mej opened this issue Nov 30, 2023 · 1 comment
Closed
Assignees
Labels

Comments

@w8mej
Copy link
Contributor

w8mej commented Nov 30, 2023

FYI

I would submit a PR but it isn't clear to me which versions need to be pinned for the above mentioned components. Hence submitting an issue without a PR.

Pin torch and associated components' versions

Description

While requirements.txt's content pins specific library versions, Vigil's Dockerfile pip execution on line 42 does not pin specific versions to torch and associated components. More details on the afflicted file & line of code at https://github.com/deadbits/vigil-llm/blob/d53774ca771ff95418d3da4a08d6039c2883f992/Dockerfile#L42C2-L42C112



When you don't version pin, you're not forcing the docker build to verify it has a specific version and thus the required packages you need. This can have unexpected behavior if we install a different version than what we originally installed when we created the Dockerfile. In addition, this technique can also reduce failures due to unanticipated changes in required packages.

Steps to Reproduce

  1. Follow the build steps as outlined in the docs's Docker README.md to build and run the afflicted Dockerfile configuration.

Expected Behavior for example given the above FYI

RUN     && pip install --no-cache-dir torch==2.1.1 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cpu

Actual Behavior

RUN pip install --no-cache-dir torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu .  As a result, my build cache results in sub-optimal behaviors when handling changes in the required packages.

Possible Fix

By pinning the version of torch and associated components, the docker build is forced to retrieve the particular version regardless of what may be in the Docker layer cache.

My Environment

  • Project Version: 0.8.7
  • Operating System: Container - Linux
  • Browser: N/A
  • Other Software: Docker, Python, Pip, Torch

Additional Context

@deadbits
Copy link
Owner

deadbits commented Dec 6, 2023

All set with #71

I pinned to torch==2.1.1+cpu and torchvision==0.16.1+cpu, and removed the unused torchaudio library

@deadbits deadbits closed this as completed Dec 6, 2023
@deadbits deadbits self-assigned this Dec 6, 2023
@deadbits deadbits added the docker label Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants