PopXL User Guide and API (experimental)
Version: 3.1.0
1. Introduction
2. Concepts
2.1. IRs
2.2. Graphs
2.3. Tensors
2.4. Operations
3. Simple example
4. Data types
4.1. 8-bit floating point datatypes
4.2. 8-bit floating point inference model example
5. Tensors
5.1. Constant tensors
5.2. Variable tensors
5.3. Intermediate tensors
6. Supported operations
6.1. Data input and output
6.2. List of available operations
7. Custom operations
7.1. Environment
7.2. Parameter struct
7.3. Operation class
7.4. Opx class
7.5. Gradient operation class
7.6. Gradient opx class
7.7. Python bindings
7.8. Python wrapper
7.9. Auto-compiling custom operations with cppimport
7.10. Using your custom operation
8. Graphs
8.1. Main graph
8.2. Graphs
8.3. Creating a graph
8.4. Calling a graph
8.5. Calling a graph in a loop
8.6. Graph replication
8.7. Code loading from Streaming Memory
8.7.1. Minimal example
8.7.2. Controlling liveness between multiple calls
8.7.3. Optimisation: merging the code load operations
8.7.4. Advanced example: nested code loading
8.7.5. Advanced concept: code loading in dynamic branches
9. Transforms
9.1. Autodiff
10. Context manager
11. Session
11.1. Running a session
11.2. Getting and setting tensor data
11.2.1. When transfers will occur between host and device
11.3. Nested Session Contexts
11.4. Number of host transfers
11.5. Data input shape
11.6. Device Types
12. Variables in Streaming Memory
12.1. Remote buffers
12.2. Remote variable tensors
12.3. Variable tensors for replicated tensor sharding
13. Replication
13.1. Graph replication
13.2. Replica grouping
13.3. Code examples
13.4. Retrieval modes
14. Distributed PopXL Instances
14.1. Introduction
14.2. Primer on using PopDist and PopRun to run multi-instance applications
14.3. Basic Example
14.4. Variable ReplicaGroupings and multiple instances
14.4.1. Detail of inter-instance communication
14.5. Sharding and multiple instances
14.5.1. Basic Example
14.5.2. Using shard_over
14.5.3. Complex Example
15. Application example: MNIST
15.1. Import the necessary libraries
15.2. Prepare dataset
15.3. Create IR for training
15.3.1. Create network
15.3.2. Calculate gradients and update weights
15.4. Run the IR to train the model
15.5. Create an IR for testing and run the IR to test the model
16. Application example: MNIST with replication and RTS
16.1. Add support for replications
16.2. Change variable tensors to RTS variable tensors
17. Environment variables
17.1. Logging
17.1.1. POPART_LOG_LEVEL
17.1.2. POPART_LOG_DEST
17.1.3. POPART_LOG_CONFIG
17.2. Generating DOT files
17.3. Caching of compiled executables
18. Python API Reference
18.1. Ir
18.2. Contexts
18.3. Data types
18.4. Graphs
18.5. Modules
18.6. Random seeds
18.7. Remote buffers
18.8. Replica grouping
18.9. Session
18.10. Streams
18.11. Tensors
18.12. Tensor locations
18.13. Transforms
18.14. Utils
18.15. Ops available in PopXL
19. Index
20. Legal notices
PopXL User Guide and API (experimental)
Index
_
|
A
|
B
|
C
|
D
|
E
|
F
|
G
|
H
|
I
|
L
|
M
|
N
|
O
|
P
|
R
|
S
|
T
|
U
|
V
|
W
_
__enter__() (popxl.Session method)
__exit__() (popxl.Session method)
__init__() (popxl.dtype method)
(popxl.ExecutionContext method)
(popxl.Graph method)
(popxl.Ir method)
(popxl.ops.CallSiteInfo method)
(popxl.ops.collectives.CommGroup method)
(popxl.ops.collectives.CommGroupType method)
(popxl.RemoteBuffer method)
(popxl.ReplicaGrouping method)
(popxl.Session method)
(popxl.tensor.Tensor method)
(popxl.tensor.Variable method)
(popxl.TensorLocation method)
(popxl.TileSet method)
(popxl.transforms.ExpectedConnection method)
(popxl.transforms.GradGraphInfo method)
A
abs() (in module popxl.ops)
accumulate_() (in module popxl.ops.var_updates)
accumulate_mean_() (in module popxl.ops.var_updates)
accumulate_moving_average_() (in module popxl.ops.var_updates)
accumulate_moving_average_square_() (in module popxl.ops.var_updates)
accumulate_square_() (in module popxl.ops.var_updates)
AccumulateOuterFragment (popxl.ExecutionContext attribute)
accumulator_scale_() (in module popxl.ops.var_updates)
accumulator_zero_() (in module popxl.ops.var_updates)
adam_updater() (in module popxl.ops.var_updates)
adam_var_update() (in module popxl.ops.var_updates)
adamax_updater() (in module popxl.ops.var_updates)
add() (in module popxl.ops)
add_() (in module popxl.ops)
All (popxl.ops.collectives.CommGroupType attribute)
all_reduce() (in module popxl.ops.collectives)
all_reduce_identical_grad_inputs() (in module popxl.ops.collectives)
all_reduce_identical_inputs() (in module popxl.ops.collectives)
argmax() (in module popxl.ops)
argmin() (in module popxl.ops)
as_dtype() (popxl.dtype class method)
as_numpy() (popxl.dtype method)
as_torch() (popxl.dtype method)
assignment (popxl.ReplicaGrouping property)
autodiff() (in module popxl.transforms)
available_memory_proportions (in module popxl.ops)
,
[1]
average_pool() (in module popxl.ops)
B
batch_norm_inference() (in module popxl.ops)
build() (popxl.Module method)
C
call() (in module popxl.ops)
call_with_info() (in module popxl.ops)
called_graph (popxl.ops.CallSiteInfo property)
called_graphs (popxl.Graph property)
CallSiteInfo (class in popxl.ops)
cast() (in module popxl.ops)
cast_then_pow2scale() (in module popxl.ops)
CommGroup (class in popxl.ops.collectives)
CommGroupType (class in popxl.ops.collectives)
Compute (popxl.TileSet attribute)
concat() (in module popxl.ops)
concat_() (in module popxl.ops)
conditional() (in module popxl.ops)
conditional_with_info() (in module popxl.ops)
connection_type (popxl.transforms.ExpectedConnection property)
Consecutive (popxl.ops.collectives.CommGroupType attribute)
Constant (class in popxl.tensor)
constant() (in module popxl)
constants (popxl.Graph property)
context (in module popxl)
conv() (in module popxl.ops)
conv_pow2scaled() (in module popxl.ops)
conv_transpose() (in module popxl.ops)
conv_transpose_pow2scaled() (in module popxl.ops)
copy_to_ipu() (popxl.tensor.Constant method)
(popxl.tensor.Tensor method)
(popxl.tensor.Variable method)
copy_var_update_() (in module popxl.ops.var_updates)
cos() (in module popxl.ops)
create_empty_graph() (popxl.Ir method)
create_graph() (popxl.Ir method)
create_host_outputs() (popxl.Session method)
create_seeds() (in module popxl.random_seed)
cumsum() (in module popxl.ops)
D
decompose_sum() (in module popxl.transforms)
detach() (in module popxl.ops)
(popxl.tensor.Tensor method)
detach_() (in module popxl.ops)
(popxl.tensor.Tensor method)
DeviceToHostStream (class in popxl)
diag() (popxl.tensor.Tensor method)
dilation (in module popxl.ops)
,
[1]
div() (in module popxl.ops)
dot_checkpoint() (popxl.Ir method)
dropout() (in module popxl.ops)
dtype (class in popxl)
(popxl.tensor.Tensor property)
dynamic_slice() (in module popxl.ops)
dynamic_update() (in module popxl.ops)
dynamic_update_() (in module popxl.ops)
E
enable_conv_dithering (in module popxl.ops)
,
[1]
entries (popxl.RemoteBuffer property)
equal() (in module popxl.ops)
ExecutionContext (class in popxl)
exp() (in module popxl.ops)
exp_() (in module popxl.ops)
expected_inputs (popxl.transforms.GradGraphInfo property)
expected_inputs() (popxl.Session method)
expected_outputs (popxl.transforms.GradGraphInfo property)
ExpectedConnection (class in popxl.transforms)
ExpectedConnectionType (class in popxl.transforms)
F
flatten() (in module popxl.ops)
(popxl.tensor.Tensor method)
flatten_() (in module popxl.ops)
(popxl.tensor.Tensor method)
fmod() (in module popxl.ops)
forward_graph (popxl.transforms.GradGraphInfo property)
from_name() (popxl.dtype class method)
Fwd (popxl.transforms.ExpectedConnectionType attribute)
fwd_graph_ins_to_grad_parent_outs() (popxl.transforms.GradGraphInfo method)
fwd_parent_ins_to_grad_parent_outs() (popxl.transforms.GradGraphInfo method)
fwd_tensor (popxl.transforms.ExpectedConnection property)
FwdGrad (popxl.transforms.ExpectedConnectionType attribute)
G
gather() (in module popxl.ops)
gcg() (in module popxl.context)
gelu() (in module popxl.ops)
gelu_() (in module popxl.ops)
get_all_d2h_streams() (popxl.Ir method)
get_all_h2d_streams() (popxl.Ir method)
get_current_graph() (in module popxl.context)
get_main_graph() (in module popxl.context)
get_tensor() (popxl.Graph method)
get_tensor_data() (popxl.Session method)
get_tensors_data() (popxl.Session method)
gmg() (in module popxl.context)
GradGraphInfo (class in popxl.transforms)
Graph (class in popxl)
graph (popxl.transforms.GradGraphInfo property)
graph_input() (in module popxl)
graph_output() (in module popxl)
graph_to_parent() (popxl.ops.CallSiteInfo method)
graph_to_parent_input_index() (popxl.ops.CallSiteInfo method)
graph_to_parent_output_index() (popxl.ops.CallSiteInfo method)
greater() (in module popxl.ops)
group_norm() (in module popxl.ops)
group_size (popxl.ReplicaGrouping property)
groups (in module popxl.ops)
,
[1]
H
histogram() (in module popxl.ops)
host_cast_then_pow2scale() (in module popxl.utils)
host_load() (in module popxl.ops)
host_pow2scale_then_cast() (in module popxl.utils)
host_store() (in module popxl.ops)
HostScalarTensor (in module popxl.tensor)
HostTensor (in module popxl.tensor)
HostToDeviceStream (class in popxl)
I
id (popxl.Graph property)
(popxl.Ir property)
(popxl.tensor.Tensor property)
in_sequence() (in module popxl.context)
in_sync_with_ipu (popxl.tensor.Tensor property)
increment_mod() (in module popxl.ops)
increment_mod_() (in module popxl.ops)
init() (in module popxl.ops)
inputs (popxl.Graph property)
(popxl.ops.CallSiteInfo property)
(popxl.transforms.GradGraphInfo property)
inputs_by_name (popxl.Graph property)
inputs_dict() (popxl.transforms.GradGraphInfo method)
instance_replication_factor (popxl.Ir property)
interpolate() (in module popxl.ops)
IO (popxl.TileSet attribute)
io_tile_copy() (in module popxl.ops)
io_tile_exchange() (in module popxl.transforms)
io_tiles() (in module popxl.context)
ipu (popxl.tensor.Tensor property)
ipu() (in module popxl.context)
ipu_copy() (in module popxl.ops)
Ir (class in popxl)
ir (popxl.Graph property)
(popxl.Session property)
(popxl.tensor.Tensor property)
is_attached (popxl.Session property)
is_complex (popxl.dtype property)
is_const (popxl.ReplicaGrouping property)
is_floating_point (popxl.dtype property)
is_int (popxl.dtype property)
is_signed (popxl.dtype property)
L
l1() (in module popxl.ops)
l2() (in module popxl.ops)
lamb_square() (in module popxl.ops)
lamb_updater() (in module popxl.ops.var_updates)
layer_norm() (in module popxl.ops)
location_info (popxl.tensor.Tensor property)
log() (in module popxl.ops)
log2_scale (in module popxl.ops)
logical_and() (in module popxl.ops)
logical_not() (in module popxl.ops)
logical_or() (in module popxl.ops)
logsum() (in module popxl.ops)
logsumexp() (in module popxl.ops)
M
main_graph (popxl.Graph property)
(popxl.Ir property)
matmul() (in module popxl.ops)
matmul_pow2scaled() (in module popxl.ops)
max() (in module popxl.ops)
max_pool() (in module popxl.ops)
maximum() (in module popxl.ops)
mean() (in module popxl.ops)
median() (in module popxl.ops)
merge_exchange() (in module popxl.transforms)
meta_shape (popxl.RemoteBuffer property)
(popxl.tensor.Tensor property)
min() (in module popxl.ops)
module
popxl.ops
popxl.ops.collectives
popxl.ops.var_updates
popxl.transforms
popxl.utils
Module (class in popxl)
mul() (in module popxl.ops)
N
N (popxl.TileSet attribute)
name (popxl.dtype property)
(popxl.ExecutionContext property)
(popxl.Graph property)
(popxl.ops.collectives.CommGroupType property)
(popxl.tensor.Tensor property)
(popxl.TileSet property)
name_scope() (in module popxl.context)
negate() (in module popxl.ops)
nelms (popxl.tensor.Tensor property)
nll_loss() (in module popxl.ops)
nll_loss_with_softmax_grad() (in module popxl.ops)
Normal (popxl.ExecutionContext attribute)
num_groups (popxl.ReplicaGrouping property)
num_host_transfers (popxl.Ir property)
O
Off (popxl.ReplicatedTensorSharding attribute)
OffChip (popxl.TensorStorage attribute)
On (popxl.ReplicatedTensorSharding attribute)
OnChip (popxl.TensorStorage attribute)
onehot() (in module popxl.ops)
op_debug_context() (in module popxl.context)
OptimizerFromHostFragment (popxl.ExecutionContext attribute)
Orthogonal (popxl.ops.collectives.CommGroupType attribute)
output_padding (in module popxl.ops)
,
[1]
output_shape (in module popxl.ops)
,
[1]
outputs (popxl.Graph property)
(popxl.ops.CallSiteInfo property)
(popxl.transforms.GradGraphInfo property)
P
pad_type (in module popxl.ops)
,
[1]
padding (in module popxl.ops)
,
[1]
parent_input() (popxl.ops.CallSiteInfo method)
parent_output() (popxl.ops.CallSiteInfo method)
parent_to_graph() (popxl.ops.CallSiteInfo method)
parent_to_graph_input_index() (popxl.ops.CallSiteInfo method)
parent_to_graph_output_index() (popxl.ops.CallSiteInfo method)
popxl.ops
module
popxl.ops.collectives
module
popxl.ops.var_updates
module
popxl.transforms
module
popxl.utils
module
pow2scale_then_cast() (in module popxl.ops)
print_tensor() (in module popxl.ops)
prod() (in module popxl.ops)
R
random_normal() (in module popxl.ops)
random_uniform() (in module popxl.ops)
rank (popxl.tensor.Tensor property)
register_op_created_hook() (popxl.Graph method)
relu() (in module popxl.ops)
relu_() (in module popxl.ops)
remote_buffer() (in module popxl)
remote_buffer_id (popxl.RemoteBuffer property)
remote_load() (in module popxl.ops)
remote_load_() (in module popxl.ops)
remote_replica_sharded_variable() (in module popxl)
remote_store() (in module popxl.ops)
remote_variable() (in module popxl)
RemoteBuffer (class in popxl)
remove_op_created_hook() (popxl.Graph method)
repeat() (in module popxl.ops)
repeat_with_info() (in module popxl.ops)
replica_grouping (popxl.tensor.Variable property)
replica_grouping() (popxl.Ir method)
replica_grouping_from_assignments() (popxl.Ir method)
replica_sharded_buffer() (in module popxl)
replica_sharded_slice() (in module popxl.ops.collectives)
replica_sharded_variable() (in module popxl)
ReplicaGrouping (class in popxl)
replicaGroupSize (popxl.ops.collectives.CommGroup property)
replicated_all_gather() (in module popxl.ops.collectives)
replicated_all_reduce() (in module popxl.ops.collectives)
replicated_all_reduce_() (in module popxl.ops.collectives)
replicated_reduce_scatter() (in module popxl.ops.collectives)
replicated_slice() (in module popxl.ops.collectives)
replicated_tensor_sharding (popxl.TensorLocation property)
ReplicatedTensorSharding (class in popxl)
replication_factor (popxl.Ir property)
reshape() (in module popxl.ops)
(popxl.tensor.Tensor method)
reshape_() (in module popxl.ops)
(popxl.tensor.Tensor method)
retrieval_mode (popxl.tensor.Variable property)
roi_align() (in module popxl.ops)
run() (popxl.Session method)
run_with_outputs() (popxl.Session method)
S
ScalarType (in module popxl.tensor)
scaled_add() (in module popxl.ops)
scaled_add_() (in module popxl.ops)
scatter() (in module popxl.ops)
scatter_reduce() (in module popxl.ops)
scope (popxl.tensor.Tensor property)
Session (class in popxl)
set_parent_input_modified() (popxl.ops.CallSiteInfo method)
set_remote_buffer_info() (popxl.RemoteBuffer method)
shape (popxl.tensor.Tensor property)
shape_on_host (popxl.tensor.Variable property)
shape_on_replica (popxl.tensor.Variable property)
shaped_dropout() (in module popxl.ops)
sin() (in module popxl.ops)
slice() (in module popxl.ops)
slice_() (in module popxl.ops)
softmax() (in module popxl.ops)
sparse_accumulate_() (in module popxl.ops.var_updates)
spec (popxl.tensor.Tensor property)
split() (in module popxl.ops)
split_random_seed() (in module popxl.ops)
sqrt() (in module popxl.ops)
squeeze() (in module popxl.ops)
storage (popxl.TensorLocation property)
stride (popxl.ReplicaGrouping property)
strides() (popxl.tensor.Tensor method)
sub() (in module popxl.ops)
Subgraph (popxl.ExecutionContext attribute)
subsample() (in module popxl.ops)
sum() (in module popxl.ops)
sumsquare() (in module popxl.ops)
swish() (in module popxl.ops)
swish_() (in module popxl.ops)
T
t (in module popxl.ops)
,
[1]
T (popxl.tensor.Tensor property)
T_ (popxl.tensor.Tensor property)
table_to_string() (in module popxl.utils)
tanh() (in module popxl.ops)
Tensor (class in popxl.tensor)
tensor_dtype (popxl.RemoteBuffer property)
tensor_shape (popxl.RemoteBuffer property)
TensorLike (in module popxl.tensor)
TensorLocation (class in popxl)
tensors (popxl.Graph property)
TensorStorage (class in popxl)
tied_gather() (in module popxl.ops)
tile_set (popxl.tensor.Tensor property)
TileSet (class in popxl)
to_numpy() (in module popxl.utils)
topk() (in module popxl.ops)
toReplicaGrouping() (popxl.ops.collectives.CommGroup method)
transpose() (in module popxl.ops)
(popxl.ReplicaGrouping method)
(popxl.tensor.Tensor method)
transpose_() (in module popxl.ops)
(popxl.tensor.Tensor method)
two_uint32_to_uint64() (in module popxl.random_seed)
type (popxl.ops.collectives.CommGroup property)
U
uint64_to_two_uint32() (in module popxl.random_seed)
Undefined (popxl.TileSet attribute)
Ungrouped (popxl.ops.collectives.CommGroupType attribute)
V
validate_tensor_matches_buffer() (popxl.RemoteBuffer method)
value (popxl.ExecutionContext property)
(popxl.ops.collectives.CommGroupType property)
(popxl.TileSet property)
Variable (class in popxl.tensor)
variable() (in module popxl)
variables (popxl.Graph property)
W
weight (in module popxl.ops)
,
[1]
weights_from_host() (popxl.Session method)
weights_to_host() (popxl.Session method)
WeightsFromHostFragment (popxl.ExecutionContext attribute)
WeightsToHostFragment (popxl.ExecutionContext attribute)
where() (in module popxl.ops)
write_variable_data() (popxl.Session method)
write_variables_data() (popxl.Session method)