Recently, SOPHGO opens its AI compiler project TPU-MLIR and synchronizes it to the GitLink platform, becoming the first open-source project based on MLIR in the community.
SOPHGO’s AI compiler, which supports ONNX and is highly reusable, has been open sourced#
TPU-MLIR is a TPU compiler open-source project focusing on AI chips. It provides a complete toolchain, which can transform the pre-trained deep learning model under different frameworks into a binary file bmodel that can run on TPU to achieve efficient reasoning.
Before the AI processor came out, the AI framework was mainly established on CPU and GPU. The docking problem between the framework and the processor can be solved by developing the kernel and calling cudnn. As the AI processor architecture becomes increasingly diverse, the demand for compilers begins to increase. MLIR provides a general and reusable compiler framework for AI chips, which can solve software fragmentation and reduce the compilation cost of heterogeneous hardware.
As a bridge connecting software and hardware, compilers play a key role in the field of AI chips by connecting algorithms on the top and instruction sets on the bottom. After the optimization of the compiler, the performance of computing hardware can be fully exploited. However, the design and development of compilers require a high level of computer architecture and algorithm knowledge. It is a very complex project and requires the strength of the open-source community.
Before the emergence of MLIR, Microsoft and Facebook both proposed an IR (intermediate representation) called ONNX. It has a set of standardized operator formats, which can transform the computing charts written by PyTorch, TensorFlow and other frameworks into a unified ONNX format for storage. If all computing hardware can support ONNX, will compilation still be a problem?
However, there are too many ONNX IR or frequent changes without any unified expression, which is a headache for developers. MLIR aims to solve these problems by creating a reusable and extensible toolchain instead of maintaining a large number of IR. TPU-MLIR goes further on the basis of MLIR and adapts different types of TPU devices. At the same time, it is compatible with the ONNX format model and can realize multiple reuses of code at one time.
Enter the open-source community GitLink. TPU-MLIR developer ecosystem appears#
TPU-MLIR has been synchronized on GitHub, Gitee, Gitlink and other Git hosting platforms, which is easy for developers around the world to access. It also provides practical opportunities for developers interested in AI compilation optimization.
GitHub has made great contributions to the global open-source cause. TensorFlow, PyTorch and other AI frameworks have accumulated a large number of developers in GitHub and have been growing. However, after Github was acquired by Microsoft, projects in some countries have been suddenly blocked or even removed. Github’s independence has once been questioned by the open-source communities.
With the gradual maturity of domestic open-source communities such as GitLink, many projects have also started to be hosted on GitLink. GitLink is an open-source innovation service platform officially designated by China Computer Federation. With the vision of “Becoming A Gathering Place of Open-Source Innovation”, GitLink is committed to creating an open-source ecosystem for incubation of innovation achievements and training of new engineering talents.
In 2008, National University of Defense Technology, Peking University, Beihang University, Institute of Software Chinese Academy of Sciences and other institutions cooperated to carry out research on the network-based software development group method and technology and released the trusted national software resource sharing and collaborative production environment (abbreviated as “Trustie v1.0”). It focuses on large-scale software collaborative development, reliability evaluation, operation monitoring and continuous evolution.
In 2014, Trustie v2.0, an open-source community for software innovation and education, was released, focusing on exploring the connection of software stakeholders such as those participants in collaborative development community, knowledge sharing community and application service community. In 2020, under the leadership and guidance of China Computer Federation (CCF), Trustie upgraded to form a new generation of open-source innovation service platform GitLink, which promotes the opening and sharing of open-source innovation achievements.
As the first MLIR project to land on GitLink, TPU-MLIR fills the gap in the community AI compiler and will inject new vitality into AI developers.