Skip to content

Add TransformerEngine - #26296

Closed
weiji14 wants to merge 12 commits into
conda-forge:mainfrom
weiji14:add-transformer-engine
Closed

Add TransformerEngine#26296
weiji14 wants to merge 12 commits into
conda-forge:mainfrom
weiji14:add-transformer-engine

Conversation

@weiji14

@weiji14 weiji14 commented May 9, 2024

Copy link
Copy Markdown
Member

A library for accelerating Transformer models on NVIDIA GPUs! Repo at https://github.com/NVIDIA/TransformerEngine

Checklist

  • Title of this PR is meaningful: e.g. "Adding my_nifty_package", not "updated meta.yaml".
  • License file is packaged (see here for an example).
  • Source is from official source.
  • Package does not vendor other packages. (If a package uses the source of another package, they should be separate packages or the licenses of all packages need to be packaged).
  • If static libraries are linked in, the license of the static library is packaged.
  • Package does not ship static libraries. If static libraries are needed, follow CFEP-18.
  • Build number is 0.
  • A tarball (url) rather than a repo (e.g. git_url) is used in your recipe (see here for more details).
  • GitHub users listed in the maintainer section have posted a comment confirming they are willing to be listed there.
  • When in trouble, please check our knowledge base documentation before pinging a team.

@conda-forge-webservices

Copy link
Copy Markdown

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (TransformerEngine) and found some lint.

Here's what I've got...

For TransformerEngine:

  • Please do not delete the example recipe found in recipes/example/meta.yaml.

A library for accelerating Transformer models on NVIDIA GPUs! Repo at https://github.com/NVIDIA/TransformerEngine
@weiji14
weiji14 force-pushed the add-transformer-engine branch from bd391e7 to 9bad097 Compare May 9, 2024 07:57
@conda-forge-webservices

Copy link
Copy Markdown

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/TransformerEngine) and found it was in an excellent condition.

@weiji14 weiji14 mentioned this pull request May 9, 2024
10 tasks
Comment thread recipes/TransformerEngine/meta.yaml Outdated
- pip
- python
run:
- flash-attn >=2.0.6,<=2.4.2,!=2.0.9,!=2.1.0

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait for NVIDIA/TransformerEngine#838 and a subsequent release, since conda-forge only has flash-attn=2.5.8 at the moment.

@weiji14

weiji14 commented May 15, 2024

Copy link
Copy Markdown
Member Author

So TransformerEngine v1.6 has a git submodule dependency on cudnn-frontend v1.3.0 (see https://github.com/NVIDIA/TransformerEngine/tree/v1.6/3rdparty). From reading conda-forge/conda-forge.github.io#619, it sounds like the proper way is to actually have a cudnn-frontend package on conda-forge and let transformer-engine depend on that, so opened #26370 for this.

Edit: TransformerEngine now uses cudnn-frontend=1.5.2 (NVIDIA/TransformerEngine#975) on its main branch (commit NVIDIA/TransformerEngine@67b6743), maybe wait for TransformerEngine v1.8?

Edit2: TransformerEngine v1.11 is using cudnn-frontend=1.6.1 (NVIDIA/TransformerEngine#1108). Do the update at conda-forge/python-cudnn-frontend-feedstock#10 first.

Edit3: TransformerEngine v1.12 is using cudnn-frontend=1.8.0 (NVIDIA/TransformerEngine#1302). Do the update at conda-forge/python-cudnn-frontend-feedstock#18 first.

@github-actions

Copy link
Copy Markdown
Contributor

Hi! This is the staged-recipes linter and your PR looks excellent! 🚀

@conda-forge-admin

conda-forge-admin commented Mar 28, 2025

Copy link
Copy Markdown
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/TransformerEngine/recipe.yaml) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipes/TransformerEngine/recipe.yaml:

  • ℹ️ No valid build backend found for Python recipe for package transformerengine using pip. Python recipes using pip need to explicitly specify a build backend in the host section. If your recipe has built with only pip in the host section in the past, you likely should add setuptools to the host section of your recipe.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/14261263322. Examine the logs at this URL for more detail.

@weiji14 weiji14 mentioned this pull request Mar 28, 2025
10 tasks
weiji14 added 5 commits April 4, 2025 16:40
Done using `conda-recipe-manager convert recipes/TransformerEngine/meta.yaml > recipes/TransformerEngine/recipe.yaml`
Fix `fatal error: cuda_runtime.h: No such file or directory`
Fix `fatal error: crt/host_config.h: No such file or directory`
Fixes

```
CMake Error at CMakeLists.txt:44 (include):
     include could not find requested file:
       $SRC_DIR/transformer_engine/common/../../3rdparty/cudnn-frontend/cmake/cuDNN.cmake
```
@weiji14

weiji14 commented Apr 30, 2025

Copy link
Copy Markdown
Member Author

Cmake build error from https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=1216048&view=logs&j=df9408f7-e795-500f-143d-aa7735a0ed8b&t=47addc80-ccbf-566b-ee3a-66cdb8436937&l=1351:

Building CMake extension transformer_engine
Running command $BUILD_PREFIX/bin/cmake -S $SRC_DIR/transformer_engine/common -B $SRC_DIR/build/cmake -DPython_EXECUTABLE=$PREFIX/bin/python -DPython_INCLUDE_DIR=$PREFIX/include/python3.9 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$SRC_DIR/build/lib.linux-x86_64-cpython-39 -DCMAKE_CUDA_ARCHITECTURES=70;80;89;90 -Dpybind11_DIR=$PREFIX/lib/python3.9/site-packages/pybind11/share/cmake/pybind11 -GNinja
CMake Error at $BUILD_PREFIX/share/cmake-4.0/Modules/CMakeDetermineCompilerId.cmake:868 (message):
  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.
  Compiler:
  $PREFIX/bin/nvcc
  Build flags:
  Id flags: --keep;--keep-dir;tmp -v
  The output was:
  127
  nvcc warning : Support for offline compilation for architectures prior to
  '<compute/sm/lto>_75' will be removed in a future release (Use
  -Wno-deprecated-gpu-targets to suppress warning).
  #$ NVCC_PREPEND_FLAGS="
  -ccbin=$BUILD_PREFIX/bin/x86_64-conda-linux-gnu-c++"
  #$ NVCC_APPEND_FLAGS="
  -I$PREFIX/targets/x86_64-linux/include
  -L$PREFIX/targets/x86_64-linux/lib
  -L$PREFIX/targets/x86_64-linux/lib/stubs"
  #$ _NVVM_BRANCH_=nvvm
  #$ _SPACE_=
  #$ _CUDART_=cudart
  #$
  _HERE_=$PREFIX/bin
  #$
  _THERE_=$PREFIX/bin
  #$ _TARGET_SIZE_=
  #$ _TARGET_DIR_=
  #$ _TARGET_DIR_=targets/x86_64-linux
  #$
  TOP=$PREFIX/bin/../targets/x86_64-linux
  #$
  CICC_PATH=$PREFIX/bin/../targets/x86_64-linux/nvvm/bin
  #$
  NVVMIR_LIBRARY_DIR=$PREFIX/bin/../targets/x86_64-linux/nvvm/libdevice
  #$
  LD_LIBRARY_PATH=$PREFIX/bin/../targets/x86_64-linux/lib:
  #$
  PATH=$PREFIX/bin/../targets/x86_64-linux/bin:$PREFIX/bin/../targets/x86_64-linux/nvvm/bin:$PREFIX/bin/../targets/x86_64-linux/../../bin:$PREFIX/bin/../targets/x86_64-linux/../../nvvm/bin:$BUILD_PREFIX/bin:$PREFIX/bin:/opt/conda/bin:/opt/conda/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/conda/bin
  #$
  INCLUDES="-I$PREFIX/bin/../targets/x86_64-linux/include"
  #$ LIBRARIES=
  "-L$PREFIX/bin/../targets/x86_64-linux/lib/stubs"
  "-L$PREFIX/bin/../targets/x86_64-linux/lib"
  #$ CUDAFE_FLAGS=
  #$ PTXAS_FLAGS=
  #$ rm tmp/a_dlink.reg.c
  #$
  "$BUILD_PREFIX/bin"/x86_64-conda-linux-gnu-c++
  -D__CUDA_ARCH_LIST__=520 -D__NV_LEGACY_LAUNCH -E -x c++ -D__CUDACC__
  -D__NVCC__
  -I"$PREFIX/targets/x86_64-linux/include"
  "-I$PREFIX/bin/../targets/x86_64-linux/include"
  -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=8
  -D__CUDACC_VER_BUILD__=93 -D__CUDA_API_VER_MAJOR__=12
  -D__CUDA_API_VER_MINOR__=8 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1
  -D__CUDACC_DEVICE_ATOMIC_BUILTINS__=1 -include "cuda_runtime.h" -m64
  "CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp4.ii"
  #$ cudafe++ --c++17 --gnu_version=130300 --display_error_number
  --orig_src_file_name "CMakeCUDACompilerId.cu" --orig_src_path_name
  "$SRC_DIR/build/cmake/CMakeFiles/4.0.0/CompilerIdCUDA/CMakeCUDACompilerId.cu"
  --allow_managed --m64 --parse_templates --gen_c_file_name
  "tmp/CMakeCUDACompilerId.cudafe1.cpp" --stub_file_name
  "CMakeCUDACompilerId.cudafe1.stub.c" --gen_module_id_file
  --module_id_file_name "tmp/CMakeCUDACompilerId.module_id"
  "tmp/CMakeCUDACompilerId.cpp4.ii"
  #$
  "$BUILD_PREFIX/bin"/x86_64-conda-linux-gnu-c++
  -D__CUDA_ARCH__=520 -D__CUDA_ARCH_LIST__=520 -D__NV_LEGACY_LAUNCH -E -x c++
  -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__
  -I"$PREFIX/targets/x86_64-linux/include"
  "-I$PREFIX/bin/../targets/x86_64-linux/include"
  -D__CUDACC_VER_MAJOR__=12 -D__CUDACC_VER_MINOR__=8
  -D__CUDACC_VER_BUILD__=93 -D__CUDA_API_VER_MAJOR__=12
  -D__CUDA_API_VER_MINOR__=8 -D__NVCC_DIAG_PRAGMA_SUPPORT__=1
  -D__CUDACC_DEVICE_ATOMIC_BUILTINS__=1 -include "cuda_runtime.h" -m64
  "CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp1.ii"
  #$ "$CICC_PATH/cicc" --c++17 --gnu_version=130300 --display_error_number
  --orig_src_file_name "CMakeCUDACompilerId.cu" --orig_src_path_name
  "$SRC_DIR/build/cmake/CMakeFiles/4.0.0/CompilerIdCUDA/CMakeCUDACompilerId.cu"
  --allow_managed -arch compute_52 -m64 --no-version-ident -ftz=0 -prec_div=1
  -prec_sqrt=1 -fmad=1 --include_file_name "CMakeCUDACompilerId.fatbin.c"
  -tused --module_id_file_name "tmp/CMakeCUDACompilerId.module_id"
  --gen_c_file_name "tmp/CMakeCUDACompilerId.cudafe1.c" --stub_file_name
  "tmp/CMakeCUDACompilerId.cudafe1.stub.c" --gen_device_file_name
  "tmp/CMakeCUDACompilerId.cudafe1.gpu" "tmp/CMakeCUDACompilerId.cpp1.ii" -o
  "tmp/CMakeCUDACompilerId.ptx"
  sh: line 1:
  $PREFIX/bin/../targets/x86_64-linux/nvvm/bin/cicc:
  No such file or directory
  # --error 0x7f --
  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.
  Compiler:
  $PREFIX/bin/nvcc
  Build flags:
  -Wl,--version-script=$SRC_DIR/transformer_engine/common/libtransformer_engine.version
  Id flags: --keep;--keep-dir;tmp -v
  The output was:
  1
  nvcc fatal : Unknown option
  '-Wl,--version-script=$SRC_DIR/transformer_engine/common/libtransformer_engine.version'
Call Stack (most recent call first):
  $BUILD_PREFIX/share/cmake-4.0/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  $BUILD_PREFIX/share/cmake-4.0/Modules/CMakeDetermineCompilerId.cmake:53 (__determine_compiler_id_test)
  $BUILD_PREFIX/share/cmake-4.0/Modules/CMakeDetermineCUDACompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:27 (project)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

@weiji14

weiji14 commented May 1, 2025

Copy link
Copy Markdown
Member Author

Closing since #29403 is merged 🚀 Feedstock is up at https://github.com/conda-forge/transformer-engine-feedstock

@weiji14 weiji14 closed this May 1, 2025
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

Successfully merging this pull request may close these issues.

2 participants