mirror of
https://github.com/ROCm/ROCm.git
synced 2026-04-05 03:01:17 -04:00
[BUILD][DOCS] updated setup.py and documentation (#1930)
This commit is contained in:
@@ -51,3 +51,72 @@ A well-structured RFC should include:
|
||||
## New backends
|
||||
|
||||
Due to limited resources, we need to prioritize the number of targets we support. We are committed to providing upstream support for Nvidia and AMD GPUs. However, if you wish to contribute support for other backends, please start your project in a fork. If your backend proves to be useful and meets our performance requirements, we will discuss the possibility of upstreaming it.
|
||||
|
||||
|
||||
## Project Structure
|
||||
```
|
||||
triton
|
||||
├── lib : C++ code for python library
|
||||
│ ├──Analysis
|
||||
│ │ Memory barrier analysis
|
||||
│ │ class to extract axis information from MLIR ops
|
||||
│ │ implementation of the shared memory allocation analysis for Triton dialect
|
||||
│ │
|
||||
│ ├──Conversion
|
||||
│ │ ├──TritonGPUToLLVM: Transforms TritonGPU to LLVM;
|
||||
│ │ │
|
||||
│ │ ├──TritonToTritonGPU: Transforms ops to TritonGPU ops; loading, storing, arithmetic, casting, and tensor operations.
|
||||
│ │ │
|
||||
│ │ │
|
||||
│ │ │
|
||||
│ ├──Dialect
|
||||
│ │ ├──Triton
|
||||
│ │ │ Defines core IR for Triton compiler
|
||||
│ │ ├──TritonGPU
|
||||
│ │ Defines TritonGPU operation for IR
|
||||
│ │
|
||||
│ ├──Target: contains Triton targets for converting to PTX, LLVMIR and HSACO IR targets
|
||||
│ │
|
||||
├── bin
|
||||
├── cmake
|
||||
├── docs ├── Documentation regarding using triton
|
||||
├── include
|
||||
│ CMakelists.txt
|
||||
│ ├──triton
|
||||
│ │ ├──
|
||||
├── python
|
||||
│ ├──
|
||||
│ ├── MANIFEST.in
|
||||
│ ├── README.md
|
||||
│ ├── build
|
||||
│ ├── examples
|
||||
│ ├── pyproject.toml
|
||||
│ ├── setup.py: pip install for python package
|
||||
│ ├── src
|
||||
│ ├── test
|
||||
│ ├── triton
|
||||
│ │ ├── _C: Includes header files and compiled .so file for C library
|
||||
│ │ │
|
||||
│ │ ├──common: Has interface for CUDA hardware backend
|
||||
│ │ │
|
||||
│ │ ├──compiler: contains code for compiling source code to IR and lauching GPU kernels
|
||||
│ │ │
|
||||
│ │ ├──interpreter: memory-map for tensors, converting primitives to tensors, and arethmetic ops for tensors
|
||||
│ │ │
|
||||
│ │ ├──language: core of triton language, load tensors to SRAM, language logic, etc.
|
||||
│ │ │
|
||||
│ │ ├──ops: contains functions for flash-attn, softmax, cross-entropy and other torch.nn.F functions
|
||||
│ │ ├──runtime: contains impl jit compilation, autotuning, backend drivers,cahcing, error handles, etc.
|
||||
│ │ ├──third_party
|
||||
│ │ ├──tools
|
||||
│ ├── triton.egg-info
|
||||
│ ├── tutorials: contains tutorials for various use-cases
|
||||
├── test
|
||||
│ ├──Analysis
|
||||
│ ├──Conversion
|
||||
│ ├──Dialect
|
||||
│ ├──Target
|
||||
├── third_party
|
||||
├── unittest
|
||||
└── utils
|
||||
```
|
||||
|
||||
@@ -42,6 +42,8 @@ pip install cmake; # build-time dependency
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
|
||||
|
||||
# Changelog
|
||||
|
||||
Version 2.0 is out! New features include:
|
||||
@@ -56,6 +58,9 @@ Community contributions are more than welcome, whether it be to fix bugs or to a
|
||||
|
||||
If you’re interested in joining our team and working on Triton & GPU kernels, [we’re hiring](https://openai.com/jobs/#acceleration)!
|
||||
|
||||
|
||||
|
||||
|
||||
# Compatibility
|
||||
|
||||
Supported Platforms:
|
||||
|
||||
@@ -66,10 +66,14 @@ def get_pybind11_package_info():
|
||||
|
||||
|
||||
def get_llvm_package_info():
|
||||
# download if nothing is installed
|
||||
# added statement for Apple Silicon
|
||||
system = platform.system()
|
||||
arch = 'x86_64'
|
||||
if system == "Darwin":
|
||||
system_suffix = "apple-darwin"
|
||||
cpu_type = os.popen('sysctl machdep.cpu.brand_string').read()
|
||||
if "apple" in cpu_type.lower():
|
||||
arch = 'arm64'
|
||||
elif system == "Linux":
|
||||
vglibc = tuple(map(int, platform.libc_ver()[1].split('.')))
|
||||
vglibc = vglibc[0] * 100 + vglibc[1]
|
||||
@@ -79,7 +83,7 @@ def get_llvm_package_info():
|
||||
return Package("llvm", "LLVM-C.lib", "", "LLVM_INCLUDE_DIRS", "LLVM_LIBRARY_DIR", "LLVM_SYSPATH")
|
||||
use_assert_enabled_llvm = check_env_flag("TRITON_USE_ASSERT_ENABLED_LLVM", "False")
|
||||
release_suffix = "assert" if use_assert_enabled_llvm else "release"
|
||||
name = f'llvm+mlir-17.0.0-x86_64-{system_suffix}-{release_suffix}'
|
||||
name = f'llvm+mlir-17.0.0-{arch}-{system_suffix}-{release_suffix}'
|
||||
version = "llvm-17.0.0-c5dede880d17"
|
||||
url = f"https://github.com/ptillet/triton-llvm-releases/releases/download/{version}/{name}.tar.xz"
|
||||
return Package("llvm", name, url, "LLVM_INCLUDE_DIRS", "LLVM_LIBRARY_DIR", "LLVM_SYSPATH")
|
||||
@@ -118,6 +122,7 @@ def get_thirdparty_packages(triton_cache_path):
|
||||
|
||||
|
||||
def download_and_copy_ptxas():
|
||||
|
||||
base_dir = os.path.dirname(__file__)
|
||||
src_path = "bin/ptxas"
|
||||
version = "12.1.105"
|
||||
|
||||
Reference in New Issue
Block a user