21. TensorFlow API changes
21.1. Release 3.1
The following changes have been made to the TensorFlow API in the Poplar SDK version 3.1. This may require you to change your code.
21.1.1. Breaking changes
Removal of deprecated Keras API
The tensorflow.python.ipu.keras
module has been removed (deprecated in Poplar SDK version 2.6, see IPU Keras changes).
The removed classes have been moved to the Keras and IPU TensorFlow Addons packages.
Keras layers were previously moved to the
ipu_tensorflow_addons.keras.layers
namespace in the IPU TensorFlow Addons package (see Deprecated layers).The Keras optimizers in the
tensorflow.python.ipu.keras.optimizers
namespace do not have direct replacements. You can find IPU-specific Keras optimizers in thekeras.ipu.optimizers
namespace in the Keras package, and theipu_tensorflow_addons.keras.optimizers
namespace in the IPU TensorFlow Addons package.Everything else can be found in the
keras.ipu
namespace in the Keras package. This namespace can also be accessed viatensorflow.keras.ipu
.
This means the deprecated Keras implementation in tensorflow.python.keras
can no longer be used with IPUs.
You must use the separate Keras package, which can also be accessed via tensorflow.keras
.
Note that in tensorflow.keras
, classes are arranged into different namespaces than in keras
.
The namespaces in tensorflow.keras
more closely match those in tensorflow.python.keras
. This is not relevant to IPU-specific classes.
Removal of deprecated Horovod API
The
tensorflow.python.ipu.horovod
module has been removed (deprecated in Poplar SDK version 3.0). As a result, the following distribution strategies are no longer available from the module -IPUHorovodStrategy
andPopDistStrategy
.The
tensorflow.python.ipu.distributed.ipu_horovod_strategy
module has been removed (deprecated in Poplar SDK version 3.0). As a result, the distribution strategyIPUHorovodStrategy
is no longer available.
21.2. Release 3.0
21.2.1. Non-breaking changes
Deprecated modules
The
tensorflow.python.ipu.horovod
module has been moved totensorflow.python.ipu.distributed
and will be removed in the next release. Usingtensorflow.python.ipu.horovod
will still work in release 3.0, but trigger a deprecation warning.
21.3. Release 2.6
The following changes have been made to the TensorFlow API in the Poplar SDK version 2.6. This may require you to change your code.
21.3.1. Breaking changes
Warning
These will require changes to any code that uses them.
Removal of deprecated APIs
The
tensorflow.python.ipu.ops.rnn_ops
module has been removed (deprecated in Poplar SDK version 2.5). As a result, the following ops are no longer available -PopnnLSTM
,PopnnDynamicLSTM
,PopnnGRU
,PopnnDynamicGRU
, andPopnnAUGRU
.The
tensorflow.python.ipu.keras.layers.rnn
module has been removed (deprecated in Poplar SDK version 2.5). As a result, the following Keras layers are no longer available -PopnnLSTM
,PopnnGRU
.
21.3.2. Non-breaking changes
IPU Keras changes
As part of releasing a separate Keras package, everything inside of the
tensorflow.python.ipu.keras
module is deprecated and will be removed in the
future release.
21.4. Release 2.5
The following changes have been made to the TensorFlow API in the Poplar SDK version 2.5. This may require you to change your code.
21.4.1. Breaking changes
Warning
These will require changes to any code that uses them.
IPU Keras changes
The argument
steps_per_execution
inmodel.compile()
now reflects the number of steps to process per execution per replica instead, whereas previously this reflected the number of steps to process per execution for all replicas combined.
Removal of deprecated APIs
IpuConfig.floating_point_behaviour.esr
may no longer be assigned a boolean value (deprecated in Poplar SDK version 2.4). Doing so will now raise aValueError
. From Poplar SDK version 2.5 onwards,StochasticRoundingBehaviour
must be used. Note that serialized IpuConfig instances from an earlier Poplar SDK version will not be deserializable from Poplar SDK version 2.5 onwards.
extract_all_events
,extract_all_strings_from_event_trace
andextract_all_types_from_event_trace
have been removed fromtensorflow.python.ipu.utils
. These items were deprecated in Poplar SDK version 2.4.
IPUMultiReplicaStrategy
(deprecated in Poplar SDK version 2.4) has been removed. From Poplar SDK version 2.5 onwards usePopDistStrategy
.The
save_interval_report
flag provided toTF_POPLAR_FLAGS
has been removed following deprecation in Poplar SDK version 2.4. From Poplar SDK version 2.5, libpva should be used.
tensorflow.python.ipu.ops.summary_ops
has been removed as bothipu_compile_summary
andget_ipu_reports
were deprecated in Poplar SDK version 2.4. From Poplar SDK 2.5 onwards, the PopVision suite of tools should be used instead. Additionally, thecompile_summary
parameter ofIPURunConfig
has been removed.
Other
The flag
save_vertex_graph
fromTF_POPLAR_FLAGS
is now non-functional. Please use thetarget.saveOutputVertexGraph
Poplar engine option instead.
21.4.2. Non-breaking changes
Deprecated layers
Keras layers from tensorflow.python.ipu.keras.layers
and
tensorflow.python.ipu.keras.losses
have been moved to the
ipu_tensorflow_addons.keras.layers
namespace in IPU TensorFlow Addons.
Additionally, the TensorFlow layers from tensorflow.python.ipu.ops.rnn_ops
have been moved to the ipu_tensorflow_addons.v1.layers
namespace in IPU
TensorFlow Addons.
The layers have been deprecated in TensorFlow and will be removed in a future release.
The table below lists all of the deprecated layers, and their new locations:
TensorFlow |
|
IPU Addons |
|
|
|
TensorFlow |
|
IPU Addons |
|
|
|
TensorFlow |
|
IPU Addons |
|
CTCInferenceLayer CTCPredictionsLayer Dropout EffectiveTransformer Embedding GroupNorm GroupNormalization GRU InstanceNorm InstanceNormalization LayerNorm LayerNormalization LSTM PopnnGRU PopnnLSTM RecomputationCheckpoint SerialDense |
|
TensorFlow |
|
IPU Addons |
|
|
|
TensorFlow |
|
IPU Addons |
|
PopnnAUGRU PopnnDynamicGRU PopnnDynamicLSTM PopnnGRU PopnnLSTM |
Deprecated pipeline and gradient_accumulation options
The experimental_normalize_gradients
parameter when setting gradient accumulation options
(Model.set_gradient_accumulation_options()
) and pipeline options (Model.set_pipelining_options()
)
has been deprecated and will be removed in future. This feature is now provided
by new mean reduction methods (see:py:class:~tensorflow.python.ipu.gradient_accumulation.GradientAccumulationReductionMethod
)
that are selected using the reduction_method
parameter in Model.set_gradient_accumulation_options()
and the gradient_accumulation_reduction_method
parameter in Model.set_pipelining_options()
.
RNN available_memory_proportion_fwd/available_memory_proportion_bwd deprecated
The available_memory_proportion_fwd
and available_memory_proportion_bwd
arguments have been deprecated and will be removed from the following layers in a future release:
tensorflow.python.ipu.ops.rnn_ops.PopnnLSTM
tensorflow.python.ipu.ops.rnn_ops.PopnnDynamicLSTM
tensorflow.python.ipu.ops.rnn_ops.PopnnGRU
tensorflow.python.ipu.ops.rnn_ops.PopnnDynamicGRU
tensorflow.python.ipu.ops.rnn_ops.PopnnAUGRU
These values are now set using the 'availableMemoryProportion'
key of the options
and options_bwd
arguments correspondingly.
21.5. Release 2.4
The following changes have been made to the TensorFlow API in the Poplar SDK version 2.4. This may require you to change your code.
21.5.1. Breaking changes
Warning
These will require changes to any code that uses them.
Summary ops
The following items related to summary ops have been deprecated, are no longer
functional and will be removed in a future release. To profile IPU programs,
use the PopVision suite of analysis tools. Trying to use these items will raise
a NotImplementedError
:
tensorflow.python.ipu.ops.summary_ops
:
ipu_compile_summary
get_ipu_reports
IPUEstimator
:
The
compile_summary
argument toIPURunConfig
Passing a
IPURunConfig
withcompile_summary
set toTrue
to anIPUEstimator
Removal of deprecated members
The following have been removed, as they were deprecated in a previous release:
The following
TF_POPLAR_FLAGS
:
dump_text_reports_to_stdio
add_all_reduce_copies
force_replicated_mode
save_oom_profiler
The following constructor arguments for
IPUInfeedQueue
:
replication_factor
data_to_prefetch
feed_name
The following constructor arguments for
IPUOutfeedQueue
:
replication_factor
io_batch_size
feed_name
The following constructor arguments for
IPULoggingTensorHook
:
replication_factor
feed_name
The following functions from
tensorflow.python.ipu.utils
:
create_ipu_config
set_serialization_options
set_optimization_options
set_norm_options
set_compilation_options
set_convolution_options
set_matmul_options
set_pooling_options
set_report_options
set_ipu_model_options
set_recomputation_options
set_floating_point_behaviour_options
set_io_tile_options
set_gcl_options
auto_select_ipus
select_ipus
set_ipu_connection_type
set_experimental_multi_replica_distribution_options
extract_compile_reports
extract_poplar_serialized_graphs
extract_execute_reports
The following functions from
tensorflow.python.ipu.ops.nn_ops
:
ctc_loss
ctc_loss_with_logits
The following functions from
tensorflow.python.ipu.ops.internal_ops
:
recompute
block_recompute
The following properties on
IPUIterator
:
output_classes
output_shapes
output_types
The following alias for
PipelineSequential
:
tensorflow.python.ipu.keras.pipeline.SequentialPipelineModel
Additionally, the documentation section on profiling through the deprecated
TensorFlow profiling APIs has been removed and an IpuOptions
configuration
protobuf can no longer be passed to the
IPURunConfig
constructor.
21.5.2. Non-breaking changes
The following functions from
tensorflow.python.ipu.utils
are now considered internal-only tools and have correspondingly been moved totensorflow.compiler.plugin.poplar.tests.test_utils
. They can still be accessed from their previous location, but not in future releases:
extract_all_events
extract_all_strings_from_event_trace
extract_all_types_from_event_trace
‘IPUConfig.floating_point_behaviour.esr’ - Assigning a bool value is deprecated and will not be supported in a future release.
StochasticRoundingBehaviour
should be used instead.
ipu_multi_replica_strategy.IPUMultiReplicaStrategy
has been renamed topopdist_strategy.PopDistStrategy
. Usingipu_multi_replica_strategy.IPUMultiReplicaStrategy
will trigger a deprecation warning.
IPUMultiWorkerStrategy
is deprecated. UsingIPUMultiWorkerStrategy
will trigger a deprecation warning.The flag
save_interval_report
fromTF_POPLAR_FLAGS
is now deprecated. Please use libpva instead.
21.6. Release 2.3
The following changes have been made to the TensorFlow API in the Poplar SDK version 2.3. This may require you to change your code.
21.6.1. Breaking changes
Warning
These will require changes to any code that uses them.
Custom user op metadata interface updates
The metadata interface for custom user ops has been updated with an additional parameter.
Existing user ops must update their custom_op_api_level
value to 5
and update their
metadata function to match the following signature
1void Build_metadata(
2 std::vector<std::int64_t>& allocating_indices,
3 std::vector<std::int64_t>& replica_identical_output_indices,
4 std::map<std::int64_t, std::int64_t>& input_to_output_tensor_aliasing,
5 bool& is_elementwise, bool& is_stateless, bool& is_hashable,
6 std::uint32_t num_inputs);
The verified transfers feature has been removed
The following functions from tensorflow.python.ipu.utils
have been removed:
set_transfer_options
set_verification_options
The following classes from tensorflow.python.ipu.config
have been removed:
KeyId
VerificationOptions
21.6.2. Non-breaking changes
‘IPUConfig.optimizations.enable_fast_math’ has been moved to ‘IPUConfig.optimizations.math.fast’
21.7. Release 2.2
The following changes have been made to the TensorFlow API in the Poplar SDK version 2.2. This may require you to change your code.
21.7.1. Breaking changes
Warning
These will require changes to any code that uses them.
C++ Poplar TensorFlow libraries are private by default
Users interested in targeting the IPU from C++ are required to use the new ipu_config library.
We’ve made most C++ libraries produced as part of the Poplar backend private, so dependencies
on poplar:driver
and other libraries will no longer be valid and should be replaced with a dependency
to //tensorflow/compiler/plugin/poplar:ipu_config
. This library provides a public interface for configuring
IPUs in C++, all other operations should use the standard TensorFlow C++ API. No other Poplar TensorFlow libraries should be
directly depended on.
Reports removed from ipu events
Following the exclusion of profiling options from the New configuration API, reports have
been removed from IPU events. The following functions from tensorflow.python.ipu.utils
have been
deprecated and now return blank lists:
extract_compile_reports
extract_poplar_serialized_graphs
extract_execute_reports
See the New configuration API changes for information on profiling TensorFlow programs using the profiling tools available in the SDK.
TensorFlow 2.1 to TensorFlow 2.4 Migration
The Graphcore TensorFlow backend has been migrated from TensorFlow 2.1 to TensorFlow 2.4 which might require changes to your application.
See the following list for IPU specific breaking changes:
experimental_run_v2
function inIPUStrategy
has been removed to align with TensorFlow 2.4 strategies.Use
run
instead.
21.7.2. Non-breaking changes
These changes are recommended.
IPULoggingTensorHook replication_factor deprecated
The replication_factor
argument of IPULoggingTensorHook
will be removed
in release 2.3. The replication factor is now automatically set based on the
model being executed.
IPUInfeedQueue/IPUOutfeedQueue/IPULoggingTensorHook feed_name deprecated
The feed_name
argument of IPUInfeedQueue
, IPUOutfeedQueue
and
IPULoggingTensorHook
has been deprecated and will be removed in release 2.3.
The feed_name
is now generated automatically internally.
Change of output location for profiling information
By default the profile information (profile.pop
& frameworks.json
) will now be output to a
subdirectory of the Poplar autoReport.directory
. If autoReport.directory
is not set, it will be output to
a subdirectory of the current working directory. This change means that mutliple
profiles can be captured for a single model, if it is separated into different Poplar graphs.
The subdirectories are created using the following format tf_report__<iso_date>__<pid>
and the cluster name can be read from the frameworks.json
file in each subdirectory.
Warning when epsilon value is too low
When the epsilon value given to instance_norm
, layer_norm
or group_norm
is less than 1.53e-5, a warning
will show on the screen that explains the potential dangers and suggests to increase it.
21.8. Release 2.1
The following changes have been made to the TensorFlow API in the Poplar SDK version 2.1. This may require you to change your code.
21.8.1. Breaking changes
Warning
These will require changes to any code that uses them.
We have removed several items that have been deprecated for at least one release.
tensorflow.python.ipu.ops.all_to_all_op.all_gather
The output shape has changed to have the
replication_factor
as the outermost instead of innermost dimension, matching the documentation.
tensorflow.python.ipu.utils
Removed
report_options
parameter fromset_report_options
.Use
graph_options
andexecution_options
parameters instead.Only removed for TensorFlow 1.15. Already removed in TensorFlow 2.4.
Removed
allow_stateful_recompute
parameter fromset_recomputation_options
.Pipelining recomputation will recompute all the non-stateful operations when recomputation is enabled.
Only removed for TensorFlow 1.15. Already removed in TensorFlow 2.4.
Removed
num_io_tiles
fromset_gcl_options
.Use the
set_io_tile_options
instead.Only removed for TensorFlow 1.15. Already removed in TensorFlow 2.4.
IPUPipelineEstimator change
The definition for iterations_per_loop
has changed. Previously the number of
iterations was defined as the number of weight updates performed. The new
definition is the number of mini-batches consumed, which makes it consistent
with the IPUEstimator when using gradient accumulation.
The argument count_gradient_accumulation_as_iterations=True
was previously
required to use this new definition. That parameter has now been removed and
the new definition is always used.
Autosharding removed
Autosharding has been removed. You should now use alternative execution modes such as pipelining instead.
Old IPU option configuration API changes
Note
These are changes to the old option configuration API. A new option configuration API has been introduced in this release and the old API is being deprecated. For more information, please see New configuration API.
The disable_graph_convolution_caching
parameter for create_ipu_config
(from tensorflow.python.ipu.utils
) has been removed.
The disable_graph_outlining
parameter must be used instead.
IPU Keras changes [TensorFlow 2]
The SequentialPipelineModel
alias for PipelineSequential
has been
removed.
In the constructors of ipu.keras.Model
and ipu.keras.Sequential
,
the alias accumulation_count
for the gradient_accumulation_count
parameter has been removed.
Similarly, the alias accumulation_dtype
for gradient_accumulation_dtype
has been removed.
21.8.2. Non-breaking changes
These changes are recommended.
Recompute suggestions deprecated
The recompute
and block_recompute
utility ops have been deprecated and will be removed
in release 2.2. Automatic recomputation of casts will remain.
IPUInfeedQueue/IPUOutfeedQueue replication_factor deprecated
The replication_factor
argument of IPUInfeedQueue
and IPUOutfeedQueue
has been deprecated
and will be removed in release 2.2. The replication factor is now automatically set based on the model
being executed.
IPUInfeedQueue data_to_prefetch deprecated
The data_to_prefetch
argument of IPUInfeedQueue
has been deprecated and
will be removed in release 2.2. It is recommended to use the prefetch_depth
argument instead.
IPUOutfeedQueue data_to_prefetch deprecated
The io_batch_size
argument of IPUOutfeedQueue
has been deprecated and
will be removed in release 2.2. It is recommended to either manually accumulate
results or use accumulate_outfeed
when using pipelining.
CTC loss ops deprecated
The ctc_loss
and ctc_loss_with_logits
ops from ipu.ops.nn_ops
have been deprecated and
will be removed in release 2.2. They have been superseded by ctc_loss_v2
and
ctc_loss_with_log_probs
.
New configuration API
A new API for configuring the IPU system has been added which is replacing the
current API. The new API consists of a single class called
IPUConfig
with a hierarchical organisation of options as attributes.
You can set options by assigning values to the attributes of an instance of this
class. The class includes some usability features which should make the process
of configuring the IPU system easier and with no hidden pitfalls. For more
information about the new API, see Configuring system options.
Warning
The new IPUConfig
API does not include the profiling options in the
former configuration API, such as profiling
, profile_execution
,
report_every_nth_execution
etc.
To profile a TensorFlow program, you should instead use the suite of profiling
tools that have been added to the SDK. For general advice on how to enable
profiling, refer to the Capturing IPU reports chapter
in the PopVision Graph Analyser User Guide. To parse profiles, use the
PopVision Analysis library Python API or PopVision Analysis library C++ API
in the Poplar and PopLibs API Reference. To enable time-based profiling of
events, see the Capturing execution information
chapter of the PopVision System Analyser User Guide.
Note that any Poplar engine options mentioned in the above guides can be
passed to the compilation_poplar_options
IPUConfig
option, so it is not impossible to enable profiling using the
new configuration API directly, but it is not advised, as environment
variables will overwrite any values set this way.
Warning
The new IPUConfig
API does not support verified transfers. This means the
verified transfers feature will be removed when the old API is removed.
The new IPUConfig
class is in a new namespace
tensorflow.python.ipu.config
. Multiple functions and classes have moved from
tensorflow.python.ipu.utils
to the config
namespace:
configure_ipu_system()
get_ipu_config()
SelectionOrder
ExecutionProfileType
DeviceConnectionType
They can still be accessed from tensorflow.python.ipu.utils
- along with
IPUConfig
- and there are currently no plans to remove this additional
access route.
To help in converting from the old configuration API to the new API, the
following table shows which attribute of IPUConfig
each function argument in
the old API corresponds to and how:
Old API function |
Function argument |
|
---|---|---|
|
|
Not supported in IPUConfig. Use the autoReport.outputGraphProfile or autoReport.all Poplar engine options. |
|
Not supported in IPUConfig. Use the PopVision System Analyser to inspect compilation, transfer and execution events. |
|
|
Not supported in IPUConfig. Use the PopVision Graph Analyser for manual inspection of reports. |
|
|
Not supported in IPUConfig. You can set the profiler.format Poplar engine option to the deprecated “v1” value for CBOR reports. |
|
|
Not supported in IPUConfig. Use the autoReport.all and debug.computeInstrumentationLevel Poplar engine options. |
|
|
Not supported in IPUConfig. Use the autoReport.outputSerializedGraph or autoReport.all Poplar engine options instead. |
|
|
Not supported in IPUConfig. This feature will be removed when the former configuration API is removed. |
|
|
Not supported in IPUConfig. The Poplar profiling format’s storage size has been significantly improved. |
|
|
Not supported in IPUConfig. To make module profiling files go into their own sub-directories, do not set autoReport.directory. |
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
|
|
|
|
|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
|
|
|
norms.experimental.distributed_batch_norm_replica_group_size |
|
|
|
Not supported with IPUConfig. Verified transfers will be removed when the former configuration API is removed. |
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
Not supported in IPUConfig. All graph report options have equivalents in the PopVision Graph Analyser or PopVision Analysis APIs |
|
Not supported in IPUConfig. All execution report options have equivalents in the PopVision Graph Analyser |
|
|
|
|
|
||
|
||
|
|
|
|
|
|
|
||
|
||
|
||
|
||
|
|
|
|
||
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
||
|
|
|
|
- 1
IPUConfig.scheduling.algorithm
takes a value from the newSchedulingAlgorithm
enumeration, whereas the former configuration API took a string. The old string values map to the enumeration as follows:“”:
SchedulingAlgorithm.CHOOSE_BEST
“Clustering”:
SchedulingAlgorithm.CLUSTERING
“PostOrder”:
SchedulingAlgorithm.POST_ORDER
“LookAhead”:
SchedulingAlgorithm.LOOK_AHEAD
“ShortestPath”:
SchedulingAlgorithm.SHORTEST_PATH
- 2
IPUConfig.optimizations.enable_graph_outlining
takes a boolean value that specifies whether or not graph outlining should be enabled. A value of True means that graph outlining is enabled. This is different to the old configuration API, which took a boolean value that specifies whether or not graph outlining should be disabled. Therefore, you should invert the boolean you gave to the old configuration API when passing it to an IPUConfig.- 3
IPUConfig.optimizations.merge_remote_buffers
takes a value from the newMergeRemoteBuffersBehaviour
enumeration, whereas the former configuration API took a boolean or None value. The old values map to the enumeration as follows:True
:MergeRemoteBuffersBehaviour.MERGE
False
:MergeRemoteBuffersBehaviour.NO_MERGING
None
:MergeRemoteBuffersBehaviour.IF_BENEFICIAL
The
IPUConfig
also sets the default value toIF_BENEFICIAL
, whereas the old configuration API sets the default value toNO_MERGING
.- 4
In the old configuration API, a call to
set_recomputation_options
would make theallow_recompute
argument True by default, therefore merely callingset_recomputation_options(opts)
would turn recomputation on. Please bear this in mind when moving toIPUConfig
.- 5
In the old configuration API, a call to
set_floating_point_behaviour_options
would make all of the arguments True by default, therefore merely callingset_floating_point_behaviour_options(opts)
would turn all ofinv
,oflo
,nanoo
,div0
andesr
on. Please bear this in mind when moving toIPUConfig
. Note that there is the floating_point_behaviour.set_all option to unconditionally set all of these options on provided for convenience.- 6
IPUConfig.device_connection.version
takes a string, whereas the former configuration API took an integer. The old values map to the string values as follows:1: “ipu1”
2: “ipu2”
- 7(1,2,3,4,5)
In the old configuration API, all options dictionaries are accumulative each time their function is called. For example, doing:
opts = set_compilation_options(opts, {"option1": "true"}) ... opts = set_compilation_options(opts, {"option2": "5"})
would mean that Poplar compilation is given both options
{"option1": "true", "option2": "5"}
.In the
IPUConfig
API, this is not the case, as these options dictionaries are like any other Python dictionary: assigning to them again will overwrite them:opts.compilation_poplar_options = {"option1": "true"} ... opts.compilation_poplar_options = {"option2": "5"}
would mean that Poplar compilation is given only
{"option2": "5"}
. To achieve behaviour like the old configuration API, use the following:opts.compilation_poplar_options = {"option1": "true"} ... opts.compilation_poplar_options = {**{"option2", "5"}, **opts.compilation_poplar_options}
Support for grouped collectives
tensorflow.python.ipu.ops.all_to_all_op.all_gather
tensorflow.python.ipu.ops.reduce_scatter_op.reduce_scatter
The
replication_factor
can now be set to a value smaller than the total number of replicas in the model, in which case the collective operation will be performed within groups of the given size.
tensorflow.python.ipu.ops.cross_replica_ops.cross_replica_sum
A new optional argument
replica_group_size
is added for specifying the number of replicas in each collective group. If not specified, there is a single group containing all the replicas.
Environment variable changes
The dump_text_reports_to_stdio
flag passed to TF_POPLAR_OPTIONS
has been
deprecated and has no effect. Use the PopVision Graph Analyser to manually
inspect profiles.
21.9. Release 2.0
The following changes have been made to the TensorFlow API in the Poplar SDK version 2.0. This may require you to change your code.
21.9.1. Breaking changes
Warning
These will require changes to any code that uses them.
We have removed several items that have been deprecated for at least one release.
tensorflow.python.ipu.ipu_outfeed_queue
Removed
outfeed_all
parameter fromIPUOutfeedQueue
.Use
outfeed_mode
parameter instead.
tensorflow.python.ipu.ipu_pipeline_estimator
Removed
pipeline_depth
parameter fromIPUPipelineEstimatorSpec
.Use
gradient_accumulation_count parameter instead
.
tensorflow.python.ipu.utils
Removed
retain_control_dependencies
parameter fromcreate_ipu_config
.Only removed in TensorFlow 2.1.
Removed
max_cross_replica_sum_buffer_size
, andmax_inter_ipu_copies_buffer_size
parameters fromcreate_ipu_config
.Use
set_optimization_options
instead.Removed
report_options
parameter fromset_report_options
.Use
graph_options
andexecution_options
parameters instead.Removed
allow_stateful_recompute
parameter fromset_recomputation_options
.Pipelining recomputation will recompute all the non-stateful operations when recomputation is enabled.
Removed
num_io_tiles
fromset_gcl_options
.Use the
set_io_tile_options
instead.
tensorflow.python.ipu.ops.embedding_ops.embedding_lookup
Removed
one_hot_threshold
andmin_encoding_size
parameters fromembedding_lookup
.Removed
count
parameter fromHostEmbeddingScope.lookup
.
tensorflow.python.ipu.ops.functional_ops
Removed
function
.Use
outlined_function
instead.
tensorflow.python.ipu.ops.normalization_ops
Removed
reduction_axes
parameter fromgroup_norm
,layer_norm
, andinstance_norm
.
tensorflow.python.ipu.ops.pipelining_ops
Removed
pipeline_depth
parameter frompipeline
.Use
gradient_accumulation_count
instead.
tensorflow.python.ipu.ops.rnn_ops
Removed support for passing a tuple as the
initial_state
argument forPopnnLSTM.call
.This must be an
LSTMStateTuple
now.
The following deprecated namespace has been removed:
tensorflow.python.ipu.ipu_optimizer
Use the
tensorflow.python.ipu.optimizers
namespace instead.
21.9.2. Non-breaking changes
These changes are recommended.
IPUPipelineEstimator change
The definition for iterations_per_loop
has changed. Previously the number of
iterations was defined as the number of weight updates performed. The new
definition is the number of mini-batches consumed, which makes it consistent
with the IPUEstimator when using gradient accumulation. The old definition is
still used by default, but it will be removed in a future release.
Use the argument count_gradient_accumulation_as_iterations=True
to use the
new definition.
Autosharding deprecated
Autosharding has been deprecated, and will be removed in a future release. You should now use alternative execution modes such as pipelining instead.
IPU config change
The disable_graph_convolution_caching
parameter for create_ipu_config
(from tensorflow.python.ipu.utils
) has been deprecated as it has no effect.
It will be removed in a future release.
The disable_graph_outlining
parameter should be used instead.
IPU Keras changes [TensorFlow 2]
SequentialPipelineModel
has been renamed to PipelineSequential
for
consistency with its Model
counterpart. The old name can still be used, but
is deprecated and will be removed in a future release.
The accumulation_count
argument in the constructors of the
ipu.keras.Model
and ipu.keras.Sequential
has been renamed to
gradient_accumulation_count
to be consistent with the rest of the code base.
The old name can still be used, but is deprecated and will be removed in a
future release.
Similarly, accumulation_dtype
has been renamed to gradient_accumulation_dtype
.