Skip to content

[config] no param naming validation #653

Closed

Description

@stas00

I have noticed that one could make a typo in the config file and DeepSpeed silently ignores it. e.g. I did:

    "gradient_clipp1ng": 1

and got no errors.

Not sure if it should validate the value as well, as float is expected, but I guess int is fine as it's just converted to float.

This lack of validation could lead to user errors which could be hard to notice.

Nothing urgent, but at some point it'd be good to tell the user if they added a config entry which is invalid.

Thank you.

Activity

  1. tjruwase commented on Jan 13, 2021

    @tjruwase
    Contributor

    @stas00 Apologies for the radio silence and for stalling your progress.

    Your point is well made regarding silent errors from typos in the config file. In the past, users have actually exploited this lack of validation as a way to convenient disable features without deleting the entries. So perhaps a reasonable solution would be to introduce yet another config option to validate the config entries and issue a warning for each unrecognized entry. What do you think?

  2. stas00 commented on Jan 13, 2021

    @stas00
    CollaboratorAuthor

    Oh, no problem, I'm sure you guys need some breaks too!

    Your suggestion to make the validation optional would work great, @tjruwase. This is a very low priority feature request.

    Since you mentioned that the lack of validation is exploited to make users' life easier, I'm also thinking that json isn't a user-friendly format for configuration, because it has a ton of problems, e.g.:

    • don't put comma there, but must put it here,
    • can't use comments, specifically to comment something out while experimenting - must delete instead and deal with commas again
    • can't use python 5_000_000_000 numbers - who can read 5000000000 - I switched to using 5e8 for ZeRO buffers in our examples.

    json, IMHO, is more of an inter-program format, rather than designed for human manipulation.

    It'd have been much better to use some other, more user-friendly format, IMHO. But it has been a while since I had to deal with config files so I'm not sure what's the standard these days.

  3. tjruwase commented on Jan 13, 2021

    @tjruwase
    Contributor

    Completely agree with the pain of json, so we are very open to any suggestions.

  4. jeffra commented on Jan 13, 2021

    @jeffra
    Collaborator

    Thanks @stas00, JSON validation I think is on our radar and definitely something we should add in the short term. Also agree JSON isn't the most user-friendly of formats. We'll have to look into alternatives. I have heard good things about hjson. It allows commas/comments but I don't think supports numbers in the way you describe unfortunately. YAML might also be a reasonable option but also comes with difficulties haha

    It appears YAML supports numbers like 5_000_000_000 and comments. We'll have to look into this further.

  5. stas00 commented on Jan 13, 2021

    @stas00
    CollaboratorAuthor

    I was going to suggest YAML, but I thought that something better must have been invented since then. YAML is from around 2001 if I remember correctly.

    I have never used https://hjson.github.io/, but it does look like the most straightforward solution as it was created to overcome limitations of json for human use. May be that's all is needed.

    I don't know how your user/developer community works, perhaps throwing the net wider would give practical feedback from users who may have used hjson already and can tell how good it is in practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions