feat: add PyTorch setup script for modular installation#117
feat: add PyTorch setup script for modular installation#117cmagina wants to merge 7 commits intoredhat-et:mainfrom
Conversation
e09eb4a to
d5c4916
Compare
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
294eac2 to
f61a04f
Compare
55e5a0e to
96a56df
Compare
Add scripts/setup_torch.sh to support PyTorch installation and configuration within containers. This script: - Downloads PyTorch source from GitHub when not mounted as a volume - Installs build dependencies for PyTorch compilation - Supports installing PyTorch wheels from PyPI (release, nightly, test) - Provides flexible configuration via INSTALL_TORCH environment variable The script supports multiple installation modes: - source: Build from source (with auto-download if not mounted) - release/nightly/test: Install wheels from PyPI - skip: Skip PyTorch installation This is part of the modular script architecture introduced in PR redhat-et#115. Signed-off-by: Craig Magina <cmagina@redhat.com>
96a56df to
67d97a4
Compare
scripts/devinstall_torch.sh
Outdated
| git submodule update --init --recursive | ||
|
|
||
| if [ -n "${TORCH_GITREF:-}" ]; then | ||
| git checkout "" |
There was a problem hiding this comment.
looks like TORCH_GITREF might be missing here
There was a problem hiding this comment.
Wow, that is quite a miss, thanks.
scripts/devinstall_torch.sh
Outdated
| if [ -f requirements.txt ]; then | ||
| pip_install --group dev | ||
| pip_install mkl-static mkl-include | ||
| make triton |
There was a problem hiding this comment.
Doesn't this cause us to install triton twice due to the preceding devinstall_triton.sh?
There was a problem hiding this comment.
Those are the instructions from pytorch for installing build deps.
https://github.com/pytorch/pytorch?tab=readme-ov-file#install-dependencies
Although, re-reading the comment, that one should be left to the dev. Will remove it.
Makefile
Outdated
| INSTALL_NSIGHT ?=false | ||
| user_path ?= | ||
| torch_path ?= | ||
| user_path ?= |
hinriksnaer
left a comment
There was a problem hiding this comment.
left a couple of comments
Signed-off-by: Craig Magina <cmagina@redhat.com>
Signed-off-by: Craig Magina <cmagina@redhat.com>
Signed-off-by: Craig Magina <cmagina@redhat.com>
Signed-off-by: Craig Magina <cmagina@redhat.com>
- Moved to using local variables inside install_whl cleaning up old globals from when it wasn't a function - Fixed the devinstall_triton torch dep install to respect the user's INSTALL_TORCH Signed-off-by: Craig Magina <cmagina@redhat.com>
Signed-off-by: Craig Magina <cmagina@redhat.com>
Summary
This PR is part 3 of 11 in the rework modernization effort. It adds the PyTorch setup script as part of the modular framework installation architecture.
Changes:
scripts/setup_torch.shfor PyTorch installation and configurationFeatures:
INSTALL_TORCHenvironment variable:source: Build from source (with auto-download if not mounted)release,nightly,test: Install wheels from PyPIskip: Skip PyTorch installationWhy this change?
PyTorch is a core framework used by Triton, vLLM, and other projects. This dedicated setup script:
Testing:
Dependencies:
Related PRs:
🤖 Generated with Claude Code