Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
cd3979e5
提交
cd3979e5
authored
2月 04, 2015
作者:
abergeron
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2473 from nouiz/profile_import
Profile import and crash fix
上级
973573df
e77cc747
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
25 行增加
和
10 行删除
+25
-10
function_module.py
theano/compile/function_module.py
+3
-0
profiling.py
theano/compile/profiling.py
+5
-1
cmodule.py
theano/gof/cmodule.py
+6
-0
link.py
theano/gof/link.py
+4
-3
utils.py
theano/gof/utils.py
+1
-1
check_blas.py
theano/misc/check_blas.py
+2
-1
dnn.py
theano/sandbox/cuda/dnn.py
+4
-4
没有找到文件。
theano/compile/function_module.py
浏览文件 @
cd3979e5
...
...
@@ -1410,6 +1410,7 @@ class FunctionMaker(object):
# Get a function instance
start_linker
=
time
.
time
()
start_import_time
=
theano
.
gof
.
cmodule
.
import_time
add_stack_trace_on_call_orig
=
gof
.
Op
.
add_stack_trace_on_call
limit_orig
=
theano
.
config
.
traceback
.
limit
try
:
...
...
@@ -1428,6 +1429,8 @@ class FunctionMaker(object):
if
self
.
profile
:
self
.
profile
.
linker_time
+=
linker_time
_fn
.
time_thunks
=
self
.
profile
.
flag_time_thunks
import_time
=
theano
.
gof
.
cmodule
.
import_time
-
start_import_time
self
.
profile
.
import_time
+=
import_time
fn
=
self
.
function_builder
(
_fn
,
_i
,
_o
,
self
.
indices
,
self
.
outputs
,
defaults
,
self
.
unpack_single
,
self
.
return_none
,
self
)
...
...
theano/compile/profiling.py
浏览文件 @
cd3979e5
...
...
@@ -104,7 +104,7 @@ def _atexit_print_fn():
for
ps
in
to_sum
[
1
:]:
for
attr
in
[
"compile_time"
,
"fct_call_time"
,
"fct_callcount"
,
"vm_call_time"
,
"optimizer_time"
,
"linker_time"
,
"validate_time"
]:
"validate_time"
,
"import_time"
]:
setattr
(
cum
,
attr
,
getattr
(
cum
,
attr
)
+
getattr
(
ps
,
attr
))
# merge dictonary
...
...
@@ -194,6 +194,9 @@ class ProfileStats(object):
linker_time
=
0.0
# time spent linking graph (FunctionMaker.create)
import_time
=
0.0
# time spent in importing compiled python module.
line_width
=
config
.
profiling
.
output_line_width
optimizer_profile
=
None
...
...
@@ -640,6 +643,7 @@ class ProfileStats(object):
print
>>
file
,
(
' Theano Linker time (includes C,'
' CUDA code generation/compiling):
%
es'
%
self
.
linker_time
)
print
>>
file
,
' Import time
%
es'
%
self
.
import_time
print
>>
file
,
''
# The validation time is a subset of optimizer_time
...
...
theano/gof/cmodule.py
浏览文件 @
cd3979e5
...
...
@@ -71,6 +71,8 @@ _logger = logging.getLogger("theano.gof.cmodule")
METH_VARARGS
=
"METH_VARARGS"
METH_NOARGS
=
"METH_NOARGS"
# global variable that represent the total time spent in importing module.
import_time
=
0
class
MissingGXX
(
Exception
):
...
...
@@ -282,11 +284,15 @@ def dlimport(fullpath, suffix=None):
_logger
.
debug
(
"module_name
%
s"
,
module_name
)
sys
.
path
[
0
:
0
]
=
[
workdir
]
# insert workdir at beginning (temporarily)
global
import_time
try
:
if
importlib
is
not
None
:
if
hasattr
(
importlib
,
"invalidate_caches"
):
importlib
.
invalidate_caches
()
t0
=
time
.
time
()
rval
=
__import__
(
module_name
,
{},
{},
[
module_name
])
t1
=
time
.
time
()
import_time
+=
t1
-
t0
if
not
rval
:
raise
Exception
(
'__import__ failed'
,
fullpath
)
finally
:
...
...
theano/gof/link.py
浏览文件 @
cd3979e5
...
...
@@ -318,7 +318,8 @@ class Container(object):
else
:
self
.
type
=
r
.
type
if
name
is
None
:
self
.
name
=
r
.
name
# Some Type do not have a name field.
self
.
name
=
getattr
(
r
,
'name'
,
None
)
else
:
self
.
name
=
name
...
...
@@ -730,9 +731,9 @@ class WrapLinker(Linker):
wrapper
=
self
.
wrapper
)
return
other
def
clone
(
allow_gc
=
undef
):
def
clone
(
self
,
allow_gc
=
undef
):
return
self
.
__class__
(
linkers
=
[
l
.
clone
(
allow_gc
=
allow_gc
)],
linkers
=
[
l
.
clone
(
allow_gc
=
allow_gc
)
for
l
in
self
.
linkers
],
wrapper
=
self
.
wrapper
)
def
accept
(
self
,
fgraph
,
no_recycling
=
None
):
...
...
theano/gof/utils.py
浏览文件 @
cd3979e5
...
...
@@ -43,7 +43,7 @@ def simple_extract_stack(f=None, limit=None):
list
.
reverse
()
return
list
if
sys
.
version_info
[:
2
]
<=
(
3
,
2
):
if
sys
.
version_info
[:
2
]
>
(
3
,
4
):
# I enable my implementation only for some python version just to
# be sure the Python internal do not change. If this work with
# other python version, you can enable it.
...
...
theano/misc/check_blas.py
浏览文件 @
cd3979e5
...
...
@@ -205,7 +205,7 @@ if __name__ == "__main__":
gpu
K6000/NOECC 0.06s 0.06s
K40 0.07s
K20m/ECC
0.08s 0.07s
K20m/ECC
0.08s
0.08s 0.07s
K20/NOECC 0.07s
M2090 0.19s
C2075 0.25s
...
...
@@ -233,6 +233,7 @@ if __name__ == "__main__":
GTX 460 0.37s 0.45s
GTX 285 0.42s 0.452s 0.452s 0.40s # cuda 3.0 seems faster? driver version?
750M 0.49s
GT 610 2.38s
GTX 550 Ti 0.57s
GT 520 2.68s 3.06s
520M 2.44s 3.19s # with bumblebee on Ubuntu 12.04
...
...
theano/sandbox/cuda/dnn.py
浏览文件 @
cd3979e5
...
...
@@ -417,8 +417,8 @@ class GpuDnnConv(DnnBase, COp):
return
[(
b
,
nb
,
(
h
+
2
*
padh
-
kh
)
/
sh
+
1
,
(
w
+
2
*
padw
-
kw
)
/
sw
+
1
(
h
+
2
*
padh
-
kh
)
/
/
sh
+
1
,
(
w
+
2
*
padw
-
kw
)
/
/
sw
+
1
)]
...
...
@@ -731,8 +731,8 @@ class GpuDnnPool(DnnBase):
return
[(
shape
[
0
][
0
],
shape
[
0
][
1
],
(
shape
[
0
][
2
]
-
kh
)
/
sh
+
1
,
(
shape
[
0
][
3
]
-
kw
)
/
sw
+
1
(
shape
[
0
][
2
]
-
kh
)
/
/
sh
+
1
,
(
shape
[
0
][
3
]
-
kw
)
/
/
sw
+
1
)]
def
c_support_code_struct
(
self
,
node
,
name
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论