ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
34.23k stars 5.81k forks source link

[Util] Better tracing for serializability errors #48759

Open Oblynx opened 2 weeks ago

Oblynx commented 2 weeks ago

Description

In inspect_serializability, when reporting that something isn't serializable, we could in some cases give more info as to the location of the offending object. For example, in _inspect_func_serialization, we could add a log line like this:

f"In {parent.__name__}:{base_obj}:"

This would help a lot in localizing the issues.

Use case

I'm trying to effectively use already existing code as .map steps in Ray Data. The already existing code is likely to be non-serializable.

Superskyyy commented 1 week ago

Failures: {FailTuple(lock [obj=<unlocked _thread.lock object at 0x7fa1b4f8fa00>, parent=<function test at 0x7fa1b4f88c20>])} It does already output such info, is there anyting missing?