Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully backend-agnostic Process API #579

Closed
mathisrichter opened this issue Jan 19, 2023 · 2 comments
Closed

Fully backend-agnostic Process API #579

mathisrichter opened this issue Jan 19, 2023 · 2 comments
Assignees
Labels
1-feature New feature request 2-important/not-urgent Important issues that are not urgent

Comments

@mathisrichter
Copy link
Contributor

mathisrichter commented Jan 19, 2023

User story

As a user, I want to replace the backend of any Lava Process without having to change its parameters. This is one of the core promises of Lava to enable productive work in heterogeneous hardware environments.

Conditions of satisfaction

  • All parameters of Lava Processes are agnostic to the ProcessModel chosen for execution.
  • All parameters are abstract enough to not be tied to a particular implementation.

Acceptance tests

  • to be determined

Originally raised by @epaxon

Current behavior

  • Setting the same parameter values/using the same processes has different behavior on Loihi 2 and CPU backends for both LIF and Dense.
# Loihi 2 sim (bit_accurate_loihi is the same):
inport_plug = LIF(shape=(4,), vth=10, du=0, dv=0, bias_mant=80)

dense_weights = Dense(weights=weights)

lif_layer = LIF(shape=(3,), vth=10, du=4095, dv=0, bias_mant=0)
inport_plug.s_out.connect(dense_weights.s_in)
dense_weights.a_out.connect(lif_layer.a_in)

# What it takes to get same result with default LIF:
inport_plug = LIF(shape=(4,), vth=10*2**6, du=0, dv=0, bias_mant=80)

dense_weights = Dense(weights=weights*2**6)

lif_layer = LIF(shape=(3,), vth=10*2**6, du=4096/2**12, dv=0, bias_mant=0)
inport_plug.s_out.connect(dense_weights.s_in)
dense_weights.a_out.connect(lif_layer.a_in)
@mathisrichter mathisrichter added the 1-feature New feature request label Jan 19, 2023
@mathisrichter mathisrichter self-assigned this Jan 19, 2023
@github-actions github-actions bot added the 0-needs-review For all new issues label Jan 19, 2023
@mathisrichter mathisrichter added 2-important/not-urgent Important issues that are not urgent and removed 0-needs-review For all new issues labels Jan 19, 2023
@tim-shea
Copy link
Contributor

I am pretty sure this is just not possible in theory. The best one could do in most cases is to give the user a bunch of convenience tools that pretend like two very different versions of a process model behave the same, but these kinds of tools have proven to be difficult research projects in themselves.

My counter-suggestion would be to strongly prefer, at a Lava community standards level, for Process developers to provide backend agnostic parameterizations, but also create a simple system for providing backend-specific parameterizations when that is what's needed. I think the HyperParameters object in Lava-Optimization could be a reasonable model for this.

@tim-shea
Copy link
Contributor

Since there is no reply to the above, and this isn't blocking anything, and this issue doesn't correspond to a clearly defined set of changes needed in the code, I'm closing for now. I'm going to submit a new issue specific to LIF parameterization and I recommend we do the same for any other process models that have significant issues with hardware-specific parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-feature New feature request 2-important/not-urgent Important issues that are not urgent
Projects
None yet
Development

No branches or pull requests

2 participants