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

Is it possible to reuse a step's output for other two steps (avoid reruning the shared step) #552

Open
Boltzmachine opened this issue Apr 14, 2023 · 2 comments

Comments

@Boltzmachine
Copy link

For example,

@Step.register("share")
class Share(Step):
    CACHEABLE = False
    def run(self):
        ...
        
@Step.register("a")
class StepA(Step):
    def run(self, foo):
        ...
        
@Step.register("b")
class StepB(Step):
    def run(self, foo):
        ...

And the config file

steps: {
    share: {type: "share"},
    A: {type: "a", foo: {type:"ref", ref:"share"}},
    B: {type: "b", foo: {type:"ref", ref:"share"}},
}

Currently, it seems that both StepA and StepB will run the step Share. i.e. the step Share will be executed twice, once for A and once for B. Currently is it possible to just run step Share once and use the result for both StepA and StepB? I don't want to make step Share cacheable.

@Boltzmachine
Copy link
Author

I just wonder if it is possible....
Just reply me with a "no" if it is not possible...

@AkshitaB
Copy link
Contributor

AkshitaB commented Jun 5, 2023

@Boltzmachine Currently, you have set CACHEABLE = False for Share step. If you set it to True, it will cache the output, and the step will be run only once.

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

No branches or pull requests

2 participants