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

migrate to cloudpickle from dill #142

Closed efiop closed 5 months ago

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).

Originally posted by @efiop in https://github.com/fal-ai/fal/issues/141#issuecomment-2021752029

linear[bot] commented 5 months ago

FEA-2189 migrate to cloudpickle from dill

efiop commented 5 months ago

For the record: also ran into dilling errors in #143 that required @mainify on some new methods/classes, but this is probably another reason to look into cloudpickle with provides proper mechanisms instead of this crazy __main__ magic that you have to do with dill. (cloudpickle might have itsown problems though, will have to try first...)

isidentical commented 5 months ago

i think cloudpickle fixes #29 as well since it works out of the box with pydantic 2.5