-
Notifications
You must be signed in to change notification settings - Fork 56
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
Recursively large parameters #254
Comments
Sample that takes a long time to start. import luigi
import gokart
class Zero(gokart.TaskOnKart):
def run(self):
self.dump(0)
class Add(gokart.TaskOnKart):
x = gokart.TaskInstanceParameter()
y = luigi.IntParameter()
def run(self):
self.dump(self.load() + self.y)
x = Zero()
for i in range(100):
x = Add(x=x, y=i)
gokart.build(x) |
Same goes for These are what's causing this hell. |
There are two solutions.
|
And {'type': 'Zero', 'params': {}}
{'type': 'Add', 'params': {'x': '{"type": "Zero", "params": {}}', 'y': '0'}}
{'type': 'Zero', 'params': {}}
{'type': 'Zero', 'params': {}}
{'type': 'Add', 'params': {'x': '{"type": "Zero", "params": {}}', 'y': '0'}}
{'type': 'Add', 'params': {'x': '{"type": "Add", "params": {"x": "{\\"type\\": \\"Zero\\", \\"params\\": {}}", "y": "0"}}', 'y': '1'}}
{'type': 'Add', 'params': {'x': '{"type": "Add", "params": {"x": "{\\"type\\": \\"Add\\", \\"params\\": {\\"x\\": \\"{\\\\\\"type\\\\\\": \\\\\\"Zero\\\\\\", \\\\\\"params\\\\\\": {}}\\", \\"y\\": \\"0\\"}}",
"y": "1"}}', 'y': '2'}}
... Imagine this being repeated 25249 times :) |
#257 will solve the problem of bloated memory. |
[future] Caching |
This is recursion.
https://github.com/m3dev/gokart/blob/master/gokart/task.py#L285-L303
self.to_str_params(only_significant=True)
append the result of the json serialization of the parameter.As a result of repeated json serialization, we have the following in dependencies.
Gokart use a lot of memory when long pipeline.
And the job is starting very slowly.
The text was updated successfully, but these errors were encountered: