Skip to content

CI does not test examples with latest pytorch #1329

Open
@dvrogozh

Description

@dvrogozh

With: 8393ceb

This issue is a follow up on #1327 (comment). We've tried to update fast_neural_style example which required bumping up pytorch version and spotted few issues. Findings are around the fact that CI scripts run bulk install of dependencies for all examples at once. See:

examples/utils.sh

Lines 26 to 31 in 8393ceb

cat $BASE_DIR/*/requirements.txt | \
sort -u | \
# testing the installed version of torch, so don't pip install it.
grep -vE '^torch$' | \
pip install -r /dev/stdin || \
{ error "failed to install dependencies"; exit 1; }

This causes downgrade of nightly torch installed by the CI:

I suggest to consider the following improvements for pytorch examples:

  • Each example must have requirements.txt (some miss it as fast_neural_style does), Respect each example requirements and use uv #1330
  • CI scripts must not bulk install dependencies, but respect each example individual requirements.txt, Respect each example requirements and use uv #1330
  • (to discuss) CI to prepare environment for each example from scratch instead of installing next example environment on top of previous one, Respect each example requirements and use uv #1330
    • note: this requires significant change to current scripts and requires discussion
  • Examples must not pin version of pytorch packages (torch, torchvision, etc.) unless as a workaround to specific issues (which must be explicitly noted) or due to example deprecation with the future drop

Alternatively, we can consider that (UPDATE: we've dismissed this after discussion):

  • All examples must comply to the single dependency list supported on the pytorch examples repo top level

CC: @malfet, @atalman, @msaroufim

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions