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

Add support for static value inputs (set by frontend) with Execution Number node #2433

Merged
merged 24 commits into from Jan 18, 2024

Conversation

joeyballentine
Copy link
Member

@joeyballentine joeyballentine commented Jan 4, 2024

Adds support for non-deterministic nodes... kinda.

The only node I've implemented with this is an execution number node. It's just a number that increments every time you press run. If this gets approved/merged, I plan on doing one for the current datetime as well.

This is really, really jank - but basically, I hardcode a node on the frontend that only exists on the frontend. Then, in the code that converts the flow to the backend format, I get rid of that node and replace its connections with a static value, as if that value was typed into the input.

I'm sure this is still technically "wrong" and blah blah determinism, but I think this is a good compromise as it doesn't affect how we handle caching. It's just the same as if the user were to manually change a value every time. And since this has been requested many times, I think it's worth having, even if it's a bit jank.

This only partially implements #1447. I have not added a way to manipulate this counter yet, and probably won't in this PR.

This also does not display any Navi/type info about what the value will be before running. I'm not sure how we could implement that.

@joeyballentine joeyballentine changed the title Add support for non-deterministic helper nodes Add support for static value inputs (set by frontend) w/ Get Execution Number node Jan 15, 2024
@joeyballentine
Copy link
Member Author

For documentation purposes: This now utilizes a new type of input for adapting static values from the frontend.

@joeyballentine joeyballentine changed the title Add support for static value inputs (set by frontend) w/ Get Execution Number node Add support for static value inputs (set by frontend) with Get Execution Number node Jan 15, 2024
@joeyballentine joeyballentine changed the title Add support for static value inputs (set by frontend) with Get Execution Number node Add support for static value inputs (set by frontend) with Execution Number node Jan 15, 2024
@RunDevelopment
Copy link
Member

Other things I noticed:

  1. Should the execution number reset? E.g. when the chain is reset (Ctrl+N) or a different chain is loaded? I'm not sure.
  2. The current design is confusing. The output value is styled in the same way we usually style labels. E.g. this looks like an input called "19" that expects an integer.
    image
    I think something similar to how Pass Through does type tags would look better.
    image
    E.g. we could do:
     # Execution Number
     Current       [19]
    
    And use a big tag for the number, like model tags do.

@joeyballentine
Copy link
Member Author

Should the execution number reset? E.g. when the chain is reset (Ctrl+N) or a different chain is loaded?

I don't personally think so. I plan on doing a follow-up to this where I add the ability to manually reset the number. I just haven't decided how I want to expose that yet

@joeyballentine joeyballentine merged commit 8130961 into main Jan 18, 2024
17 checks passed
@joeyballentine joeyballentine deleted the non-deterministic-helper-nodes branch January 18, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants