Skip to content

Handle GPU resource management in ctest #5162

Closed

Description

@GMNGeoffrey

Currently the integration tests running on real GPUs are frequently failing due to running out of GPU memory (https://source.cloud.google.com/results/invocations/5a6a9122-9c10-4a92-a4c5-d8fad601b58a/targets/iree%2Fgcp_ubuntu%2Fcmake-bazel%2Flinux%2Fx86-turing%2Fmain/log):

RuntimeError: Error invoking function: /tmpfs/src/github/iree/iree/hal/vulkan/status_util.c:53: RESOURCE_EXHAUSTED; VK_ERROR_OUT_OF_DEVICE_MEMORY; vmaCreateBuffer; while invoking native function hal.allocator.allocate; while calling import

This is just a case of trying to run too many things that use GPU memory at once (CTEST_PARALLEL_LEVEL=$(nproc)). We should come up with a way to avoid this. https://cmake.org/cmake/help/latest/manual/ctest.1.html#resource-allocation details some really nice robust handling. We could also run large tests at a lower level of parallelism than small tests (and run them in two batches). Related to #5121, which would plumb through timeouts.

For now I'm just going to drop the parallelism level on this build.

Activity

  1. added
    infrastructure
    on Mar 18, 2021
  2. self-assigned this
    on Mar 18, 2021
  3. antiagainst commented on Mar 18, 2021

    @antiagainst
    Member

    Interesting. The log showed that we are failing on ResNet, which is a large model. I'm wondering whether it's also because we are having too many buffer allocations there too and we can probably optimize some away.

  4. GMNGeoffrey commented on Mar 18, 2021

    @GMNGeoffrey
    MemberAuthor

    The specific model failing varies. Entirely possible that we're also using more GPU memory than we should be, but this is probably not the best way to surface that ;-P

  5. antiagainst commented on Mar 18, 2021

    @antiagainst
    Member

    Somewhat related to this: #5152

  6. GMNGeoffrey commented on Mar 18, 2021

    @GMNGeoffrey
    MemberAuthor

    Phoenix also pointed out that there's no reason to be running tests without driver=vulkan in this build, which should greatly reduce the number of tests we need to run

  7. GMNGeoffrey commented on Mar 18, 2021

    @GMNGeoffrey
    MemberAuthor

    165/1414 Test #903: integrations/tensorflow/e2e/keras/applications/large_cifar10_tests__applications__iree_vulkan__model__ResNet50 ............***Failed 57.49 sec

    https://source.cloud.google.com/results/invocations/bb36cd88-2151-4e8a-b25d-22e5ad591eaa/targets/iree%2Fgcp_ubuntu%2Fcmake-bazel%2Flinux%2Fx86-turing%2Fmain/log

    😢

  8. GMNGeoffrey commented on Mar 18, 2021

    @GMNGeoffrey
    MemberAuthor

    But of course ctest doesn't support filtering by the intersection of labels 🙄 Luckily the first label we want to filter on is also in the test's name.

  9. antiagainst commented on Apr 14, 2021

    @antiagainst
    Member

    I feel the underlying issue is the same as #5268, which is fixed now. Can we revert #5163 and try to see if it works? Would be good to close this if everything is okay.

  10. GMNGeoffrey commented on Apr 14, 2021

    @GMNGeoffrey
    MemberAuthor

    Well I ended up going even further with #5166, disabling parallelism entirely. I think we should try rolling that back. Not sure if we still would want to close this, since proper resource management would maybe be nice, but 🤷

  11. GMNGeoffrey commented on Jul 27, 2022

    @GMNGeoffrey
    MemberAuthor

    I'm hitting this again in #9905 where I get timeouts on buffer mapping tests. Dropping the parallelism to 2 makes testing take 4 minutes instead of 3 and gets rid of the timeouts.

  12. moved this from Not Started to Inbox in (Deprecated) IREEon Apr 5, 2023
  13. moved this from Inbox to Backlog in (Deprecated) IREEon Apr 11, 2023
  14. GMNGeoffrey commented on Apr 19, 2023

    @GMNGeoffrey
    MemberAuthor

    Unassigning myself from issues that I'm not actively working on

  15. removed their assignment
    on Apr 19, 2023
  16. ScottTodd commented on Sep 12, 2024

    @ScottTodd
    Member

    We aren't running that many GPU tests using ctest now, and I've started moving heavier tests to https://github.com/iree-org/iree-test-suites, where we have more control over pytest/ctest. I think we can close this issue, but there is good material to reference in here.

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

    infrastructure

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions