yajunvicky commited on
Commit
8b9a6d4
·
verified ·
1 Parent(s): 977149d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +191 -65
README.md CHANGED
@@ -1,113 +1,239 @@
1
  # Introduction
2
 
3
- RoboBrain2.0-7B-FlagOS-Ascend provides an all-in-one deployment solution, enabling execution of RoboBrain2.0-7B on Ascend GPUs. As the first-generation release for the <HARDWARE_PLATFORM_SERIES>, this package delivers three key features:
4
 
5
- 1. Comprehensive Integration:
6
- - Integrated with FlagScale (https://github.com/FlagOpen/FlagScale).
7
- - Open-source inference execution code, preconfigured with all necessary software and hardware settings.
8
- - Pre-built Docker image for rapid deployment on <HARDWARE_PLATFORM_SERIES>.
9
- 3. Consistency Validation:
10
- - Evaluation tests verifying consistency of results between the official and ours.
11
 
12
- # Technical Summary
13
 
14
- ## Serving Engine
 
 
15
 
16
- We use FlagScale as the serving engine to improve the portability of distributed inference.
17
 
18
- FlagScale is an end-to-end framework for large models across multiple chips, maximizing computational resource efficiency while ensuring model effectiveness. It ensures both ease of use and high performance for users when deploying models across different chip architectures:
19
 
20
- - One-Click Service Deployment: FlagScale provides a unified and simple command execution mechanism, allowing users to fast deploy services seamlessly across various hardware platforms using the same command. This significantly reduces the entry barrier and enhances user experience.
21
- - Automated Deployment Optimization: FlagScale automatically optimizes distributed parallel strategies based on the computational capabilities of different AI chips, ensuring optimal resource allocation and efficient utilization, thereby improving overall deployment performance.
22
- - Automatic Operator Library Switching: Leveraging FlagScale's unified Runner mechanism and deep integration with FlagGems, users can seamlessly switch to the FlagGems operator library for inference by simply adding environment variables in the configuration file.
23
 
24
- ## Triton Support
25
 
26
- We validate the execution of RoboBrain2.0-7B model with a Triton-based operator library as a PyTorch alternative.
27
 
28
- We use a variety of Triton-implemented operation kernels to run the RoboBrain2.0-7B model. These kernels come from two main sources:
 
 
29
 
30
- - Most Triton kernels are provided by FlagGems (https://github.com/FlagOpen/FlagGems). You can enable FlagGems kernels by setting the environment variable USE_FLAGGEMS.
31
 
32
- - Also included are Triton kernels from vLLM, such as fused MoE.
33
 
34
- # Container Image Download
 
 
 
 
 
 
 
 
 
35
 
36
- | | Usage | Ascend |
37
- | ----------- | ------------------------------------------------------------ | ------------------- |
38
- | Basic Image | basic software environment that supports FlagOS model running | |
39
  # Evaluation Results
40
 
41
- ## Benchmark Result
42
 
43
- | Metrics | RoboBrain2.0-7B-H100-CUDA | RoboBrain2.0-7B-FlagOS-Ascend |
44
- |:-------------------|--------------------------|-----------------------------|
45
- | livebench_new | - | 0.504 |
46
- | aime | - | 0.167 |
47
- | GPQA(0-shot) | - | 0.395 |
48
- | MMLU | - | 0.697 |
49
- | MUSR | - | 0.570 |
50
- | TheoremQA | - | 0.151 |
 
 
 
 
51
 
 
52
 
53
- # How to Run Locally
54
- ## 📌 Getting Started
55
- ### Download open-source weights
56
 
57
- ```bash
58
 
59
- pip install modelscope
60
- modelscope download --model <Model Name> --local_dir <Cache Path>
 
 
61
 
62
- ```
63
 
64
- ### Download the FlagOS image
 
 
 
 
 
 
65
 
66
- ```bash
67
- docker pull
 
 
 
 
 
68
  ```
69
 
70
- ### Start the inference service
71
-
72
- ```bash
73
- docker run --rm --init --detach \
74
- --net=host --uts=host --ipc=host \
75
- --security-opt=seccomp=unconfined \
76
- --privileged=true \
77
- --ulimit stack=67108864 \
78
- --ulimit memlock=-1 \
79
- --ulimit nofile=1048576:1048576 \
80
- --shm-size=32G \
81
- -v /share:/share \
82
- --gpus all \
83
- --name flagos \
84
- \
85
- sleep infinity
86
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  docker exec -it flagos bash
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  ```
89
 
90
  ### Serve
91
 
92
- ```bash
93
- flagscale serve <Model>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  ```
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  # Contributing
97
 
98
  We warmly welcome global developers to join us:
 
99
  1. Submit Issues to report problems
100
  2. Create Pull Requests to contribute code
101
  3. Improve technical documentation
102
  4. Expand hardware adaptation support
103
 
104
- # 📞 Contact Us
105
 
106
- Scan the QR code below to add our WeChat group
107
- send "FlagRelease"
108
-
109
- ![WeChat](image/group.png)
110
 
111
  # License
112
 
113
  This project and related model weights are licensed under the MIT License.
 
 
 
1
  # Introduction
2
 
3
+ **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.
4
 
5
+ Based on this, the **RoboBrain2.0-7B-FlagOS-Ascend** model is adapted for the Ascend chip using the FlagOS software stack, enabling:
 
 
 
 
 
6
 
7
+ ### Integrated Deployment
8
 
9
+ - Deep integration with the open-source [FlagScale framework](https://github.com/FlagOpen/FlagScale)
10
+ - Out-of-the-box inference scripts with pre-configured hardware and software parameters
11
+ - Released **FlagOS** container image supporting deployment within minutes
12
 
13
+ ### Consistency Validation
14
 
15
+ - Rigorously evaluated through benchmark testing: Performance and results from the FlagOS software stack are compared against native stacks on multiple public.
16
 
17
+ # Technical Overview
 
 
18
 
19
+ ## **FlagScale Distributed Training and Inference Framework**
20
 
21
+ 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:
22
 
23
+ - **Unified Deployment Interface:** Standardized command-line tools support one-click service deployment across multiple hardware platforms, significantly reducing adaptation costs in heterogeneous environments.
24
+ - **Intelligent Parallel Optimization:** Automatically generates optimal distributed parallel strategies based on chip computing characteristics, achieving dynamic load balancing of computation/communication resources.
25
+ - **Seamless Operator Switching:** Deep integration with the FlagGems operator library allows high-performance operators to be invoked via environment variables without modifying model code.
26
 
27
+ ## **FlagGems Universal Large-Model Operator Library**
28
 
29
+ FlagGems is a Triton-based, cross-architecture operator library collaboratively developed with industry partners. Its core strengths include:
30
 
31
+ - **Full-stack Coverage**: Over 100 operators, with a broader range of operator types than competing libraries.
32
+ - **Ecosystem Compatibility**: Supports 7 accelerator backends. Ongoing optimizations have significantly improved performance.
33
+ - **High Efficiency**: Employs unique code generation and runtime optimization techniques for faster secondary development and better runtime performance compared to alternatives.
34
+
35
+ ## **FlagEval Evaluation Framework**
36
+
37
+ 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:
38
+
39
+ - **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.
40
+ - **Industry-Grade Use Cases**: Has completed horizontal evaluations of mainstream large models, providing authoritative benchmarks for chip-model performance validation.
41
 
 
 
 
42
  # Evaluation Results
43
 
44
+ ## Benchmark Result
45
 
46
+ | Metrics | RoboBrain2.0-7B-H100-CUDA | RoboBrain2.0-7B-FlagOS-Ascend |
47
+ | --------------------- | ------------------------- | ----------------------------- |
48
+ | SAT | 75.330 | 75.330 |
49
+ | all_angles_bench | 47.700 | 47.650 |
50
+ | Where2Place | 63.590 | 62.190 |
51
+ | blink_val_ev | 56.360 | 56.360 |
52
+ | robo_spatial_home_all | 54.227 | 54.368 |
53
+ | egoplan_bench2 | 33.230 | 33.310 |
54
+ | erqa | 38.750 | 39.250 |
55
+ | cv_bench_test | 85.750 | 85.960 |
56
+ | embspatial_bench | 76.320 | 76.320 |
57
+ | vsi_bench_tiny | 36.100 | 35.230 |
58
 
59
+ # User Guide
60
 
61
+ ## General Information
 
 
62
 
63
+ **Basic Information**
64
 
65
+ | Type | Location |
66
+ | --------------- | ------------------------------------------------------------ |
67
+ | Model Weights | https://www.modelscope.cn/models/BAAI/RoboBrain2.0-7B/files |
68
+ | Container Image | flagrelease-registry.cn-beijing.cr.aliyuncs.com/flagrelease/flagrelease:flagrelease_ascend_robobrain2_7b |
69
 
70
+ **Environment Setup**
71
 
72
+ | System Component | Version Information |
73
+ | ------------------------------- | --------------------------------------- |
74
+ | Accelerator Card Driver Version | Version: 25.0.rc1 |
75
+ | Docker Version | Docker version 20.10.8, build 3967b7d |
76
+ | Operating System | PRETTY_NAME="openEuler 22.03 (LTS-SP4)" |
77
+ | FlagScale | Version: 0.8.0 |
78
+ | FlagGems | Version: 2.2 |
79
 
80
+ ## Operation Steps
81
+
82
+ ### Download Open-source Model Weights
83
+
84
+ ```python
85
+ pip install modelscope
86
+ modelscope download --model BAAI/RoboBrain2.0-7B --local_dir /data/weights/RoboBrain2.0-7B/
87
  ```
88
 
89
+ ### Download FlagOS Image
90
+
91
+ ```python
92
+ docker pull flagrelease-registry.cn-beijing.cr.aliyuncs.com/flagrelease/flagrelease:flagrelease_ascend_robobrain2_7b
93
+ ```
 
 
 
 
 
 
 
 
 
 
 
94
 
95
+ ### Start the inference service
96
+
97
+ ```python
98
+ #Container Startup
99
+ docker run -itd --name flagos \
100
+ -u root \
101
+ -w /workspace \
102
+ --privileged=true \
103
+ --shm-size=1000g \
104
+ --net=host \
105
+ -v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
106
+ -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
107
+ -v /usr/local/dcmi:/usr/local/dcmi \
108
+ -v /usr/local/sbin:/usr/local/sbin \
109
+ -v /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime \
110
+ -v /etc/ascend_install.info:/etc/ascend_install.info \
111
+ -v /data:/data \
112
+ -v /root/.cache:/root/.cache \
113
+ -e VLLM_USE_V1=1 \
114
+ -e CPU_AFFINITY_CONF=2 \
115
+ -e PYTORCH_NPU_ALLOC_CONF=max_split_size_mb:256 \
116
+ -e USE_FLAGGEMS=true \
117
+ flagrelease-registry.cn-beijing.cr.aliyuncs.com/flagrelease/flagrelease:flagrelease_ascend_robobrain2_7b bash
118
+
119
+ #Enter the container
120
  docker exec -it flagos bash
121
+
122
+ #Special configuration is required
123
+ source /usr/local/Ascend/ascend-toolkit/set_env.sh
124
+ source /usr/local/Ascend/nnal/atb/set_env.sh
125
+
126
+ #Use 'pip show flag_scale' to find the installation path of FlagScale.
127
+ pip show flag_scale
128
+
129
+ # Modify the 7b.yaml file located at flag_scale/examples/qwen3/conf/serve
130
+ - serve_id: vllm_model
131
+ engine: vllm
132
+ engine_args:
133
+ model: /data/weights/RoboBrain2.0-7B/ # path of weight of deepseek r1
134
+ served_model_name: RoboBrain2.0-7B-ascend-flagos
135
+ tensor_parallel_size: 4
136
+ gpu_memory_utilization: 0.8
137
+ host: x.x.x.xxx #Modify the host field in the 4b.yaml configuration file to use the machine's actual IP address.
138
+ port: 9010
139
+ block_size: 128
140
+ enforce_eager: true
141
+ no_enable_prefix_caching: true
142
+ no_enable_chunked_prefill: true
143
+
144
  ```
145
 
146
  ### Serve
147
 
148
+ ```python
149
+ flagscale serve robobrain2
150
+
151
+ #After the service starts, you will see output similar to the following:
152
+ #INFO: Started server process [392]
153
+ #INFO: Waiting for application startup.
154
+ #INFO: Application startup complete.
155
+ ```
156
+
157
+ # Service Invocation
158
+
159
+ ## API-based Invocation Script
160
+
161
+ ```
162
+ import openai
163
+ openai.api_key = "EMPTY"
164
+ openai.base_url = "http://<server_ip>:9010/v1/"
165
+ model = "RoboBrain2.0-7B-ascend-flagos"
166
+ messages = [
167
+ {"role": "system", "content": "You are a helpful assistant."},
168
+ {"role": "user", "content": "What's the weather like today?"}
169
+ ]
170
+ response = openai.chat.completions.create(
171
+ model=model,
172
+ messages=messages,
173
+ temperature=0.7,
174
+ top_p=0.95,
175
+ stream=False,
176
+ )
177
+ for item in response:
178
+ print(item)
179
  ```
180
 
181
+ ## AnythingLLM Integration Guide
182
+
183
+ #### 1. Download & Install
184
+
185
+ - Visit the official site: https://anythingllm.com/
186
+ - Choose the appropriate version for your OS (Windows/macOS/Linux)
187
+ - Follow the installation wizard to complete the setup
188
+
189
+ #### 2. Configuration
190
+
191
+ - Launch AnythingLLM
192
+ - Open settings (bottom left, fourth tab)
193
+ - Configure core LLM parameters
194
+ - Click "Save Settings" to apply changes
195
+
196
+ #### 3. Model Interaction
197
+
198
+ - After model loading is complete:
199
+ - Click **"New Conversation"**
200
+ - Enter your question (e.g., “Explain the basics of quantum computing”)
201
+ - Click the send button to get a response
202
+
203
+ # Frequently Asked Questions
204
+
205
+ ### Q1: What should I do if the model fails to load?
206
+
207
+ - Check if the model weight path is correct.
208
+ - Ensure the RoboBrain2.0-7B model files are present in the `/share` directory inside the container.
209
+ - Check the container logs: `docker logs flagos`.
210
+
211
+ ### Q2: API call returns a timeout error. What should I do?
212
+
213
+ - Verify that the server IP address is correct.
214
+ - Check the firewall settings to ensure port 9010 is open.
215
+ - Confirm that the service is running properly: `docker exec flagos ps aux | grep flagscale`.
216
+
217
+ ### Q3: IP **errors**
218
+
219
+ - Modify the 4b.yaml file located at flag_scale/examples/robobrain2/conf/serve
220
+ ![ip](ip.jpg)
221
+
222
  # Contributing
223
 
224
  We warmly welcome global developers to join us:
225
+
226
  1. Submit Issues to report problems
227
  2. Create Pull Requests to contribute code
228
  3. Improve technical documentation
229
  4. Expand hardware adaptation support
230
 
231
+ # Contact Us
232
 
233
+ ![image](image_.jpeg)
 
 
 
234
 
235
  # License
236
 
237
  This project and related model weights are licensed under the MIT License.
238
+
239
+ Release Date: 2025.07.03