Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase MlflowLogger parameter value length limit #19972

Open
jhjo432 opened this issue Jun 13, 2024 · 0 comments
Open

Increase MlflowLogger parameter value length limit #19972

jhjo432 opened this issue Jun 13, 2024 · 0 comments
Labels
feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers

Comments

@jhjo432
Copy link

jhjo432 commented Jun 13, 2024

Description & Motivation

Currently, MlflowLogger parameter value length is limited to 250 (#5893) which is too low for class names, data augmentations or others.
Recent MLflow support up to 6000 (mlflow/mlflow#9709).

Pitch

MLflow use mlflow.utils.validation.MAX_PARAM_VAL_LENGTH to validate parameter value length.
mlflow.utils.validation.MAX_PARAM_VAL_LENGTH exist in mlflow >= 1.0
I believe we can use it to reliably truncate parameter value without checking MLflow version.

class MLFlowLogger(Logger):
    @rank_zero_only
    def log_hyperparams(self, params: Union[Dict[str, Any], Namespace]) -> None:  # type: ignore[override]
        ...
        from mlflow.utils.validation import MAX_PARAM_VAL_LENGTH
        # Truncate parameter values to MAX_PARAM_VAL_LENGTH characters.
        params_list = [Param(key=k, value=str(v)[:MAX_PARAM_VAL_LENGTH]) for k, v in params.items()]
        ...

Alternatives

No response

Additional context

No response

cc @Borda

@jhjo432 jhjo432 added feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers labels Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement needs triage Waiting to be triaged by maintainers
Projects
None yet
Development

No branches or pull requests

1 participant