Torch & double resolves, We have been struggling f...
# general
w
Torch & double resolves, We have been struggling for days with getting torch projects build locally on Mac and on Linux Docker. I have read other posts about Torch, and the bugs, but I think our situation is slightly different as we have a bunch of existing Poetry projects that specify numeric requirements that fail with specific torch versions (+cpu, +cu118 etc). I think I have finally found something that works for our situation but I wonder if there is a way to make it more elegant? Here is what I have:
# Contains torch pinned to 2.0.0 but no cuda/nvidia dependencies
poetry_requirements(
name="reqs",
source="pyproject.toml",
module_mapping={
"imath": ["Imath"],
...
},
resolve="python-default"
)
# Contains all coda dependencies spelled out with version from a poetry.lock file
python_requirements(
name="cuda_reqs",
source="cuda_requirements.txt",
resolve="cuda",
)
# Getting dependencies again from the same Poetry file but overriding
# the Torch dependencies, as these are not picked up
# Uses another resolve since if I do it for python--local, I can't
# export a venv anymore because the coda dependencies are not found for Mac
poetry_requirements(
name="reqs_2",
source="pyproject.toml",
module_mapping={
"imath": ["Imath"],
...
},
overrides={
"torch": {
"dependencies": [
":cuda_reqs#nvidia-cublas-cu11",
...
":cuda_reqs#triton"
]
}
},
resolve="cuda"
)