Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add autotune.set_config api doc #4687

Merged
merged 5 commits into from
Apr 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/api/paddle/incubate/autotune/set_config_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _cn_api_incubate_autotune_set_config:

set_config
---------------------

.. py:function:: paddle.incubate.autotune.set_config(config=None)

配置kernel、layout和dataloader的自动调优功能。

1. kernel:当开启自动调优,将使用穷举搜索的方法在调优的迭代区间内为算子选择最佳算法,并将其缓存下来。调优参数如下:

- **enable** (bool) - 是否开启kernel的调优功能。
- **tuning_range** (list) - 自动调优开始和结束的迭代序号。默认值:[1, 10]。

2. layout:当开启自动调优,将根据设备和数据类型确定最优的数据布局如NCHW或者NHWC。当原始的layout设置并非最优时,将会自动进行layout的转换以提升模型的性能。**该功能当前仅支持动态图模式**。调优参数如下:

- **enable** (bool) - 是否开启layout的调优功能。

3. dataloader:当开启自动调优,将自动选择最佳的num_workers替换原始的配置。调优参数如下:

- **enable** (bool) - 是否开启dataloader的调优功能。

参数
:::::::::

- **config** (dict|str|None,可选) - 自动调整的配置。如果它是字典,则键是调优类型,值是调优参数构成的字典。如果它是字符串,则表示json文件路径,将根据json 文件内容配置调优参数。默认值:None,kernel、layout和dataloader的自动调优功能将全被开启。

代码示例
::::::::::

COPY-FROM: paddle.incubate.autotune.set_config:auto-tuning