Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cybertronai/gradient-checkpointing
/ functions
Functions
280 in github.com/cybertronai/gradient-checkpointing
⨍
Functions
280
◇
Types & classes
7
↳
Endpoints
2
↓ 36 callers
Function
sessrun
(*args, **kwargs)
test/memory_test.py:38
↓ 32 callers
Method
write
(self, line)
test/deep_resnet_benchmark.py:160
↓ 25 callers
Function
debug_print
Like logger.log, but also replaces all TensorFlow ops/tensors with their names. Sensitive to value of DEBUG_LOGGING, see enable_debug/disable_debug
memory_saving_gradients.py:371
↓ 24 callers
Method
__enter__
(self)
test/util.py:270
↓ 18 callers
Function
cpu_peak
()
test/memory_test.py:66
↓ 18 callers
Function
create_session
()
test/memory_test.py:52
↓ 16 callers
Method
update
(self, items)
test/linearize.py:274
↓ 14 callers
Function
block_layer
Creates one layer of blocks for the ResNet model. Args: inputs: A tensor of size [batch, channels, height_in, width_in] or [batch, height
test/resnet_model.py:187
↓ 11 callers
Function
get_var_maybe_avg
utility for retrieving polyak averaged params
test/pixel_cnn_pp/nn.py:111
↓ 11 callers
Function
int_shape
(x)
test/pixel_cnn_pp/nn.py:9
↓ 10 callers
Function
conv2d_fixed_padding
Strided 2-D convolution with explicit padding. The padding is consistent and is based only on `kernel_size`, not on the dimensions of `inputs` (a
test/resnet_model.py:83
↓ 9 callers
Function
batch_norm_relu
Performs a batch normalization followed by a ReLU.
test/resnet_model.py:42
↓ 9 callers
Function
make_chain_tanh_constant
Creates chain of length length. First node is constant, rest are tanh. Returns list of nodes. Advantage over make_chain_tanh is that unlike Variab
test/util.py:183
↓ 8 callers
Method
add
(self, x)
test/linearize.py:290
↓ 8 callers
Function
make_resnet
Creates resnet-like chain of length length. First node is constant, rest are tanh. Returns list of nodes. Has length - 2 articulation points (ie
test/util.py:219
↓ 6 callers
Function
_create_session
()
test/linearize_test.py:148
↓ 5 callers
Function
alphasorted
sort list by op.name.
test/linearize.py:57
↓ 5 callers
Function
gradient_memory_measure_mb
Evaluates gradient, prints peak memory in MBs.
test/resnet_correctness_test.py:117
↓ 5 callers
Function
gradient_memory_measure_mb
Evaluates gradient, prints peak memory in MBs.
test/resnet_test.py:116
↓ 4 callers
Function
_chain_backprop
Creates forward backward graph using tf.gradients. A0->A1->A2->..->An / / / B0<-B1<-B2<-..<-Bn
test/mem_util_test.py:13
↓ 4 callers
Method
flush
(self)
test/deep_resnet_benchmark.py:169
↓ 4 callers
Function
get_name
utlity for keeping track of layer names
test/pixel_cnn_pp/nn.py:151
↓ 4 callers
Function
gradients
Authors: Tim Salimans & Yaroslav Bulatov memory efficient gradient implementation inspired by "Training Deep Nets with Sublinear Memory Cost
memory_saving_gradients.py:42
↓ 4 callers
Function
model
(inputs, is_training)
test/resnet_model.py:247
↓ 4 callers
Function
sessrun
(*args, **kwargs)
test/resnet_correctness_test.py:87
↓ 4 callers
Function
to_ops
(ll)
test/linearize.py:102
↓ 4 callers
Function
tostr
(l)
test/deep_imagenet_benchmark.py:205
↓ 3 callers
Function
_create_cifar_resnet_loss
Creates loss tensor for resnet model.
test/linearize_test.py:155
↓ 3 callers
Function
create_session
Create session with optimizations disabled.
test/mem_util_test.py:56
↓ 3 callers
Method
getvalue
(self)
test/util.py:305
↓ 3 callers
Function
make_chain_tanh
Creates chain of length length. First node is Variable, rest are tanh. Returns nodes. Note, if length is 1, there are no non-linearities in the gr
test/util.py:164
↓ 3 callers
Function
make_feed_dict
(data, init=False)
test/pixel_cnn_test.py:179
↓ 3 callers
Function
sessrun
Helper method to use instead of sess.run that will automatically capture run_metadata.
test/mem_util_test.py:41
↓ 3 callers
Function
sessrun
(*args, **kwargs)
test/resnet_test.py:86
↓ 3 callers
Function
tf_gradients
Decorate tf.gradients calls with explicit device placement to avoid memory leaks when splitting model across multiple GPUs
memory_saving_gradients.py:21
↓ 3 callers
Function
to_op
(tensor_or_op)
test/linearize.py:96
↓ 2 callers
Method
__contains__
(self, key)
test/linearize.py:281
↓ 2 callers
Method
__del__
(self)
test/deep_resnet_benchmark.py:175
↓ 2 callers
Function
_is_variable_op
(op)
test/linearize.py:240
↓ 2 callers
Function
_process_targets
Helper utility to help variation in targets input type: -- it can be iterable vs simple list -- it can contain Operation objects or Tensor objects
test/linearize.py:374
↓ 2 callers
Function
_simplify_device_name
/job:localhost/replica:0/task:0/device:CPU:0 -> /cpu:0
test/mem_util.py:155
↓ 2 callers
Function
_timeline_from_nodestats
Return sorted memory allocation records from list of nodestats [NodeExecStats, NodeExecStats...], it's the run_metadata.step_stats.dev_stats[0].st
test/mem_util.py:70
↓ 2 callers
Function
_unsparsify
(x)
memory_saving_gradients.py:292
↓ 2 callers
Function
conv2d
convolutional layer
test/pixel_cnn_pp/nn.py:189
↓ 2 callers
Function
deconv2d
transposed convolutional layer
test/pixel_cnn_pp/nn.py:219
↓ 2 callers
Function
fast_backward_ops
(within_ops, seed_ops, stop_at_ts)
memory_saving_gradients.py:331
↓ 2 callers
Function
fetch
(url, filepath)
test/data/imagenet_data.py:17
↓ 2 callers
Function
format_children
(children)
test/linearize.py:156
↓ 2 callers
Function
format_ops
Helper method for printing ops. Converts Tensor/Operation op to op.name, rest to str(op).
memory_saving_gradients.py:383
↓ 2 callers
Function
format_ops
Helper method for printing ops. Converts Tensor/Operation op to op.name, rest to str(op).
test/util.py:41
↓ 2 callers
Function
gradient_memory_mbs
Evaluates gradient, prints peak memory.
test/imagenet_test.py:159
↓ 2 callers
Function
hash_graph
Convert graph nodes to hashes (networkx is_isomorphic needs integer nodes).
test/util.py:113
↓ 2 callers
Function
initialize_control_outputs
(g=None)
test/linearize.py:47
↓ 2 callers
Function
is_list_or_tuple
(o)
test/linearize.py:367
↓ 2 callers
Function
linearize
Obtain a single valid execution order which approximately minimizes peak memory usage. TODO: deprecate/hide modify_graph arg Args: targets:
test/linearize.py:414
↓ 2 callers
Function
log_sum_exp
numerically stable log_sum_exp implementation that prevents overflow
test/pixel_cnn_pp/nn.py:17
↓ 2 callers
Function
make_leaf
(i)
test/linearize_test.py:351
↓ 2 callers
Function
make_leaf
(i)
test/util.py:140
↓ 2 callers
Function
memory_test
Evaluates gradient, returns memory in MB's and gradient eval time in seconds.
test/deep_resnet_benchmark.py:122
↓ 2 callers
Function
memory_test
Evaluates gradient, returns memory in MB's and gradient eval time in seconds.
test/deep_imagenet_benchmark.py:136
↓ 2 callers
Function
memsorted
Sort nodes by estimated memory usage.
test/linearize.py:341
↓ 2 callers
Function
my_add_control_inputs
(wait_to_do_ops, inputs_to_do_before)
memory_saving_gradients.py:395
↓ 2 callers
Function
node_memory
(unused_node, default_memory=1)
test/linearize.py:344
↓ 2 callers
Function
projection_shortcut
(inputs)
test/resnet_model.py:211
↓ 2 callers
Method
reset
(self)
test/data/cifar10_data.py:89
↓ 2 callers
Function
reversed_graph
Reverses direction of all edges in the graph.
test/linearize.py:316
↓ 2 callers
Function
run_grads
Runs optimization for few steps, returns loss.
test/imagenet_correctness_test.py:144
↓ 2 callers
Function
sessrun
(*args, **kwargs)
test/imagenet_test.py:78
↓ 2 callers
Function
sessrun
(*args, **kwargs)
test/deep_resnet_benchmark.py:91
↓ 2 callers
Function
sessrun
(*args, **kwargs)
test/deep_imagenet_benchmark.py:105
↓ 2 callers
Function
test_chain_memory
Like test_chain, but use automatic rewriting with checkpoints="memory" strat.
test/memory_test.py:289
↓ 2 callers
Function
test_long_chain_memory
Like test_chain, but use automatic rewriting with checkpoints="memory" strategy.
test/memory_test.py:350
↓ 2 callers
Function
test_long_resnet_rewrite_memory
(linearize=False)
test/memory_test.py:542
↓ 2 callers
Function
test_minimal_resnet
(linearize=False)
test/memory_test.py:422
↓ 2 callers
Function
test_resnet_rewrite
(linearize=False)
test/memory_test.py:482
↓ 2 callers
Function
test_resnet_rewrite_memory
(linearize=False)
test/memory_test.py:612
↓ 2 callers
Function
test_toposort
()
test/linearize_test.py:41
↓ 2 callers
Function
tf_toposort
(ts, within_ops=None)
memory_saving_gradients.py:313
↓ 2 callers
Function
train_mnist
()
test/mnist_correctness_test.py:159
↓ 2 callers
Function
unpickle
(file)
test/data/cifar10_data.py:29
↓ 1 callers
Function
_create_imagenet_resnet_loss
Creates loss tensor for resnet model.
test/linearize_test.py:179
↓ 1 callers
Function
_device_stats_dict
Returns dictionary of device_name->[NodeExecStats, NodeExecStats...]
test/mem_util.py:164
↓ 1 callers
Method
_format_op
(self, op)
test/linearize.py:302
↓ 1 callers
Function
_is_iterable
(o)
memory_saving_gradients.py:363
↓ 1 callers
Function
_make_simple_caterpillar_graph
Length is number of concats.
test/linearize_test.py:348
↓ 1 callers
Function
_peak_from_nodestats
Given a list of NodeExecStats messages, construct memory timeline.
test/mem_util.py:119
↓ 1 callers
Function
_position_of_largest
Return index of largest entry
test/mem_util.py:113
↓ 1 callers
Function
_print_parsed_timeline
pretty print parsed memory timeline.
test/mem_util.py:136
↓ 1 callers
Function
_run_after
Force operation a to run after b. Do not add control dependencies to ops that already run after. Returns 0 if no dependencies were added, 1 otherw
test/linearize.py:32
↓ 1 callers
Function
_sort
Sorts nodes according to order provided. Args: nodes: nodes to sort total_order: list of nodes in correct order dedup: if True, also
test/linearize.py:490
↓ 1 callers
Function
_to_op
(tensor_or_op)
memory_saving_gradients.py:353
↓ 1 callers
Function
_to_ops
(iterable)
memory_saving_gradients.py:358
↓ 1 callers
Function
children
(op, restrict_to=None)
test/linearize.py:72
↓ 1 callers
Function
children
(op)
test/util.py:103
↓ 1 callers
Function
children_with_controls
Returns children, counting control outputs as children.
test/linearize.py:80
↓ 1 callers
Function
copy_graph
Return parts of the graph needed to compute targets.
test/linearize.py:229
↓ 1 callers
Function
create_loss
Creates loss tensor for resnet model.
test/deep_resnet_benchmark.py:71
↓ 1 callers
Function
create_loss
Creates loss tensor for resnet model.
test/resnet_correctness_test.py:67
↓ 1 callers
Function
create_loss
Creates loss tensor for resnet model.
test/resnet_test.py:66
↓ 1 callers
Function
create_loss
Creates loss tensor for resnet model.
test/deep_imagenet_benchmark.py:87
next →
1–100 of 280, ranked by callers