Skip to content

feat: AE-2343: dependencies cleanup#38

Merged
jhcipar merged 1 commit intomainfrom
jhcipar/AE-2343/remove-example-deps
Mar 5, 2026
Merged

feat: AE-2343: dependencies cleanup#38
jhcipar merged 1 commit intomainfrom
jhcipar/AE-2343/remove-example-deps

Conversation

@jhcipar
Copy link
Contributor

@jhcipar jhcipar commented Mar 4, 2026

Two main changes:

  1. removes torch as an explicit dependency on a lot of the gpu workers; it is baked into the base flash worker image, so installing it again and having it get packaged up at build time was unnecessary
  2. stringifies version responses for the dependencies example; otherwise they would get unpickled and evaluated as python objects and throw an error because the local python version doesn't have those dependencies installed

@jhcipar jhcipar marked this pull request as ready for review March 4, 2026 23:52
Copy link

@runpod-Henrik runpod-Henrik left a comment

Choose a reason for hiding this comment

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

Review: dependencies cleanup (AE-2343)

1. Torch removal from dependencies — correct ✅

Removing torch from dependencies=[] in 4 files:

  • 03_mixed_workers/gpu_worker.py
  • 04_dependencies/gpu_worker.py
  • 01_text_to_speech/gpu_worker.py
  • 01_network_volumes/gpu_worker.py

Since torch is baked into the GPU base image, declaring it in dependencies caused it to be re-bundled into the build artifact (~2.5GB), hitting the upload size limit (AE-2343). This is the right fix.

2. Version stringification — correct ✅

# Before (broken when unpickled locally):
"pandas": pd.__version__

# After (safe — plain string):
"pandas": str(pd.__version__)

This fixes a real issue: __version__ attributes on some packages are lazy objects (not plain strings). When cloudpickle serializes them for the response and the local machine doesn't have the package installed, deserialization fails. Wrapping in str() forces eager evaluation on the worker where the package is available.

Changed in 3 files: cpu_worker.py (4 versions), gpu_worker.py (4 versions + opencv), consistent pattern throughout.

3. README updates — clean

Dependencies README correctly updated to use lightweight packages (requests, httpx, python-dateutil) as examples instead of torch. Added helpful note about torch being in the base image.

4. Minor nit (non-blocking)

gpu_worker.py:49 — the new import:

from importlib.metadata import version

This shadows the outer scope if anyone later adds a version variable. Fine in practice since it's inside the function body, but metadata_version or similar would avoid any confusion. Not worth changing.

Verdict: PASS — recommend approving. Clean, minimal fix for a real build-size issue. No new bugs introduced.

🤖 Reviewed by Henrik's AI-Powered Bug Finder

@deanq deanq changed the title Feat: AE-2343: dependencies cleanup feat: AE-2343: dependencies cleanup Mar 5, 2026
@jhcipar jhcipar force-pushed the jhcipar/AE-2343/remove-example-deps branch from 7210495 to 79a7715 Compare March 5, 2026 01:17
@jhcipar jhcipar merged commit 9414a11 into main Mar 5, 2026
6 checks passed
@jhcipar jhcipar deleted the jhcipar/AE-2343/remove-example-deps branch March 5, 2026 01:20
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.

2 participants