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

Fix MLFlowLogger test #2912

Merged
merged 3 commits into from
Jan 29, 2024
Merged

Fix MLFlowLogger test #2912

merged 3 commits into from
Jan 29, 2024

Conversation

ngcgarcia
Copy link
Contributor

@ngcgarcia ngcgarcia commented Jan 27, 2024

What does this PR do?

test_mlflow_ignore_hyperparameters is flakey--it passed tests on PR submission but later failed:

        # should not see num_cpus_per_node, num_nodes, mlflow_run_id
        expected_params_list = [
            'node_name',
            'rank_zero_seed',
            'composer_version',
            'composer_commit_hash',
            'mlflow_experiment_id',
        ]
>       assert set(expected_params_list) == set(actual_params_list)
E       AssertionError: assert {'composer_co...nk_zero_seed'} == {'composer_version'}
E         Extra items in the left set:
E         'node_name'
E         'composer_commit_hash'
E         'mlflow_experiment_id'
E         'rank_zero_seed'
E         Full diff:
E           {
E         +  'composer_commit_hash',
E            'composer_version',
E         +  'mlflow_experiment_id',
E         +  'node_name',
E         +  'rank_zero_seed',
E           }

This test was copied almost directly from test_mlflow_logging_works with a few commands removed because they were thought to be unnecessary (and some changes made for ignoring some hyperparameters).

The suspected culprit is the removal of the sleep. This small pause gave time for async logging to finish, and this test would nondeterministically fail because we didn't let it finish up logging (missing parameters that should be there).

What issue(s) does this change relate to?

Before submitting

  • Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

@ngcgarcia ngcgarcia marked this pull request as ready for review January 29, 2024 17:42
@ngcgarcia ngcgarcia requested a review from dakinggg January 29, 2024 18:05
@dakinggg dakinggg enabled auto-merge (squash) January 29, 2024 18:21
@dakinggg dakinggg merged commit dc01ac5 into dev Jan 29, 2024
17 checks passed
@dakinggg dakinggg deleted the nicholas/fix-logger-test branch January 29, 2024 19:08
ShashankMosaicML pushed a commit to ShashankMosaicML/composer that referenced this pull request Feb 3, 2024
Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.com>
ShashankMosaicML pushed a commit to ShashankMosaicML/composer that referenced this pull request Feb 3, 2024
Co-authored-by: Daniel King <43149077+dakinggg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants