fal-ai / fal

⚡ Fastest way to serve open source ML models to millions
https://fal.ai/docs
Apache License 2.0
509 stars 44 forks source link

support chained exceptions #141

Closed efiop closed 5 months ago

efiop commented 5 months ago

Having support for chained exceptions would be great for internal and external users.

The way we currently handle user exceptions is we save the exc object (without __cause__ or __traceback__), a was_it_raised flag and a stringified traceback (this is mostly happening in isolate).

We should be able to just sprinkle tblib's tb/exc pickle/unpickle onto dill and that should get us all we want. This should also make stringisized_traceback field in isolate redundant from what I can tell, but need to check.

Pre-requisite for https://github.com/fal-ai/fal/issues/140

linear[bot] commented 5 months ago

FEA-2188 support chained exceptions

efiop commented 5 months ago

Also this makes a topic of migrating to cloudpickle (which I saw was discussed in the past in some places) relevant again, as it is nice to be able to dump our in-fal things (e.g. exceptions, so that we don't have to deploy our library version to the worker) by value but load things back by reference (so things like isinstance work). Patching out dill to handle that would rpobably not work as we'll need that serverside as well (e.g. won't be able to use new fal client with older server).