Skip to content

Commit

Permalink
Added topo optimization and removed incorrect TopoOptDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Sentient07 committed Jun 29, 2016
1 parent ef84925 commit dc8f2a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
13 changes: 0 additions & 13 deletions theano/gof/optdb.py
Expand Up @@ -406,19 +406,6 @@ def __init__(self, failure_callback=opt.SeqOptimizer.warn):
self.failure_callback = None


class TopoOptDB(SequenceDB):
"""
Generate Sequence of potential Topo Optimization
"""

seq_opt = opt.TopoOptimizer

def __init__(self, failure_callback=opt.TopoOptimizer.warn):
super(TopoOptDB, self).__init__()
self.failure_callback = None


class ProxyDB(DB):
"""
Wrap an existing proxy.
Expand Down
10 changes: 4 additions & 6 deletions theano/gpuarray/opt.py
Expand Up @@ -14,7 +14,7 @@
from theano.gof import (local_optimizer, EquilibriumDB, TopoOptimizer,
SequenceDB, Optimizer, DB, toolbox, graph)
from theano.gof.opt import NavigatorOptimizer
from theano.gof.optdb import LocalGroupDB, TopoOptDB
from theano.gof.optdb import LocalGroupDB
from theano.ifelse import IfElse
from theano.misc.ordered_set import OrderedSet

Expand Down Expand Up @@ -63,8 +63,6 @@
gpu_optimizer2 = EquilibriumDB()
gpu_cut_copies = EquilibriumDB()
gpu_topo = LocalGroupDB()
topo_db = TopoOptDB()
all_local_opt = gpu_topo.query('+fast_compile')

old_not_transferred = []
new_not_transferred = []
Expand Down Expand Up @@ -95,7 +93,9 @@ def query(self, *tags, **kwtags):
'fast_compile', 'fast_run', 'gpuarray')
gpu_seqopt.register('gpuarray_cut_transfers', gpu_cut_copies, 2,
'fast_compile', 'fast_run', 'gpuarray')
# gpu_seqopt.register('topo_optimization', topo_db, -0.4, 'fast_compile', 'fast_run', 'gpuarray')

gpu_seqopt.register('op_lifter_topo', TopoOptimizer(gpu_topo.query('+fast_compile'), order='out_to_in'),
10, 'fast_run', 'gpuarray', 'fast_compile')

# do not add 'fast_run' to these two as this would always enable gpuarray mode
optdb.register('gpuarray_opt', gpu_seqopt,
Expand Down Expand Up @@ -174,8 +174,6 @@ def f(local_opt):
return local_opt
return f

topo_db.register('op_lifter_topo', all_local_opt, 10, 'fast_run', 'gpuarray', 'fast_compile')


def op_lifter(OP, cuda_only=False):
"""
Expand Down

0 comments on commit dc8f2a9

Please sign in to comment.