提交 7cf15f44 authored 作者: Frederic Bastien's avatar Frederic Bastien

Add the theano flags gpuarray.sched

上级 3b4249d3
......@@ -487,6 +487,21 @@ import theano and print the config variable, as in:
automatically to get more memory. But this can cause
fragmentation, see note above.
.. attribute:: config.gpuarray.sched
String value: ``'default'``, ``'multi'``, ``'single'``
Default: ``'default'``
Control the stream mode of contexts.
The sched parameter passed for context creation to pygpu. With
CUDA, using "multi" mean using the parameter
cudaDeviceScheduleYield. This is useful to lower the CPU overhead
when waiting for GPU. One user found that it speed up its other
process that was doing data augmentation.
.. attribute:: config.gpuarray.single_stream
Boolean value
......
......@@ -242,6 +242,16 @@ AddConfigVar('gpuarray.preallocate',
FloatParam(0),
in_c_key=False)
AddConfigVar('gpuarray.sched',
"""The sched parameter passed for context creation to pygpu.
With CUDA, using "multi" mean using the parameter
cudaDeviceScheduleYield. This is useful to lower the
CPU overhead when waiting for GPU. One user found that it
speed up its other process that was doing data augmentation.
""",
EnumStr("default", "multi", "single"),
in_c_key=True)
AddConfigVar('gpuarray.single_stream',
"""
If your computations are mostly lots of small elements,
......
......@@ -63,7 +63,8 @@ def init_dev(dev, name=None):
if dev not in init_dev.devmap:
ctx = pygpu.init(dev,
disable_alloc_cache=config.gpuarray.preallocate < 0,
single_stream=config.gpuarray.single_stream)
single_stream=config.gpuarray.single_stream,
sched=config.gpuarray.sched)
init_dev.devmap[dev] = ctx
if config.gpuarray.preallocate > 0:
MB = (1024 * 1024)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论