public final class MLCGraphCompilationOptions
extends java.lang.Object
A bitmask that specifies the options you use when compiling a graph.
This is passed as an argument to the compileWithOptions method avalable on MLCTrainingGraph and MLCInferenceGraph
| Modifier and Type | Field and Description |
|---|---|
static long |
ComputeAllGradients
The option to compute all gradients during graph compilation.
|
static long |
DebugLayers
The option to debug layers during graph compilation.
|
static long |
DisableLayerFusion
The option to disable layer fusion during graph compilation.
|
static long |
LinkGraphs
The option to link graphs during graph compilation.
|
static long |
None
No graph compilation options.
|
public static final long None
public static final long DebugLayers
Include this option to disable various optimizations such as layer fusion, and ensure the framework synchronizes the resulting forward and gradients tensors host memory with device memory, for layers marked as debuggable.
public static final long DisableLayerFusion
Include this option to disable fusion of layers, which is an important optimization that helps performance and memory footprint.
public static final long LinkGraphs
Include this option when you link together one or more sub-graphs when executing the forward, gradient, and optimizer update. For example, if the full computation graph includes a layer that the framework doesn’t support, you’ll need to create multiple sub-graphs and link them together using \p MLCGraphCompilationOptionsLinkGraphs. When doing so, include this option when you call \p -compileWithOptions: for graphs you want to link together.
public static final long ComputeAllGradients
Include this option to compute gradients for layers with or without parameters that only take input tensors. For example, if the first layer of a graph is a convolution layer, the framework only computes the gradients for weights and biases associated with the convolution layer, but not the gradients for the input. Include this option if you want to compute all gradients for the input.