-
Notifications
You must be signed in to change notification settings - Fork 765
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
zhangting2020
merged 5 commits into
PaddlePaddle:develop
from
zhangting2020:autotune_api
Apr 29, 2022
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
该功能当前仅支持动态图模式
请加粗一下?