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

Using torchaudio alongside TransformerEngine #211

Closed
tylerweitzman opened this issue May 10, 2023 · 2 comments
Closed

Using torchaudio alongside TransformerEngine #211

tylerweitzman opened this issue May 10, 2023 · 2 comments

Comments

@tylerweitzman
Copy link

tylerweitzman commented May 10, 2023

Hi,
I do not know how to use torchaudio alongide TransformerEngine. The NGC docker nvcr.io/nvidia/pytorch:23.04-py3 doesn't come installed with torchaudio. If I do a normal torch install I lose CUDA 12.1. So, I'm using torch-nightly instead with cuda 12.1: pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121

But then when I import import transformer_engine.pytorch as te I get this error:
ImportError: /usr/local/lib/python3.8/dist-packages/transformer_engine_extensions.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

By the way, does TransformerEngine support Python 3.11 or do I have to use Python 3.8?

Thank you

@timmoon10
Copy link
Collaborator

Are you rebuilding Transformer Engine after reinstalling PyTorch? If not, any C++ differences in PyTorch at build time and run time could lead to your linker errors.

Alternatively, it seems simpler to run pip3 install torchaudio within the NGC container. If that is doing something drastic like reinstalling PyTorch, you could try something like:

pip3 install kaldi_io SoundFile  # https://github.com/pytorch/audio/blob/main/requirements.txt
pip3 install --no-deps torchaudio

I don't think there is anything preventing you from running TE with Python 3.11, but it just depends on what environment you've installed PyTorch.

@hiddefolkertsma
Copy link

I've had a similar issue, using nvcr.io/nvidia/pytorch:23.06-py3. Installing torchaudio nightly with torch nightly also installed a lower CublasLT version (120100 vs 120103 that ships with the container), which meant I couldn't use FP8 on Ada:

return False, "CublasLt version 12.1.3.x or higher required for FP8 execution on Ada."

I solved it by installing torchaudio from source like so:

git clone https://github.com/pytorch/audio
cd audio
pip install -v -e . --no-use-pep517

tested with

torch                   2.1.0a0+4136153
torchaudio              2.1.0a0+6324462
transformer-engine      0.12.0.dev0+7a30ba4

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

4 participants