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

Torchaudio installation note / instructions #165

Open
ptheywood opened this issue Feb 7, 2023 · 4 comments
Open

Torchaudio installation note / instructions #165

ptheywood opened this issue Feb 7, 2023 · 4 comments

Comments

@ptheywood
Copy link
Member

Open-CE does not provide binary installs of torchaudio (but does include pytorch and torchvision).

Adding a mention of this to the pytorch page may be worthwhile, along with instructions to build from source (which is not completely trivial)

# Create a conda environment, with Open-CE 1.8.0 set up (important to know the version of pytorch/torchaudio to build
conda create -y --name torchaudio python=3.10
conda activate torchaudio

conda config --env --prepend channels https://ftp.osuosl.org/pub/open-ce/1.8.0/
conda config --env --set channel_priority strict

# Install pytorch 1.13.0 and the matching cuda toolkit from open-ce, including nvcc. Linking failed using the system provided nvcc. 
conda install -y pytorch==1.13.0 cudatoolkit cudatoolkit-dev cmake 

# Conda should be setting environment variables so nvcc, include dirs ans so files can be found, but if not set these vars manually. 
export PATH=${CONDA_PREFIX}/bin:${PATH}
export CPATH=${CONDA_PREFIX}/include:${CPATH}
export LIBRARY_PATH=${CONDA_PREFIX}/lib:${LIBRARY_PATH}
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib64:${LD_LIBRARY_PATH}

# Clone torch audio v0.13.0 release - i.e. matching the torch version 
git clone --depth 1 --branch v0.13.0 https://github.com/pytorch/audio.git

# Change into the audio directory, 
cd audio

# Build pytorch audio from source. This may take a while.
python3 setup.py install

# Change out of the audio directory
cd ../

# Confirm it is installed 
python3 -c "import torchaudio; print(torchaudio.__version__)"

It is unclear to me why I had to export the variables above on Bede, as conda should have handled those for me afiak.

@willfurnass
Copy link
Collaborator

Buliding a conda package could be another option (untested on ppc64le): https://github.com/pytorch/audio/blob/main/packaging/build_conda.sh

@ptheywood
Copy link
Member Author

Buliding a conda package could be another option (untested on ppc64le): https://github.com/pytorch/audio/blob/main/packaging/build_conda.sh

I considered attempting to produce a conda package, but the various bash scripts that calls out to would need ammending to reference the Open-CE conda channel instead (for ppc64le builds of pytorch which are not provided by the pytorch channels explicitly referenced in https://github.com/pytorch/audio/blob/main/packaging/pkg_helpers.bash), although presumably for a one-off build the appropriate conda build command could probably be found.

A more open-ce like / compatible approach would be to create a torchaudio version of https://github.com/open-ce/torchvision-feedstock

@willfurnass
Copy link
Collaborator

willfurnass commented Feb 8, 2023

Figured out what system(s) the ppc64le open-ce conda feedstock packages are build on?

@ptheywood
Copy link
Member Author

They will be run by the conda channel hosts, which are currently OSU and MIT.

open-ce/open-ce-builder describes how to build packages from feedstocks (either collections or individual packages) but that is as far as I looked into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants