8000 GitHub - tiran/llvm-triton
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tiran/llvm-triton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LLVM for Triton

Why

The Triton Python package requires a special build of LLVM to compile. The build system of upstream Triton downloads community binaries at build time. For obvious reasons, we cannot trust these binaries and have to compile our own LLVM. The regular LLVM builds in RHEL do not work for us.

  • Triton is not compatible with regular releases of LLVM. Instead it needs an LLVM version from a specific git commit.
  • Almost every version of Triton needs a different version of LLVM. The commit is recorded in cmake/llvm-hash.txt.
  • LLVM must be built with MLIR support and LLVM targets "AMDGU", "NVPTX" (NVIDIA), and the current CPU architecture. It must not be built with any additional CPU architecture, otherwise Triton fails with missing symbols.
  • Dylib (dynamic, shared library) builds of LLVM are not supported. Normally, a full static build of LLVM is very large, because all tools are linked statically as well. Triton does not depend on LLVM tools, which allows us to exclude tools.
  • LLVM must be compiled without _GLIBCXX_ASSERTIONS define.

What

The build_llvm_triton.py command

  1. download llvm-project tar ball from GitHub at a specific commit
  2. unpacks the sources
  3. builds LLVM for Triton
  4. installs LLVM to usr/lib64/llvm-triton-{shortcommit} into a local destdir
  5. packs and imports the build into a new, empty container image with name llvm-triton-{shortcommit}-{os_id}{os_version_id}

The container image is not runnable. It is designed to be used as a container-first artifact that can be copied into another container

COPY --from=.../llvm-triton-{shortcommit}-{os_id}{os_version_id} \
    /usr/lib64/llvm-triton-{shortcommit} /usr/lib64/llvm-triton-{shortcommit}

NOTE: shortcommit are the first 8 characters of the full SHA-1 commit hash

How to build

You need an API token with write permission to push the image.

$ ./build_llvm_triton.py a66376b0dc3b2ea8a84fda26faca287980986f78
$ podman login your.registry -u token -p <token>
$ podman push your.registry/llvm-triton-a66376b0-ubi9.4-x86_64:latest

Create image index (manifest with multiple architectures)

$ podman manifest create your.registry/llvm-triton-a66376b0-ubi9.4:latest
$ podman manifest add your.registry/llvm-triton-a66376b0-ubi9.4:latest docker://your.registry/llvm-triton-a66376b0-ubi9.4-aarch64:latest
$ podman manifest add your.registry/llvm-triton-a66376b0-ubi9.4:latest docker://your.registry/llvm-triton-a66376b0-ubi9.4-x86_64:latest
$ podman manifest push --all your.registry/llvm-triton-a66376b0-ubi9.4:latest

LLVM commits

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0