Skip to content

How to Configure ReRAM as a Processing Unit #683

Description

@24367452

I want to use ReRAM as a processing unit for simulating CNNs, but I don't know what interface to use to configure it.
At first, I thought that configuring the noise model of the inference RPU also configured the processing unit as follows:

    my_rpu_config = InferenceRPUConfig(noise_model=ReRamWan2022NoiseModel())
    my_rpu_config.mapping.digital_bias = True
    my_rpu_config.mapping.out_scaling_columnwise = True
    my_rpu_config.mapping.learn_out_scaling = True
    my_rpu_config.mapping.weight_scaling_omega = 1.0
    my_rpu_config.mapping.weight_scaling_columnwise = False
    my_rpu_config.mapping.max_input_size = 512
    my_rpu_config.mapping.max_output_size = 512

    my_rpu_config.noise_model = ReRamWan2022NoiseModel()
    my_rpu_config.remap.type = WeightRemapType.CHANNELWISE_SYMMETRIC
    my_rpu_config.clip.type = WeightClipType.LAYER_GAUSSIAN
    my_rpu_config.clip.sigma = 2.5

    # train input clipping
    my_rpu_config.forward.noise_management = NoiseManagementType.NONE
    my_rpu_config.forward.bound_management = BoundManagementType.NONE
    my_rpu_config.forward.out_bound = 10.0  # quite restrictive
    my_rpu_config.pre_post.input_range.enable = True
    my_rpu_config.pre_post.input_range.manage_output_clipping = True
    my_rpu_config.pre_post.input_range.decay = 0.001
    my_rpu_config.pre_post.input_range.input_min_percentage = 0.95
    my_rpu_config.pre_post.input_range.output_min_percentage = 0.95

    my_rpu_config.modifier.type = WeightModifierType.ADD_NORMAL
    my_rpu_config.modifier.std_dev = 0.1

    my_rpu_config.runtime.data_type = DATA_TYPE

But then I realised that it seems that using

rpu_config = SingleRPUConfig(device=ReRamESPresetDevice())

It is the way to configure ReRAM as a processing unit.

In the 06 example (Hardware-aware training of a simulated CNN - [examples/06_lenet5_hardware_aware.py](https://github.com/IBM/aihwkit/blob/master/examples/06_In examples/06_lenet5_hardware_aware.py) SingleRPUConfig is not used, so how is the processing unit configured in this example?Does it use ReRAM or PCM?

If you know the right way to configure the ReRAM processing unit in a CNN, please let me know, thank you very much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions