Skip to content

Optimize TrustyAI CPU image to use CPU-only PyTorch wheels instead of CUDA wheelsΒ #2151

@coderabbitai

Description

@coderabbitai

Problem Description

The TrustyAI CPU Dockerfile () currently uses a that contains CUDA-enabled PyTorch wheels, even though this is intended to be a CPU-only image.

Current State

  • File:
  • Current PyTorch version:
  • Current wheel source: CUDA-specific wheels from
  • Impact: Unnecessarily large image size and potential compatibility issues

Affected Components

  • TrustyAI CPU notebook image
  • PyTorch dependency resolution
  • Image build size and performance

Solution Options

Option 1: Regenerate lock with CPU-only PyTorch

  • Modify to exclude CUDA index for CPU builds
  • Regenerate with CPU-only PyTorch wheels
  • Ensure torch version becomes (without suffix)

Option 2: Separate CPU/CUDA lock files

  • Maintain separate files for CPU and CUDA variants
  • Update Dockerfiles to use appropriate lock file

Option 3: Conditional lock generation

  • Use build arguments or environment variables to generate appropriate locks

Acceptance Criteria

  • TrustyAI CPU image uses CPU-only PyTorch wheels
  • No CUDA-specific URLs or version suffixes in CPU image lock file
  • Image size reduction verified
  • Functional testing confirms no regression in CPU-only workflows
  • Build process documentation updated if needed

Context

Additional Notes

This optimization would ensure CPU images only pull CPU-optimized wheels, reducing image size and avoiding unnecessary CUDA dependencies in CPU-only environments.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

πŸ“‹ Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions