FlagOS is a unified heterogeneous computing software stack for large models, co-developed with leading global chip manufacturers. With core technologies such as the FlagScale distributed training/inference framework, FlagGems universal operator library, FlagCX communication library, and FlagTree unified compiler, the FlagRelease platform leverages the FlagOS stack to automatically produce and release various combinations of <chip + open-source model>. This enables efficient and automated model migration across diverse chips, opening a new chapter for large model deployment and application.
Based on this, the pi0-FlagOS model is adapted for the Nvidia chip using the FlagOS software stack, enabling:
Out-of-the-box inference scripts with pre-configured hardware and software parameters
Released FlagOS container image supporting deployment within minutes
Consistency Validation
Rigorously evaluated through benchmark testing: Performance and results from the FlagOS software stack are compared against native stacks on multiple public.
Technical Overview
FlagScale Distributed Training and Inference Framework
FlagScale is an end-to-end framework for large models across heterogeneous computing resources, maximizing computational efficiency and ensuring model validity through core technologies. Its key advantages include:
Unified Deployment Interface: Standardized command-line tools support one-click service deployment across multiple hardware platforms, significantly reducing adaptation costs in heterogeneous environments.
Intelligent Parallel Optimization: Automatically generates optimal distributed parallel strategies based on chip computing characteristics, achieving dynamic load balancing of computation/communication resources.
Seamless Operator Switching: Deep integration with the FlagGems operator library allows high-performance operators to be invoked via environment variables without modifying model code.
FlagGems Universal Large-Model Operator Library
FlagGems is a Triton-based, cross-architecture operator library collaboratively developed with industry partners. Its core strengths include:
Full-stack Coverage: Over 100 operators, with a broader range of operator types than competing libraries.
High Efficiency: Employs unique code generation and runtime optimization techniques for faster secondary development and better runtime performance compared to alternatives.
FlagEval Evaluation Framework
FlagEval (Libra)** is a comprehensive evaluation system and open platform for large models launched in 2023. It aims to establish scientific, fair, and open benchmarks, methodologies, and tools to help researchers assess model and training algorithm performance. It features:
Multi-dimensional Evaluation: Supports 800+ model evaluations across NLP, CV, Audio, and Multimodal fields, covering 20+ downstream tasks including language understanding and image-text generation.
Industry-Grade Use Cases: Has completed horizontal evaluations of mainstream large models, providing authoritative benchmarks for chip-model performance validation.
Evaluation Results
Unlike other models, we use the MAPE (Mean Absolute Percentage Error) of the action tensor to evaluate whether the FlagOS version of the model computes correctly. To achieve this, we built upon the standard usage of the Pi0 model while controlling the random seeds of the random, numpy, and torch libraries, and configured PyTorch to use deterministic GPU kernels. Additionally, before each inference step, we replaced the randomly generated noise tensor with a fixed tensor. In the subsequent usage section, we will provide detailed instructions on how to restore these randomized settings for normal Pi0 model operation.
The MAPE between CUDA and FlagOS(CUDA as ground truth) is 1.4152%. You can easily reproduce this result using our image.
We have already download pi0 and its tokenizer's weights into /workspace in docker image. You don't need to download it again. If you really want to download it, you can run:
Use Vim or other editor, comment all lines include "flag_gems"
, then you get pi0-CUDA enviroment. Repeat "Serve" and "Call the server", then you get action tensor from CUDA and FlagOS.