Ignite: PyTorch dependency is lacking version constraint

Created on 7 Apr 2020  路  3Comments  路  Source: pytorch/ignite

馃悰 Bug description


PyTorch is a dependency of Ignite and, thus, is specified in setup.py

https://github.com/pytorch/ignite/blob/4b311cc82fe45b3082661125cd7ee54007283fb0/setup.py#L24-L26

and conda.recipe/meta.yaml:

https://github.com/pytorch/ignite/blob/4b311cc82fe45b3082661125cd7ee54007283fb0/conda.recipe/meta.yaml#L15-L23

The PyTorch dependency is lacking a version constraint which may work fine right now, but there is no guarantee that Ignite will be compatible with any future major PyTorch release (e.g. PyTorch v2.x).

I suggest to constrain the PyTorch version that Ignite is compatible with, e.g. >=1.0,<2 or <2 if any 0.x and 1.x version works. If PyTorch has a new major release, even previous Ignite versions can become compatible with the new major PyTorch release (especially if no changes to the code are necessary) by making new bug fix releases with relaxed version constraints to include the new PyTorch version.

In my opinion, it is highly preferable to be conservative about dependency version constraints through a compatible release constraint in case the dependency conforms with semantic versioning. It is impossible to guarantee compatibility with a future major release of a dependency as its API can change arbitrarily.

enhancement good first issue help wanted

Most helpful comment

@sisp this makes sense, thanks for the suggestion !
Currently, we maintain and test the compatibility with the latest stable and nightly version of PyTorch.
Yes, I think we can add >=1.0,<2 as compatible release constrain.

cc @ykumards @sdesrozis

All 3 comments

@sisp this makes sense, thanks for the suggestion !
Currently, we maintain and test the compatibility with the latest stable and nightly version of PyTorch.
Yes, I think we can add >=1.0,<2 as compatible release constrain.

cc @ykumards @sdesrozis

We should provide tools to configure virtual envs with good like this conda.yaml

name: ignite_env
channels:
  - pytorch
dependencies:
  - pip
  - pytorch>=1.4
  - torchvision>=0.5
  - tensorboard>=2.1
  - pandas>=1.0
  - pyyaml>=5.3
  - pip:
    - git+https://github.com/pytorch/ignite

usable like conda env create -f conda.yml

and Dockerfile maybe

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CreateRandom picture CreateRandom  路  3Comments

UjwalKandi picture UjwalKandi  路  3Comments

samarth-robo picture samarth-robo  路  3Comments

andreydung picture andreydung  路  4Comments

vfdev-5 picture vfdev-5  路  4Comments