allegroai / clearml

ClearML - Auto-Magical CI/CD to streamline your AI workload. Experiment Management, Data Management, Pipeline, Orchestration, Scheduling & Serving in one MLOps/LLMOps solution
https://clear.ml/docs
Apache License 2.0
5.61k stars 651 forks source link

task.connect_configuration does not preserve JSONs #1104

Open SkBlaz opened 1 year ago

SkBlaz commented 1 year ago

Hello ClearML team,

first off, great work with the project, very nice functionality. Writing with a small detail that we observed can cause some time to get around, yet seems directly fixable (if you can point me to the relevant part of the repo can do this myself) - when pushing configs to ClearML via

task.connect_configuration(some_obj)

the some_obj, if str, simply doesn't get pushed. We'd like to have e.g., proper JSONs pushed, however, this is currently not possible (e.g., json.dumps(some_dict)) won't work. It seems at least an optional flag that would enable displaying strings as they are could be beneficial for users. Thanks for checking this/advice on how to proceed. Note that one can overcome this by overloading the description, however this seems like an anti-pattern.

eugen-ajechiloae-clearml commented 1 year ago

Hi @SkBlaz ! You could dump the string to a file or just connect some_dict directly (the SDK will call json.dumps on it eventually).

SkBlaz commented 1 year ago

Are you sure it calls json.dumps? It seems in the interface the resulting structures are not proper JSONs (but some stripped-down form). Thanks for the filedump tip, this will do the trick also!

eugen-ajechiloae-clearml commented 1 year ago

@SkBlaz It actually sometimes calls json.dumps (in some edge cases). Anyways, the form you see is called HOCON, which supersets json.

SkBlaz commented 1 year ago

Ok thanks - this explains it indeed. So the suggested way to go here is to convert hocon to json when the need arises?