Skip to content

Vulkan/SPIR-V test failures on physical GPU #2022

Closed

Description

@stellaraccident
[ctest] 	102 - iree/test/e2e/xla_ops:check_vulkan-spirv_vulkan_compare.mlir (Failed)
[ctest] 	103 - iree/test/e2e/xla_ops:check_vulkan-spirv_vulkan_convert.mlir (Failed)
[ctest] 	112 - iree/test/e2e/xla_ops:check_vulkan-spirv_vulkan_maximum.mlir (Failed)
[ctest] 	113 - iree/test/e2e/xla_ops:check_vulkan-spirv_vulkan_minimum.mlir (Failed)

Configurations tested:

vulkaninfo

GPU0:
VkPhysicalDeviceProperties:
---------------------------
        apiVersion     = 4198519 (1.1.119)
        driverVersion  = 1854193664 (0x6e84c000)
        vendorID       = 0x10de
        deviceID       = 0x1e07
        deviceType     = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
        deviceName     = GeForce RTX 2080 Ti
GPU1:
VkPhysicalDeviceProperties:
---------------------------
        apiVersion     = 4202629 (1.2.133)
        driverVersion  = 8388745 (0x800089)
        vendorID       = 0x1002
        deviceID       = 0x66af
        deviceType     = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
        deviceName     = AMD Radeon VII

Activity

  1. stellaraccident commented on May 27, 2020

    @stellaraccident
    CollaboratorAuthor

    compare.mlir: Seems to be failing on all scalar compares. Passes on tensor compares.
    convert.mlir: No discernible pattern
    maximum/minimum.mlir: Fails on <32bit

  2. stellaraccident commented on May 27, 2020

    @stellaraccident
    CollaboratorAuthor

    Note that these were the only Vulkan specific failures that I saw (most tests pass).

  3. benvanik commented on May 27, 2020

    @benvanik
    Collaborator

    (as a note, these also fail for me - I think they'll fail on any device besides swiftshader)

  4. stellaraccident commented on May 27, 2020

    @stellaraccident
    CollaboratorAuthor

    I figured - just wanted to document since we basically only have ad-hoc testing for this stuff now.

  5. benvanik commented on May 27, 2020

    @benvanik
    Collaborator

    for sure --- it's nice that you have both cards in the same computer, that's able to really cut down on the "hey can you try this on your computer" latency :)

  6. antiagainst commented on May 27, 2020

    @antiagainst
    Member

    Yup. I can repro these issues on P1000. Hanhan previously reported them as #1995, #1996, etc. compare.mlir should be working given #1259 is fixed. But yes this is a moving target and things will keep silently going wrong until we've real GPUs hooked up in testing.

    Hanhan would you mind to look into these failures too?

  7. stellaraccident commented on May 27, 2020

    @stellaraccident
    CollaboratorAuthor

    it's nice that you have both cards in the same computer

    It was nicer when the weather was colder :)

  8. hanhanW commented on May 27, 2020

    @hanhanW
    Contributor

    Sure, let me take a look on P1000 first. (just saw the bug, my notifier for Github was broken...)

  9. hanhanW commented on May 27, 2020

    @hanhanW
    Contributor

    Weird...I can't reproduce on my machine.

    git pull
    git submodule update --init
    cmake to config/build iree
    cmake --build build/ --target vk_layer_khronos_timeline_semaphore
    export VK_LAYER_PATH=$PWD/build/third_party/vulkan_extensionlayer/layers/:$VK_LAYER_PATH
    cd build
    ctest -V -R iree/test/e2e/xla_ops:check_vulkan-spirv_vulkan_compare.mlir
    

    And I got passed on the test.

    102: I ../iree/tools/vm_util.cc:305] Creating driver and device for 'vulkan'...
    102: I ../iree/hal/vulkan/vulkan_driver.cc:295] Created Vulkan Device: Quadro P1000
    ...
    102: [----------] Global test environment tear-down
    102: [==========] 15 tests from 1 test suite ran. (153 ms total)
    102: [  PASSED  ] 15 tests.
    
  10. antiagainst commented on May 27, 2020

    @antiagainst
    Member

    Ouch. Don't tell me this is loader/driver version issue again. I'm at 1.1.126 for P1000 and 1.2.135 for loader. I see Stella is at 1.1.119 for NVIDIA driver. Could you paste yours @hanhanW so we can compare?

  11. hanhanW commented on May 28, 2020

    @hanhanW
    Contributor

    $ vulkaninfo

    GPU0:
    VkPhysicalDeviceProperties:
    ---------------------------
            apiVersion     = 4198499 (1.1.99)
            driverVersion  = 1804369920 (0x6b8c8000)
            vendorID       = 0x10de
            deviceID       = 0x1cb1
            deviceType     = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
            deviceName     = Quadro P1000
    

    I think I'm at 1.1.99 for driver. Where can I get the version for loader?

  12. antiagainst commented on May 28, 2020

    @antiagainst
    Member

    You can get it at the beginning of vulkaninfo's dump. There is a "Vulkan Instance Version" line.

  13. hanhanW commented on May 28, 2020

    @hanhanW
    Contributor

    Thanks! It's Vulkan Instance Version: 1.2.126.

  14. antiagainst commented on May 28, 2020

    @antiagainst
    Member

    Okay, all the numbers are different. This is gonna be a fun one. Hanhan, please focus on some other important tasks and don't spend too much time on this one now. I'll poke around later.

  15. antiagainst commented on Jun 8, 2020

    @antiagainst
    Member

    Okay, I think the reason behind these test failures is that we have out-of-bounds buffer access. For example, for compare_scalar:

    https://github.com/google/iree/blob/778230076df35c1acbd2745be8366836ac0a69a4/iree/test/e2e/xla_ops/compare.mlir#L12-L21

    We are using four buffers here; each iree.unfoldable_constant is initializing one of them. Two of these buffers are 1-byte. But on the CodeGen side, because we don't declare StorageBuffer8BitAccess, we are emulating them as 32-bit buffers. We read the element as 32-bit value and then do a bunch of bit manupilation operations to get the 8-bit value. That's where it becomes problematic. Per the Vulkan spec:

    If a SPIR-V OpLoad instruction loads a structure and the tail end of the structure is out of bounds, then all members of the structure are considered out of bounds even if the members at the end are not statically used.

    If robustBufferAccess is not enabled, applications must not perform out of bounds accesses.

    We just have 1-byte here. So the initial read is out of bounds.

    In general such round-tripping such small buffers is not good for GPU. But it might be okay for other accerators like CPU. Putting that aside, if we want to still support this, I think like bool buffers, we need an ABI pre-pass to widen these small buffers. This pass might be specific to GPU.

    Problem aside, I think the reason that Hanhan cannot repro these failures on an earlier driver version is that VK_EXT_robustness2 is published earlier this year. That makes the out-of-bounds access more clear.

  16. benvanik commented on Jun 16, 2020

    @benvanik
    Collaborator

    Had to disable the while op test on vulkan (enabled after d61c548) because it fails on real hardware.

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

Metadata

Metadata

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