Tunny running headless with compute

Hi all (and especially @hiron if i’m not mistaken),

I’ve been trying to make Tunny work with rhino.compute. I’ve been using the tunny_optimization_without_ui from the examples and adapted it so, that it returns as a string the best generation:

I ran it with a local compute server instance. The behavior is quite weird: i’ve managed to see that

  1. It doesn’t work the first time

  2. But it works fine the second time when launched with the same input


I think the thing here is that the first time it works but the component doesn’t “stop” the Grasshopper flow so it returns an empty string while being processed.

When i relaunch the definition, the solution is already cached, so it works fine (with the same input, of course if i change the input it fails as well).

Here are the logs associated to the compute (being processed in between the first and second time):

CG  [18:31:38 INF] Load existing setting.json
CG  [18:31:39 INF] Trial 1 finished with values: {'v0': 1460, 'v1': 145} and parameters: {'x': 13, 'y': 14}.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:39 INF] Load existing setting.json
CG  [18:31:39 INF] Trial 2 finished with values: {'v0': 980, 'v1': 505} and parameters: {'x': -7, 'y': -14}.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:39 INF] Load existing setting.json
CG  [18:31:39 INF] Trial 3 finished with values: {'v0': 1124, 'v1': 221} and parameters: {'x': -5, 'y': 16}.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:39 INF] Load existing setting.json
CG  [18:31:39 INF] Trial 4 finished with values: {'v0': 1280, 'v1': 130} and parameters: {'x': 16, 'y': 8}.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:39 INF] Load existing setting.json
CG  [18:31:39 INF] Trial 5 finished with values: {'v0': 884, 'v1': 361} and parameters: {'x': -14, 'y': 5}.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:39 INF] Load existing setting.json
CG  [18:31:39 INF] Trial 6 finished with values: {'v0': 2084, 'v1': 261} and parameters: {'x': 20, 'y': 11}.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:40 INF] Load existing setting.json
CG  [18:31:40 INF] Trial 7 finished with values: {'v0': 1856, 'v1': 394} and parameters: {'x': 20, 'y': -8}.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:40 INF] Load existing setting.json
CG  [18:31:40 INF] Trial 8 finished with values: {'v0': 260, 'v1': 225} and parameters: {'x': -7, 'y': -4}.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:40 INF] Load existing setting.json
CG  [18:31:40 INF] Trial 9 finished with values: {'v0': 1636, 'v1': 229} and parameters: {'x': 3, 'y': 20}.
CG  [18:31:46 INF] Solver completed successfully. The specified number of trials has been completed.
Speckle - Backup headless doc is ready: 'Untitled'
    with template: 'No template'
    with units: Millimeters
Speckle - To modify the units in a headless run, you can override the 'RhinoDoc.ActiveDoc' in the '.gh' file using a c#/python script.
CG  [18:31:46 INF] Load existing setting.json

Is there anything i can do to “stop the flow before Tunny has ended processing the solution” ?

Here’s the file so you can see better what i tried: tunny_optimization_without_ui.gh

Thanks in advance,

Best

1 Like

@Quentin1
Sorry it took me so long to see this, I’m hrntsm, the developer of Tunny.
Because of this hard-to-get-along behaviour, I am considering a different method to get it working well in the new version of Tunny that is under development.
I appreciate your feedback, and I’ll try to get it to work better in the new version of Tunny.

1 Like

Thanks a lot for your feedback, much appreciated. I’m glad these developments are already on track! In case you need any beta feedbacks on ongoing developments we’d be more than happy to help, so feel free to ask :smile:
Best, have a nice week

Thank you.
I am working hard on creating a new UI for the next version. Therefore, it is unlikely that this issue will be addressed immediately, but your feedback would be greatly appreciated once the beta version is released.

1 Like

I understand, perfect!
Just in case, for now we’re only trying to use Bone Fish component so that we’re able to run it in compute, will it be affected by the update? Or do you plan to make compute available for standard component in the same release?

As for BoneFishComponent, I would like to ask you to use the current version first, as I will be identifying the problem and investigating the technical issues.

Hey @hiron !

I’ve briefly checked the latest beta of Tunny, and I’m impressed by the new UI overhaul, it looks pretty promising. Great job !

Touching back on the subject of Bone Fish, I’ve noticed that it’s upright not working anymore on this beta. Going from the optimization_without_ui.gh example file, when launching the component, the GH canvas stays frozen as the image below shows, and no trials are started. I’ve tried replacing deprecated components, as well as the Bone Fish component, same outcome. Of course, Rhino needs to be restarted afterwards as you can’t close or switch definitions.

Any insights? Is the Bone Fish component in the scope of the upcoming release?

Also, when trying one the result handling example with the new UI, I’ve noticed that upon having a runtime error, Tunny requires a reboot of Rhino in order to work. Is the same behavior going to be expected in Bone Fish? I’m asking the question since it maybe problematic when running it in a headless environment (i.e Compute)

Thanks!

@abdoey96

Thank you for your report.
It seems that BoneFish was not working because I changed various implementations for the v1 version.
I will fix it so that it works properly in the official v1 release.

However, I am the only developer, so I can’t guarantee when the fixed official version will be available.

Hi @hiron,

Just wanted to ensure the issue was correctly understood. Could we please have a feedback on whether the issue was taken into account?

The point is, if i understand correctly, Bone Fish component kind of works in an async manner: as you can see in video down here, when we try and compute the model, only the Geometric output is returned, even though the compute is not over (you can still see generations being computed in the log)

Not sure if i’m clear at all on all this, please let me know!

Here are two sample files:
tunny_test_00.gh → Original file
tunny_test_01.gh → File with a hack to try and force the whole compute (hack that works with other libraries, such as GeometryGym for example).

I understand you’re alone on the development and can’t guarantee the release date: we’re cool with that, we just wanted to take the advantage of this new version to bring up this topic and make sure it was understandable.

Thanks in advance, cheers,

Quentin

Your detailed feedback is very helpful.
It has deepened my understanding of the issues.
I may ask for more details when I modify the implementation, and I would appreciate your help in doing so.

1 Like

Any time, with great pleasure

1 Like