Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
cdc5896f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
cdc5896f
编写于
3月 21, 2023
作者:
A
Ainavo
提交者:
GitHub
3月 21, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unnecessary generator set and dict (#51845)
上级
4dbf3a8f
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
11 deletion
+11
-11
python/paddle/distributed/auto_parallel/tuner/tunable_space.py
...n/paddle/distributed/auto_parallel/tuner/tunable_space.py
+2
-2
python/paddle/distributed/auto_parallel/tuner/tunable_variable.py
...addle/distributed/auto_parallel/tuner/tunable_variable.py
+1
-1
python/paddle/distributed/fleet/meta_parallel/parallel_layers/pp_layers.py
...tributed/fleet/meta_parallel/parallel_layers/pp_layers.py
+4
-4
python/paddle/distributed/ps/utils/public.py
python/paddle/distributed/ps/utils/public.py
+1
-1
python/paddle/incubate/distributed/fleet/parameter_server/distribute_transpiler/distributed_strategy.py
...eter_server/distribute_transpiler/distributed_strategy.py
+1
-1
python/paddle/static/quantization/tests/quant2_int8_image_classification_comparison.py
...tion/tests/quant2_int8_image_classification_comparison.py
+1
-1
python/paddle/static/quantization/tests/quant2_int8_nlp_comparison.py
...e/static/quantization/tests/quant2_int8_nlp_comparison.py
+1
-1
未找到文件。
python/paddle/distributed/auto_parallel/tuner/tunable_space.py
浏览文件 @
cdc5896f
...
...
@@ -117,7 +117,7 @@ class TunableSpace:
{
"class_name"
:
v
.
__class__
.
__name__
,
"state"
:
v
.
get_state
()}
for
v
in
self
.
_variables
.
values
()
],
"values"
:
dict
((
k
,
v
)
for
(
k
,
v
)
in
self
.
values
.
items
())
,
"values"
:
{
k
:
v
for
(
k
,
v
)
in
self
.
values
.
items
()}
,
}
@
classmethod
...
...
@@ -126,7 +126,7 @@ class TunableSpace:
for
v
in
state
[
"variables"
]:
v
=
_deserialize_tunable_variable
(
v
)
ts
.
_variables
[
v
.
name
]
=
v
ts
.
_values
=
dict
((
k
,
v
)
for
(
k
,
v
)
in
state
[
"values"
].
items
())
ts
.
_values
=
{
k
:
v
for
(
k
,
v
)
in
state
[
"values"
].
items
()}
return
ts
...
...
python/paddle/distributed/auto_parallel/tuner/tunable_variable.py
浏览文件 @
cdc5896f
...
...
@@ -88,7 +88,7 @@ class Choice(TunableVariable):
def
__init__
(
self
,
name
,
values
,
default
=
None
):
super
().
__init__
(
name
=
name
,
default
=
default
)
types
=
set
(
type
(
v
)
for
v
in
values
)
types
=
{
type
(
v
)
for
v
in
values
}
if
len
(
types
)
>
1
:
raise
TypeError
(
"Choice can contain only one type of value, but found values: {} with types: {}."
.
format
(
...
...
python/paddle/distributed/fleet/meta_parallel/parallel_layers/pp_layers.py
浏览文件 @
cdc5896f
...
...
@@ -433,9 +433,9 @@ class PipelineLayer(nn.Layer):
return
layers_desc
=
self
.
_layers_desc
shared_layer_names
=
set
(
shared_layer_names
=
{
s
.
layer_name
for
s
in
layers_desc
if
isinstance
(
s
,
SharedLayerDesc
)
)
}
for
key
in
shared_layer_names
:
shared_layers
=
[]
for
idx
,
layer
in
enumerate
(
layers_desc
):
...
...
@@ -445,9 +445,9 @@ class PipelineLayer(nn.Layer):
):
shared_layers
.
append
(
idx
)
shared_stages
=
set
(
shared_stages
=
{
self
.
get_stage_from_index
(
idx
)
for
idx
in
shared_layers
)
}
self
.
_dp_degree
=
self
.
_topo
.
get_dim
(
'data'
)
self
.
_mp_degree
=
self
.
_topo
.
get_dim
(
'model'
)
self
.
_sharding_degree
=
self
.
_topo
.
get_dim
(
'sharding'
)
...
...
python/paddle/distributed/ps/utils/public.py
浏览文件 @
cdc5896f
...
...
@@ -194,7 +194,7 @@ class TrainerRuntimeConfig:
'communicator_send_queue_size'
]
=
num_threads
return
dict
((
key
,
str
(
self
.
runtime_configs
[
key
]))
for
key
in
need_keys
)
return
{
key
:
str
(
self
.
runtime_configs
[
key
])
for
key
in
need_keys
}
def
get_lr_ops
(
program
):
...
...
python/paddle/incubate/distributed/fleet/parameter_server/distribute_transpiler/distributed_strategy.py
浏览文件 @
cdc5896f
...
...
@@ -128,7 +128,7 @@ class TrainerRuntimeConfig:
'communicator_send_queue_size'
]
=
num_threads
return
dict
((
key
,
str
(
self
.
runtime_configs
[
key
]))
for
key
in
need_keys
)
return
{
key
:
str
(
self
.
runtime_configs
[
key
])
for
key
in
need_keys
}
def
display
(
self
,
configs
):
raw0
,
raw1
,
length
=
45
,
5
,
50
...
...
python/paddle/static/quantization/tests/quant2_int8_image_classification_comparison.py
浏览文件 @
cdc5896f
...
...
@@ -357,7 +357,7 @@ class Quant2Int8ImageClassificationComparisonTest(unittest.TestCase):
assert
quant_acc1
-
int8_acc1
<=
threshold
def
_strings_from_csv
(
self
,
string
):
return
set
(
s
.
strip
()
for
s
in
string
.
split
(
','
))
return
{
s
.
strip
()
for
s
in
string
.
split
(
','
)}
def
_ints_from_csv
(
self
,
string
):
return
set
(
map
(
int
,
string
.
split
(
','
)))
...
...
python/paddle/static/quantization/tests/quant2_int8_nlp_comparison.py
浏览文件 @
cdc5896f
...
...
@@ -294,7 +294,7 @@ class QuantInt8NLPComparisonTest(unittest.TestCase):
assert
quant_acc
-
int8_acc
<=
threshold
def
_strings_from_csv
(
self
,
string
):
return
set
(
s
.
strip
()
for
s
in
string
.
split
(
','
))
return
{
s
.
strip
()
for
s
in
string
.
split
(
','
)}
def
_ints_from_csv
(
self
,
string
):
return
set
(
map
(
int
,
string
.
split
(
','
)))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录