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

[GraphBolt] Improving ondisk_dataset tests. #7052

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

drivanov
Copy link
Contributor

@drivanov drivanov commented Feb 1, 2024

Description

The goal of this PR is to resolve the following 24 warnings that appear when running tests from test_ondisk_dataset.py:

tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py: 24 warnings
  /usr/local/lib/python3.10/dist-packages/dgl/graphbolt/impl/ondisk_dataset.py:260: DGLWarning: Edge feature is stored, but edge IDs are not saved.
    dgl_warning("Edge feature is stored, but edge IDs are not saved.")

To achieve this goal, I created and started using a new local function `_on_disk_dataset(...) which uses the method already used several times in this file:

    with pytest.warns(
        DGLWarning,
        match="Edge feature is stored, but edge IDs are not saved.",
    ):

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • I've leverage the tools to beautify the python and c++ code.
  • The PR is complete and small, read the Google eng practice (CL equals to PR) to understand more about small PR. In DGL, we consider PRs with less than 200 lines of core code change are small (example, test and documentation could be exempted).
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 1, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 1, 2024

Commit ID: 9c70264

Build ID: 1

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 1, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 1, 2024

Commit ID: fa40d8c

Build ID: 2

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 1, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 1, 2024

Commit ID: 5a1c89c

Build ID: 3

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 1, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 1, 2024

Commit ID: e11672d

Build ID: 4

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

Copy link
Collaborator

@Rhett-Ying Rhett-Ying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to explicitly capture warnings directly in the testcase. and check if we really need to enable include_original_edge_id or remove edge feature before adding such capture. We only capture for those where warning is inevitable.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 2, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 2, 2024

Commit ID: 05ae715

Build ID: 5

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@drivanov
Copy link
Contributor Author

drivanov commented Feb 2, 2024

@Rhett-Ying : Sorry, I'm not sure I understand what you're talking about. We already have similar captures of that warning here and here. They are generated only for include_original_edge_id=False. I created a generic function for these two and 24 other cases.

Note that I'm not simply suppressing this warning even though it won't be generated. With the following lines:

    with pytest.warns(
        DGLWarning,
        match="Edge feature is stored, but edge IDs are not saved.",
    ):

the program expects that this warning will be generated, therefore it should be considered as inevitable

Moreover, if the program expects to see, but won't see, this warning for some test, that test will fail with the following error message:

================================================================================= short test summary info =================================================================================
FAILED tests/python/pytorch/graphbolt/impl/test_ondisk_dataset.py::test_OnDiskDataset_preprocess_auto_force_preprocess - Failed: DID NOT WARN. No warnings of type (<class 'dgl.base.DGLWarning'>,) were emitted.

I just got it with the following changes:

        # 4. Change nothing.
        with pytest.warns(
            DGLWarning,
            match="Edge feature is stored, but edge IDs are not saved.",
        ):
            preprocessed_metadata_path = (
                gb.ondisk_dataset.preprocess_ondisk_dataset(
                    test_dir, include_original_edge_id=True
                )
            )

I made to test_OnDiskDataset_preprocess_auto_force_preprocess. As you could see, here include_original_edge_id=True, therefore, this warning should not have been generated, and when it was not captured, this test failed.

@Rhett-Ying
Copy link
Collaborator

@drivanov Sorry for the vagueness. What I mean is if we mean to verify such warning is thrown or inevitable, then directly wrap with with pytest.warns() instead of a wrapper like _ondist_xx() you did. For other testcases that throw warning, we just remove the edge feature or specify include_original_eids=True to eliminate the warnings.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 5, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 5, 2024

Commit ID: fc120724e2bd8d6e672c4899937eb7b4eaffde95

Build ID: 6

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 5, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 5, 2024

Commit ID: c9e93ad40049222c414a017a1dc43501881be2b1

Build ID: 7

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 5, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 5, 2024

Commit ID: 44b3c79

Build ID: 8

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@drivanov
Copy link
Contributor Author

drivanov commented Feb 5, 2024

@Rhett-Ying : I have implemented the changes you suggested.

Copy link
Collaborator

@Rhett-Ying Rhett-Ying left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix test failure running on Windows.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 7, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 7, 2024

Commit ID: 47fdb4a

Build ID: 12

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@Rhett-Ying
Copy link
Collaborator

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 8, 2024

Commit ID: 47fdb4a

Build ID: 13

Status: ❌ CI test failed in Stage [Torch CPU (Win64) Unit test].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 8, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 8, 2024

Commit ID: e518992db3f70e2b4a8129d6f36ce6bb6e75dde3

Build ID: 14

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 8, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 8, 2024

Commit ID: 0283dcc

Build ID: 15

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 8, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 8, 2024

Commit ID: b8fc709

Build ID: 16

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@Rhett-Ying
Copy link
Collaborator

@dgl-bot

@Rhett-Ying
Copy link
Collaborator

this PR could be abandoned if #7110 is merged.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 9, 2024

Commit ID: 7039a66f3d4715de2030d79db5756167944e8f70

Build ID: 17

Status: ❌ CI test failed in Stage [Torch CPU (Win64) Unit test].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 9, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 9, 2024

Commit ID: d945042

Build ID: 18

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 14, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 14, 2024

Commit ID: d6f3462

Build ID: 19

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 21, 2024

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 21, 2024

Commit ID: f0b70c7

Build ID: 20

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

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.

None yet

3 participants