[TORCH] pin version#418
Conversation
There was a problem hiding this comment.
Code Review
This pull request pins the torch dependency to version 2.10.0 across the cuda, data, and torch optional dependency groups. Feedback suggests using a version range instead of an exact pin to prevent dependency conflicts and notes a version mismatch with torch-xla. Additionally, it is recommended to reference the torch extra within other groups to improve maintainability and consistency.
| ] | ||
| torch = [ | ||
| "torch>=2.10.0", | ||
| "torch==2.10.0", |
There was a problem hiding this comment.
Pinning torch to an exact version is generally discouraged for libraries as it can lead to dependency conflicts for users. It is recommended to use a version range (e.g., >=2.10.0, <3.0.0) to allow for minor updates and better compatibility. Additionally, there is a version mismatch in the tpu extra (line 45), which specifies torch-xla==2.9.0. Since torch-xla versions must match the torch version, updating torch to 2.10.0 without a corresponding update to torch-xla will cause runtime issues for TPU users.
| "torch==2.10.0", | |
| "torch>=2.10.0, <3.0.0", |
| [project.optional-dependencies] | ||
| cuda = [ | ||
| "torch>=2.10.0", | ||
| "torch==2.10.0", |
There was a problem hiding this comment.
To improve maintainability and ensure consistency across different installation options, consider referencing the torch extra instead of hardcoding the version string. This allows you to manage the PyTorch version requirement in a single location.
| "torch==2.10.0", | |
| "lm-engine[torch]", |
| data = [ | ||
| "ray[default]>=2.52.1", | ||
| "torch>=2.10.0", | ||
| "torch==2.10.0", |
No description provided.