Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error that was preventing requirements versions to be used in setup #448

Merged
merged 2 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements/main.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
numpy>=1.19.2
scipy>=1.5.3
scikit-sparse>=0.4.5
# torch>=1.7.1 will do separate install instructions for now (CUDA dependent)
pytest>=6.2.1
pybind11>=2.7.1
functorch==0.2.1 # > 0.2.1 will install torch1.13, which breaks CUDA 10.2
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
torch_cpp_ext.MINIMUM_GCC_VERSION,
(8, 4, 99),
)

torch_version = torch.__version__.split(".")
torch_geq_113 = (
int(torch_version[0]) > 1
or int(torch_version[0]) == 1
and int(torch_version[1]) >= 13
)
except ModuleNotFoundError:
print("Theseus installation requires torch.")
sys.exit(1)
Expand All @@ -34,8 +41,12 @@ def parse_requirements_file(path):
with open(path) as f:
reqs = []
for line in f:
if "functorch" in line and torch_geq_113:
# Don't install functorch 0.2.1 if torch 1.13 already
# installed
continue
line = line.strip()
reqs.append(line.split("==")[0])
reqs.append(line)
return reqs


Expand Down