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

Fix index when installing torch through smart build #449

Merged
merged 4 commits into from
Jan 8, 2024
Merged
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
8 changes: 5 additions & 3 deletions smartsim/_core/_cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,10 @@ def build_redis_ai(
logger.info("ML Backends and RedisAI build complete!")


def check_py_torch_version(versions: Versioner, device: _TDeviceStr = "cpu") -> None:
def check_py_torch_version(versions: Versioner, device_in: _TDeviceStr = "cpu") -> None:
"""Check Python environment for TensorFlow installation"""

device = device_in.lower()
if BuildEnv.is_macos():
if device == "gpu":
raise BuildError("SmartSim does not support GPU on MacOS")
Expand Down Expand Up @@ -260,10 +261,11 @@ def check_py_torch_version(versions: Versioner, device: _TDeviceStr = "cpu") ->
"Torch version not found in python environment. "
"Attempting to install via `pip`"
)
wheel_device = device if device == "cpu" else device_suffix.replace("+","")
pip(
"install",
"-f",
"https://download.pytorch.org/whl/torch_stable.html",
"--extra-index-url",
f"https://download.pytorch.org/whl/{wheel_device}",
*(f"{package}=={version}" for package, version in torch_deps.items()),
)
elif missing or conflicts:
Expand Down
Loading