<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>性能测试与优化 on FlagGems</title><link>https://flagos-ai.github.io/FlagGems/zh-cn/performance/</link><description>Recent content in 性能测试与优化 on FlagGems</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://flagos-ai.github.io/FlagGems/zh-cn/performance/index.xml" rel="self" type="application/rss+xml"/><item><title>概览</title><link>https://flagos-ai.github.io/FlagGems/zh-cn/performance/overview/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://flagos-ai.github.io/FlagGems/zh-cn/performance/overview/</guid><description>&lt;!--
 Copyright 2026 FlagOS Contributors

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 --&gt;
&lt;!--
# Performance Benchmarking Overview
--&gt;
&lt;h1 id="性能测试概览"&gt;性能测试概览&lt;a class="anchor" href="#%e6%80%a7%e8%83%bd%e6%b5%8b%e8%af%95%e6%a6%82%e8%a7%88"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;!--
*FlagGems* operators in general provides better or at least comparable performance
when compared to operators from the native PyTorch library.
We use the `triton.testing.do_bench` from the Triton project for benchmarking.
The kernel data obtained are shown in the following graph.
--&gt;
&lt;p&gt;与原生的 PyTorch 库中的算子相比，&lt;em&gt;FlagGems&lt;/em&gt; 算子一般而言能够提供更好的、
至少是可比较的性能。
我们使用来自 Triton 项目的 &lt;code&gt;triton.testing.do_bench&lt;/code&gt; 框架来执行性能基准测试。
下图展示的即是所获得的内核性能数据。&lt;/p&gt;</description></item><item><title>性能基准测试</title><link>https://flagos-ai.github.io/FlagGems/zh-cn/performance/benchmark/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://flagos-ai.github.io/FlagGems/zh-cn/performance/benchmark/</guid><description>&lt;!--
 Copyright 2026 FlagOS Contributors

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 --&gt;
&lt;!--
# Performance Benchmarking in FlagGems

It is recommended to follow the steps below to add test cases for a new operator.
These steps apply to Python-based operators as well as C++-wrapped operators.
--&gt;
&lt;h1 id="flaggems-中的性能基准测试"&gt;FlagGems 中的性能基准测试&lt;a class="anchor" href="#flaggems-%e4%b8%ad%e7%9a%84%e6%80%a7%e8%83%bd%e5%9f%ba%e5%87%86%e6%b5%8b%e8%af%95"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;我们建议开发者基于下面的过程来为新的算子添加测试用例。
这些步骤既适用于 Python 实现的算子，也适用于 C++ 封装的算子。&lt;/p&gt;</description></item><item><title>性能数据库后端</title><link>https://flagos-ai.github.io/FlagGems/zh-cn/performance/database/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://flagos-ai.github.io/FlagGems/zh-cn/performance/database/</guid><description>&lt;!--
 Copyright 2026 FlagOS Contributors

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 --&gt;
&lt;!--
# Performance Database Backends

*FlagGems* implements a `LibCache` class for persisting performance benchmark data
into a database. The `LibCache` interacts with the database backend through
`sqlalchemy`, a generic database abstraction library.

The connection to the backend database can be specified using the environment variable
`FLAGGEMS_DB_URL`.
--&gt;
&lt;h1 id="性能数据库后端"&gt;性能数据库后端&lt;a class="anchor" href="#%e6%80%a7%e8%83%bd%e6%95%b0%e6%8d%ae%e5%ba%93%e5%90%8e%e7%ab%af"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;em&gt;FlagGems&lt;/em&gt; 实现了一个 &lt;code&gt;LibCache&lt;/code&gt; 类，用来将性能基准测试数据写入数据库中长期保存。
&lt;code&gt;LibCache&lt;/code&gt; 通过 &lt;code&gt;sqlalchemy&lt;/code&gt; （一个通用的数据库抽象库）来与具体的数据库后端交互。&lt;/p&gt;</description></item></channel></rss>