Skip to content

Commit

Permalink
Fix undefined symbol issue for transformer_engine::getenv (#763)
Browse files Browse the repository at this point in the history
Signed-off-by: Jinze Xue <jinzex@nvidia.com>
Co-authored-by: Jinze Xue <jinzex@nvidia.com>
  • Loading branch information
jinzex and jinzex authored Apr 10, 2024
1 parent bfe21c3 commit 1b20f2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,12 @@ def setup_pytorch_extension() -> setuptools.Extension:
sources = [
src_dir / "common.cu",
src_dir / "ts_fp8_op.cpp",
# We need to compile system.cpp because the pytorch extension uses
# transformer_engine::getenv. This is a workaround to avoid direct
# linking with libtransformer_engine.so, as the pre-built PyTorch
# wheel from conda or PyPI was not built with CXX11_ABI, and will
# cause undefined symbol issues.
root_path / "transformer_engine" / "common" / "util" / "system.cpp",
] + \
_all_files_in_dir(extensions_dir)

Expand Down

0 comments on commit 1b20f2d

Please sign in to comment.