byteir

bytedanceApache-2.0长期未更新

字节跳动开源的模型编译方案,基于 MLIR/LLVM 把 PyTorch、ONNX、TensorFlow 等模型编译到多种硬件上运行,解决跨平台部署和推理性能问题。

A model compilation solution for various hardware

v1.9.3.0发布于 2024-10-18 07:42 UTC473star58fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
README 未给出安装或构建命令
硬件要求按 README 说明

README 未说明具体显存、CPU 或 GPU 厂商型号要求,仅说明面向 CPU/GPU/ASIC 及通用 CPU 与 GPU。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

字节跳动的端到端模型编译方案,含编译器、运行时和多框架前端

字节跳动开源的模型编译方案,基于 MLIR/LLVM 把 PyTorch、ONNX、TensorFlow 等模型编译到多种硬件上运行,解决跨平台部署和推理性能问题。

核心能力

  • 前端将 TensorFlow/PyTorch/ONNX 模型降为 Stablehlo
  • 编译器基于 MLIR,覆盖 CPU/GPU/ASIC 后端
  • 提供图级、循环级、张量级 Mhlo/Linalg 优化
  • 编译器与运行时通过 ByRE 格式通信
  • 各组件可独立使用,也可混用上游 MLIR pass

容易踩的坑

项目处于早期阶段,针对特定架构的高度调优内核可能尚未优先实现;前端与编译器通过 Stablehlo 通信,版本可能在开发中变动,需注意版本兼容;编译器与运行时通过 ByRE 通信,其版本同样可能变动。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.9.3.0
  1. v1.9.3.0ByteIR v1.9.3.0最新正式版2024-10-18 · 2024-10-18 07:42 UTC

    What's Changed

    • [torch-frontend] support lowering to byteir.resize, byteir.l2_norm
    • [byteir] support byre serialization on cuda byre mlir
    • [byteir] support decomposition of byteir.softmax, byteir.arg_max, byteir.addn
    • [byteir] support merge two modules by mapping
    • [brt] add BRTBackend
    • [*] reduce wheel package size

    New Contributors

    Full Changelog: https://github.com/bytedance/byteir/compare/v1.9.1.0...v1.9.3.0

  2. v1.9.1.0ByteIR v1.9.1.02024-08-20 · 2024-08-20 03:17 UTC
    查看更新说明

    What's Changed

    • Enhance gemm codegen by @Xinyu302
    • Enhance byteir_backend of torch.compile
    • Support optimize contiguous slice as alias like op
    • Refactor cat pipeline and executor
    • Support 1xTF32 on GPU backend

    New Contributors

    Full Changelog: https://github.com/bytedance/byteir/compare/v1.8.4.0...v1.9.1.0

  3. v1.8.4.0ByteIR 1.8.4.02024-05-31 · 2024-05-31 07:06 UTC
    查看更新说明

    What's Changed

    • More codegen fusion on mhlo, like slice-concat fusion and insert_slice fusion.
    • More graph optimization.
    • Enhance reduction codegen.
    • Refactor byteir.compile.
    • Add dynamo backend in torch_frontend.byteir_backend.
    • E2E on NCCL backend.

    Full Changelog: https://github.com/bytedance/byteir/compare/v1.8.1.0...v1.8.4.0

  4. v1.8.1.0ByteIR 1.8.1.02024-04-07 · 2024-04-07 05:10 UTC
    查看更新说明
    • Design ccl dialect to be lowered from torch communication ops.
    • Release Torch Frontend v1.1.1, which split torchscript and dynamo/fx support.
    • Support emitting stablehlo bytecode from frontends
    • Compiler support accepting stablehlo bytecode.
  5. v1.7.1.0ByteIR 1.7.1.02023-12-15 · 2023-12-15 07:03 UTC
    查看更新说明
    • Update Torch-Frontend to 1.0.3
    • Update ByteIR Compiler & Runtime to 1.7.1.0
    • Support Serialization on Byre Dialect
    • Init for NCCL Backend

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    The ByteIR Project

    English | 中文

    The ByteIR Project is a ByteDance model compilation solution. ByteIR includes compiler, runtime, and frontends, and provides an end-to-end model compilation solution.

    Although all ByteIR components (compiler/runtime/frontends) are together to provide an end-to-end solution, and all under the same umbrella of this repository, each component technically can perform independently.

    The name ByteIR

    The name, ByteIR, comes from a legacy purpose internally.
    The ByteIR project is NOT an IR spec definition project. Instead, in most scenarios, ByteIR directly uses several upstream MLIR dialects and Google Mhlo. Most of ByteIR compiler passes are compatible with the selected upstream MLIR dialects and Google Mhlo.

    Why ByteIR

    • Enjoy SOTA models: ByteIR maintains the popular frontends to handle lowering many SOTA models into Stablehlo, and also provides a model zoo (release soon) for research or benchmarking purposes.
    • Just work: ByteIR adopts upstream MLIR dialects and Google Mhlo, and provides compatible passes, utilities, and infrastructure for all compiler builders using upstream MLIR. You can mix using ByteIR passes with upstream MLIR or Mhlo passes, or even your own passes to build your pipeline.
    • Bring your own architecture: ByteIR provides rich generic graph-, loop-, tensor-level, optimizations in Mhlo and Linalg, which allow DL ASIC compilers to reuse, and focus only on the last mile for their backends.

    Project Status

    ByteIR is still in its early phase. In this phase, we are aiming to provide well-defined, necessary building blocks and infrastructure support for model compilation in a wide-range of deep learning accelerators as well as general-purpose CPUs and GPUs. Therefore, highly-tuned kernels for specific architecture might not have been prioritized. For sure, any feedback for prioritizing specific architecture or corresponding contribution are welcome.

    Compiler

    ByteIR Compiler is an MLIR-based compiler for CPU/GPU/ASIC.

    Runtime

    ByteIR Runtime is a common, lightweight runtime, capable to serving both existing kernels and ByteIR compiler generated kernels.

    Frontends

    ByteIR Frontends includes Tensorflow, PyTorch, and ONNX.

    Components Communication Interface

    Each ByteIR component technically can perform independently. There are pre-defined communication interface between components.

    Stablehlo between frontends and compiler

    ByteIR frontends and ByteIR compiler communicate through Stablehlo dialect, which version might be updated during development.

    This also implies whatever frontend generating Stablehlo with a compatible version can work with ByteIR compiler, and also whatever compiler consuming Stablehlo with a compatible version can work with ByteIR frontends.

    ByRE between compiler and runtime

    ByteIR compiler and ByteIR runtime communicates through ByRE format, which version might be updated during development. ByRE dialect is defined as a kind of ByRE format in ByteIR compiler, currently supporting emitting a textual form or bytecode with versioning for ByteIR compiler and runtime.

    Other ByRE formats are under development.

    Publication and Citation

    ByteIR is the product of many great researchers and interns in ByteDance. Below is a list of our public talks:

    If you find ByteIR useful, please consider citing.

    @misc{byteir2023,
    title = {{ByteIR}},
    author = {Cao, Honghua and Chang, Li-Wen and Chen, Chongsong and Jiang, Chengquan and Jiang, Ziheng and Liu, Liyang and Liu, Yuan and Liu, Yuanqiang and Shen, Chao and Wang, Haoran and Xiao, Jianzhe and Yao, Chengji and Yuan, Hangjian and Zhang, Fucheng and Zhang, Ru and Zhang, Xuanrun and Zhang, Zhekun and Zhang, Zhiwei and Zhu, Hongyu and Liu, Xin},
    url = {https://github.com//bytedance/byteir},
    year = {2023}
    }
    

    License

    The ByteIR Project is under the Apache License v2.0