Layer-Based Benchmark#

class neurio.benchmarking.suites.LayerBasedBenchmark(seed=0, num_inference=16)[source]#

Benchmarking suite to test the inference of single layers on a given device.

The list of layer is as follows:

Block

Config-1

Config-2

Config-3

Config-4

Convolutional 1D

filters 32, stride 1

filters 32, stride 2

filters 64, stride 1

filters 64, stride 2

Convolutional 2D

filters 32, stride 1

filters 32, stride 2

filters 64, stride 1

filters 64, stride 2

Convolutional 2D

filters 32, 1x1

filters 32, 3x3

filters 32, 5x5 | filters 64, 7x7

Depthwise 2D conv

filters 32, stride 1

filters 32, stride 2

filters 64, stride 1

filters 64, stride 2

Convolutional 3D

filters 32, stride 1

filters 32, stride 2

filters 64, stride 1

filters 64, stride 2

Fully connected

128-32 neurons

256-64 neurons

512-128 neurons

1024-256 neurons

AvgPooling1D

2, stride 1

2, stride 2

4, stride 2

7, stride 1

AvgPooling2D

2x2, stride 1

2x2, stride 2

4x4, stride 2

7x7, stride 1

MaxPooling1D

2, stride 1

2, stride 2

4, stride 2

7, stride 1

MaxPooling2D

2x2, stride 1

2x2, stride 2

4x4, stride 2

7x7, stride 1

Activation

ReLU

Sigmoid

ReLU6

Tanh

Batch norm

1D

2D

3D

4D

Reshape

1D

2D

3D

4D

get_model(x, y)[source]#

Get the model at the location x,y of the LayerBasedBenchmark

Parameters:
  • line_idx

  • config_idx

Returns:

info(x=None, y=None)[source]#

Prints the structure of the LayerBasedBenchmark.

Parameters:
  • line_idx – If set, prints all models in the line x from the LayerBasedBenchmark

  • config_idx – If set, prints the model located at the line x and column y provided.

run_on(device: Device)[source]#

Run the Benchmark on a target device. Each model of the benchmark is compiled and deployed on the device for inference. For the inference, random data is generated according to the dimension of the input, and infered using the device infer method.

Parameters:

device – a device inheriting from Device

Returns:

the results as JSON