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

[vulkan][spirv] reverse tests fail on newer Android builds on Pixel 6 #12415

Open
kuhar opened this issue Feb 28, 2023 · 5 comments · Fixed by #17843
Open

[vulkan][spirv] reverse tests fail on newer Android builds on Pixel 6 #12415

kuhar opened this issue Feb 28, 2023 · 5 comments · Fixed by #17843
Assignees
Labels
bug 🐞 Something isn't working codegen/spirv SPIR-V code generation compiler backend platform/android 🤖 Android-specific build, execution, benchmarking, and deployment

Comments

@kuhar
Copy link
Member

kuhar commented Feb 28, 2023

What happened?

The two reverse tests fail on Pixel 6 with newer Android builds. I first observed this on a build from ~July 2022 and confirmed this today on the newest build 230205.002.

These work fine on older builds used by the Pixel 6 Pro in the lab.

1/570 Test  #20: iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir_on_android_device .....................................***Failed    1.81 sec
+ set -e
++ basename /usr/local/google/home/kubak/iree/android-relass/tools/iree-check-module
+ adb push /usr/local/google/home/kubak/iree/android-relass/tools/iree-check-module /data/local/tmp/iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir/iree-check-module
/usr/local/google/home/kubak/iree/android-relass/tools/iree-check-module: 1 file pushed, 0 skipped. 316.9 MB/s (9486560 bytes in 0.029s)
+ '[' -n check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb ']'
+ for datafile in $TEST_DATA
++ basename check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb
+ adb push check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb /data/local/tmp/iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir/check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb
check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb: 1 file pushed, 0 skipped. 133.1 MB/s (16472 bytes in 0.000s)
+ '[' -n /data/local/tmp/iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir/test_tmpdir ']'
+ adb shell 'mkdir -p /data/local/tmp/iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir/test_tmpdir'
+ tmpdir=TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir/test_tmpdir
+ adb shell 'cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir/test_tmpdir /data/local/tmp/iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir/iree-check-module /data/local/tmp/iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir/check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb --device=vulkan'
[==========] Running 3 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 3 tests from module
[ RUN      ] module.reverse_dim0
iree/runtime/src/iree/modules/check/module.cc:351: Failure
Failed
Expected near equality of these values. Contents does not match.
  lhs:
    2x3xf32=[1 2 3][1 2 3]
  rhs:
    2x3xf32=[4 5 6][1 2 3]
[  FAILED  ] module.reverse_dim0, where GetParam() = 0 (70 ms)
[ RUN      ] module.reverse_dim1
iree/runtime/src/iree/hal/drivers/vulkan/direct_command_queue.cc:115: INTERNAL; VK_ERROR_DEVICE_LOST; while invoking native function hal.device.queue.execute; while calling import; 
[ 1]   native hal.device.queue.execute:0 -
[ 0] bytecode module.__init:782 [
    /usr/local/google/home/kubak/iree/iree/tests/e2e/linalg_ext_ops/reverse.mlir:11:3,
    /usr/local/google/home/kubak/iree/iree/tests/e2e/linalg_ext_ops/reverse.mlir:2:12,
    /usr/local/google/home/kubak/iree/iree/tests/e2e/linalg_ext_ops/reverse.mlir:29:3,
    /usr/local/google/home/kubak/iree/iree/tests/e2e/linalg_ext_ops/reverse.mlir:38:12,
    /usr/local/google/home/kubak/iree/iree/tests/e2e/linalg_ext_ops/reverse.mlir:20:12,
    /usr/local/google/home/kubak/iree/iree/tests/e2e/linalg_ext_ops/reverse.mlir:47:3
  ]
Aborted
211/571 Test #433: iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir_on_android_device ............................................***Failed    1.17 sec
+ set -e                                                                                                                                                             
++ basename /usr/local/google/home/kubak/iree/android-relass/tools/iree-check-module                                                                                
+ adb push /usr/local/google/home/kubak/iree/android-relass/tools/iree-check-module /data/local/tmp/iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir/ire
e-check-module                                                                                                                                                       
/usr/local/google/home/kubak/iree/android-relass/tools/iree-check-module: 1 file pushed, 0 skipped. 300.9 MB/s (9486560 bytes in 0.030s)                            
+ '[' -n check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb ']'                                                                                                      
+ for datafile in $TEST_DATA                                                                                                                                         
++ basename check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb                                                                                                       
+ adb push check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb /data/local/tmp/iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir/check_vulkan-spirv_vulkan
_reverse.mlir_module.vmfb                                                                                                                                            
check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb: 1 file pushed, 0 skipped. 148.5 MB/s (14051 bytes in 0.000s)                                                    
+ '[' -n /data/local/tmp/iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir/test_tmpdir ']'                                                              
+ adb shell 'mkdir -p /data/local/tmp/iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir/test_tmpdir'                                                    
+ tmpdir=TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir/test_tmpdir                                                       
+ adb shell 'cd /data/local/tmp && LD_LIBRARY_PATH=/data/local/tmp TEST_TMPDIR=/data/local/tmp/iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir/test_tmp
dir /data/local/tmp/iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir/iree-check-module /data/local/tmp/iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_
reverse.mlir/check_vulkan-spirv_vulkan_reverse.mlir_module.vmfb --device=vulkan'                                                                                     
[==========] Running 1 test from 1 test suite.                                                                                                                       
[----------] Global test environment set-up.                                                                                                                         
[----------] 1 test from module                                                                                                                                      
[ RUN      ] module.xla_reverse                                                                                                                                      
iree/runtime/src/iree/modules/check/module.cc:351: Failure                                                                                                           
Failed                                                                                                                                                               
Expected near equality of these values. Contents does not match.                                                                                                     
  lhs:                                                                                                                                                               
    2x3xf32=[0 0 0][1 2 3]                                                                                                                                           
  rhs:                                                                                                                                                               
    2x3xf32=[4 5 6][1 2 3]                                                                                                                                           
iree/tools/iree-check-module-main.cc:68: Failure                                                                                                                     
Value of: iree_vm_invoke(context_, function_, IREE_VM_INVOCATION_FLAG_NONE, nullptr, nullptr, nullptr, iree_vm_instance_allocator(instance_))                       
Expected: error code OK                                                                                                                                              
  Actual: 0xb40000791f2f294d, whose error code is INTERNAL: iree/runtime/src/iree/hal/drivers/vulkan/direct_command_queue.cc:115: INTERNAL; VK_ERROR_DEVICE_LOST; whi
le invoking native function hal.device.queue.execute; while calling import;                                                                                          
[ 1]   native hal.device.queue.execute:0 -                                                                                                                           
[ 0] bytecode module.xla_reverse:1196 /usr/local/google/home/kubak/iree/iree/tests/e2e/xla_ops/reverse.mlir:14:11                                                    
      at /usr/local/google/home/kubak/iree/iree/tests/e2e/xla_ops/reverse.mlir:5:1                                                                                  
[  FAILED  ] module.xla_reverse, where GetParam() = 0 (18 ms)                                                                                                        
[----------] 1 test from module (18 ms total)                                                                                                                        
                                                                                                                                                                     
[----------] Global test environment tear-down                                                                                                                       
[==========] 1 test from 1 test suite ran. (18 ms total)                                                                                                             
[  PASSED  ] 0 tests.                                                                                                                                                
[  FAILED  ] 1 test, listed below:                                                                                                                                   
[  FAILED  ] module.xla_reverse, where GetParam() = 0                                                                                                                
                                                                                                                                                                     
 1 FAILED TEST                                                                                                                                                       
Test failed 

Steps to reproduce your issue

  1. Flash Pixel 6 with Android 13 build TQ1A.230205.002
  2. Run all tests on the phone.
  3. Observe 2 test failures:
         20 - iree/tests/e2e/linalg_ext_ops/check_vulkan-spirv_vulkan_reverse.mlir_on_android_device (Failed)
         433 - iree/tests/e2e/xla_ops/check_vulkan-spirv_vulkan_reverse.mlir_on_android_device (Failed)
    

What component(s) does this issue relate to?

Compiler

Version information

No response

Additional context

No response

@kuhar kuhar added bug 🐞 Something isn't working platform/android 🤖 Android-specific build, execution, benchmarking, and deployment codegen/spirv SPIR-V code generation compiler backend awaiting-triage labels Feb 28, 2023
@kuhar kuhar self-assigned this Feb 28, 2023
@github-project-automation github-project-automation bot moved this to Not Started in (Deprecated) IREE Feb 28, 2023
kuhar added a commit to kuhar/iree that referenced this issue Feb 28, 2023
We currently do not have a better mechanism to disable this only on
affected Vulkan targets.

This is so that we can update our Pixel phones and use new Vulkan
extensions.

Issue: iree-org#12415
kuhar added a commit that referenced this issue Feb 28, 2023
We currently do not have a better mechanism to disable this only on
affected Vulkan targets.

This is so that we can update our Pixel phones and use new Vulkan
extensions.

Issue: #12415
@kuhar
Copy link
Member Author

kuhar commented Mar 3, 2023

Minimized testcase:

func.func @reverse_dim0() {
  %input = util.unfoldable_constant dense<[[1.0, 2.0, 3.0],
                                           [4.0, 5.0, 6.0]]> : tensor<2x3xf32>

  %init = tensor.empty() : tensor<2x3xf32>
  %0 = iree_linalg_ext.reverse
         dimensions(dense<0> : tensor<1xi64>)
         ins(%input : tensor<2x3xf32>)
         outs(%init : tensor<2x3xf32>) : tensor<2x3xf32>

  check.expect_almost_eq_const(
      %0,
      dense<[[4.0, 5.0, 6.0], [1.0, 2.0, 3.0]]> : tensor<2x3xf32>
  ) : tensor<2x3xf32>

  return
}

SPIR-V:

; SPIR-V
; Version: 1.0
; Generator: Khronos; 22
; Bound: 70
; Schema: 0
               OpCapability Shader                                                                                                                          [1/32498]
               OpExtension "SPV_KHR_storage_buffer_storage_class"
               OpMemoryModel Logical GLSL450
               OpEntryPoint GLCompute %_reverse_dim0_dispatch_0 "_reverse_dim0_dispatch_0" %__builtin_var_WorkgroupId__ %__builtin_var_NumWorkgroups__ %__builtin_var
_LocalInvocationId__
               OpExecutionMode %_reverse_dim0_dispatch_0 LocalSize 64 1 1
               OpName %__builtin_var_LocalInvocationId__ "__builtin_var_LocalInvocationId__"
               OpName %__builtin_var_NumWorkgroups__ "__builtin_var_NumWorkgroups__"
               OpName %__builtin_var_WorkgroupId__ "__builtin_var_WorkgroupId__"
               OpName %__resource_var_0_0_ "__resource_var_0_0_"
               OpName %__resource_var_0_1_ "__resource_var_0_1_"
               OpName %_reverse_dim0_dispatch_0 "_reverse_dim0_dispatch_0"
               OpDecorate %__builtin_var_LocalInvocationId__ BuiltIn LocalInvocationId
               OpDecorate %__builtin_var_NumWorkgroups__ BuiltIn NumWorkgroups
               OpDecorate %__builtin_var_WorkgroupId__ BuiltIn WorkgroupId
               OpDecorate %_runtimearr_float ArrayStride 4
               OpMemberDecorate %_struct_8 0 Offset 0
               OpDecorate %_struct_8 Block
               OpDecorate %__resource_var_0_0_ Binding 0
               OpDecorate %__resource_var_0_0_ DescriptorSet 0
               OpDecorate %__resource_var_0_1_ Binding 1
               OpDecorate %__resource_var_0_1_ DescriptorSet 0
       %uint = OpTypeInt 32 0
     %v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%__builtin_var_LocalInvocationId__ = OpVariable %_ptr_Input_v3uint Input
%__builtin_var_NumWorkgroups__ = OpVariable %_ptr_Input_v3uint Input
%__builtin_var_WorkgroupId__ = OpVariable %_ptr_Input_v3uint Input
      %float = OpTypeFloat 32
%_runtimearr_float = OpTypeRuntimeArray %float
  %_struct_8 = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer__struct_8 = OpTypePointer StorageBuffer %_struct_8
%__resource_var_0_0_ = OpVariable %_ptr_StorageBuffer__struct_8 StorageBuffer
%__resource_var_0_1_ = OpVariable %_ptr_StorageBuffer__struct_8 StorageBuffer
       %void = OpTypeVoid
         %13 = OpTypeFunction %void
%uint_4294967293 = OpConstant %uint 4294967293
    %uint_64 = OpConstant %uint 64
     %uint_3 = OpConstant %uint 3
     %uint_2 = OpConstant %uint 2
     %uint_0 = OpConstant %uint 0
       %bool = OpTypeBool
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%_reverse_dim0_dispatch_0 = OpFunction %void None %13
         %16 = OpLabel
         %22 = OpLoad %v3uint %__builtin_var_WorkgroupId__
         %23 = OpCompositeExtract %uint %22 0
         %24 = OpLoad %v3uint %__builtin_var_NumWorkgroups__
         %25 = OpCompositeExtract %uint %24 0
         %26 = OpLoad %v3uint %__builtin_var_WorkgroupId__
         %27 = OpCompositeExtract %uint %26 1
         %28 = OpLoad %v3uint %__builtin_var_NumWorkgroups__
         %29 = OpCompositeExtract %uint %28 1
         %30 = OpIMul %uint %23 %uint_64
         %31 = OpIMul %uint %25 %uint_64
         %32 = OpLoad %v3uint %__builtin_var_LocalInvocationId__
         %33 = OpCompositeExtract %uint %32 0
         %34 = OpLoad %v3uint %__builtin_var_LocalInvocationId__
         %35 = OpCompositeExtract %uint %34 1
               OpBranch %36
         %36 = OpLabel
         %39 = OpPhi %uint %69 %40 %27 %16
         %42 = OpSLessThan %bool %39 %uint_2
               OpLoopMerge %38 %37 None
               OpBranchConditional %42 %37 %38
         %37 = OpLabel
               OpBranch %43
         %43 = OpLabel
         %45 = OpPhi %uint %68 %46 %30 %37
         %47 = OpSLessThan %bool %45 %uint_3
               OpLoopMerge %40 %44 None
               OpBranchConditional %47 %44 %40
         %44 = OpLabel
               OpBranch %48
         %48 = OpLabel
         %50 = OpPhi %uint %67 %49 %33 %44
         %51 = OpSLessThan %bool %50 %uint_3
               OpLoopMerge %46 %49 None
               OpBranchConditional %51 %49 %46
         %49 = OpLabel
         %52 = OpIMul %uint %39 %uint_3
         %53 = OpIAdd %uint %50 %52
         %54 = OpIMul %uint %35 %uint_3
         %55 = OpIAdd %uint %53 %54
         %56 = OpIAdd %uint %55 %45
         %58 = OpAccessChain %_ptr_StorageBuffer_float %__resource_var_0_0_ %uint_0 %56
         %59 = OpLoad %float %58
         %60 = OpIMul %uint %35 %uint_4294967293
         %61 = OpIAdd %uint %50 %60
         %62 = OpIMul %uint %39 %uint_4294967293
         %63 = OpIAdd %uint %61 %62
         %64 = OpIAdd %uint %63 %45
         %65 = OpIAdd %uint %64 %uint_3
         %66 = OpAccessChain %_ptr_StorageBuffer_float %__resource_var_0_1_ %uint_0 %65
               OpStore %66 %59
         %67 = OpIAdd %uint %50 %uint_64
               OpBranch %48
         %46 = OpLabel
         %68 = OpIAdd %uint %45 %31
               OpBranch %43
         %40 = OpLabel
         %69 = OpIAdd %uint %39 %29
               OpBranch %36
         %38 = OpLabel
               OpReturn
               OpFunctionEnd

GLSL from spirv-cross (just for convenience):

#version 450
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;

layout(set = 0, binding = 0, std430) buffer _resource_var_0_0_
{
    float _m0[];
} _resource_var_0_0_1;

layout(set = 0, binding = 1, std430) buffer _resource_var_0_1_
{
    float _m0[];
} _resource_var_0_1_1;

void main()
{
    uint _30 = gl_WorkGroupID.x * 64u;
    uint _31 = gl_NumWorkGroups.x * 64u;
    uint _39;
    _39 = gl_WorkGroupID.y;
    uint _45;
    for (;;)
    {
        if (int(_39) < int(2u))
        {
            _45 = _30;
            uint _50;
            for (;;)
            {
                if (int(_45) < int(3u))
                {
                    _50 = gl_LocalInvocationID.x;
                    for (; int(_50) < int(3u); )
                    {
                        _resource_var_0_1_1._m0[(((_50 + (gl_LocalInvocationID.y * 4294967293u)) + (_39 * 4294967293u)) + _45) + 3u] = _resource_var_0_0_1._m0[((_50 + (_39 * 3u)) + (gl_LocalInvocationID.y * 3u)) + _45];
                        _50 += 64u;
                        continue;
                    }
                    _45 += _31;
                    continue;
                }
                else
                {
                    break;
                }
            }
            _39 += gl_NumWorkGroups.y;
            continue;
        }
        else
        {
            break;
        }
    }
}

@kuhar
Copy link
Member Author

kuhar commented Mar 3, 2023

Repro as an Amber script:

./amber reverse.amber -d -t vulkan1.1spv1.3
#!amber

DEVICE_EXTENSION VK_KHR_storage_buffer_storage_class

SHADER compute repro SPIRV-ASM
               OpCapability Shader
               OpExtension "SPV_KHR_storage_buffer_storage_class"
               OpMemoryModel Logical GLSL450
               OpEntryPoint GLCompute %_reverse_dim0_dispatch_0 "_reverse_dim0_dispatch_0" %__builtin_var_WorkgroupId__ %__builtin_var_NumWorkgroups__ %__builtin_var_LocalInvocationId__
               OpExecutionMode %_reverse_dim0_dispatch_0 LocalSize 64 1 1
               OpName %__builtin_var_LocalInvocationId__ "__builtin_var_LocalInvocationId__"
               OpName %__builtin_var_NumWorkgroups__ "__builtin_var_NumWorkgroups__"
               OpName %__builtin_var_WorkgroupId__ "__builtin_var_WorkgroupId__"
               OpName %__resource_var_0_0_ "__resource_var_0_0_"
               OpName %__resource_var_0_1_ "__resource_var_0_1_"
               OpName %_reverse_dim0_dispatch_0 "_reverse_dim0_dispatch_0"
               OpDecorate %__builtin_var_LocalInvocationId__ BuiltIn LocalInvocationId
               OpDecorate %__builtin_var_NumWorkgroups__ BuiltIn NumWorkgroups
               OpDecorate %__builtin_var_WorkgroupId__ BuiltIn WorkgroupId
               OpDecorate %_runtimearr_float ArrayStride 4
               OpMemberDecorate %_struct_8 0 Offset 0
               OpDecorate %_struct_8 Block
               OpDecorate %__resource_var_0_0_ Binding 0
               OpDecorate %__resource_var_0_0_ DescriptorSet 0
               OpDecorate %__resource_var_0_1_ Binding 1
               OpDecorate %__resource_var_0_1_ DescriptorSet 0
       %uint = OpTypeInt 32 0
     %v3uint = OpTypeVector %uint 3
%_ptr_Input_v3uint = OpTypePointer Input %v3uint
%__builtin_var_LocalInvocationId__ = OpVariable %_ptr_Input_v3uint Input
%__builtin_var_NumWorkgroups__ = OpVariable %_ptr_Input_v3uint Input
%__builtin_var_WorkgroupId__ = OpVariable %_ptr_Input_v3uint Input
      %float = OpTypeFloat 32
%_runtimearr_float = OpTypeRuntimeArray %float
  %_struct_8 = OpTypeStruct %_runtimearr_float
%_ptr_StorageBuffer__struct_8 = OpTypePointer StorageBuffer %_struct_8
%__resource_var_0_0_ = OpVariable %_ptr_StorageBuffer__struct_8 StorageBuffer
%__resource_var_0_1_ = OpVariable %_ptr_StorageBuffer__struct_8 StorageBuffer
       %void = OpTypeVoid
         %13 = OpTypeFunction %void
%uint_4294967293 = OpConstant %uint 4294967293
    %uint_64 = OpConstant %uint 64
     %uint_3 = OpConstant %uint 3
     %uint_2 = OpConstant %uint 2
     %uint_0 = OpConstant %uint 0
       %bool = OpTypeBool
%_ptr_StorageBuffer_float = OpTypePointer StorageBuffer %float
%_reverse_dim0_dispatch_0 = OpFunction %void None %13
         %16 = OpLabel
         %22 = OpLoad %v3uint %__builtin_var_WorkgroupId__
         %23 = OpCompositeExtract %uint %22 0
         %24 = OpLoad %v3uint %__builtin_var_NumWorkgroups__
         %25 = OpCompositeExtract %uint %24 0
         %26 = OpLoad %v3uint %__builtin_var_WorkgroupId__
         %27 = OpCompositeExtract %uint %26 1
         %28 = OpLoad %v3uint %__builtin_var_NumWorkgroups__
         %29 = OpCompositeExtract %uint %28 1
         %30 = OpIMul %uint %23 %uint_64
         %31 = OpIMul %uint %25 %uint_64
         %32 = OpLoad %v3uint %__builtin_var_LocalInvocationId__
         %33 = OpCompositeExtract %uint %32 0
         %34 = OpLoad %v3uint %__builtin_var_LocalInvocationId__
         %35 = OpCompositeExtract %uint %34 1
               OpBranch %36
         %36 = OpLabel
         %39 = OpPhi %uint %69 %40 %27 %16
         %42 = OpSLessThan %bool %39 %uint_2
               OpLoopMerge %38 %37 None
               OpBranchConditional %42 %37 %38
         %37 = OpLabel
               OpBranch %43
         %43 = OpLabel
         %45 = OpPhi %uint %68 %46 %30 %37
         %47 = OpSLessThan %bool %45 %uint_3
               OpLoopMerge %40 %44 None
               OpBranchConditional %47 %44 %40
         %44 = OpLabel
               OpBranch %48
         %48 = OpLabel
         %50 = OpPhi %uint %67 %49 %33 %44
         %51 = OpSLessThan %bool %50 %uint_3
               OpLoopMerge %46 %49 None
               OpBranchConditional %51 %49 %46
         %49 = OpLabel
         %52 = OpIMul %uint %39 %uint_3
         %53 = OpIAdd %uint %50 %52
         %54 = OpIMul %uint %35 %uint_3
         %55 = OpIAdd %uint %53 %54
         %56 = OpIAdd %uint %55 %45
         %58 = OpAccessChain %_ptr_StorageBuffer_float %__resource_var_0_0_ %uint_0 %56
         %59 = OpLoad %float %58
         %60 = OpIMul %uint %35 %uint_4294967293
         %61 = OpIAdd %uint %50 %60
         %62 = OpIMul %uint %39 %uint_4294967293
         %63 = OpIAdd %uint %61 %62
         %64 = OpIAdd %uint %63 %45
         %65 = OpIAdd %uint %64 %uint_3
         %66 = OpAccessChain %_ptr_StorageBuffer_float %__resource_var_0_1_ %uint_0 %65
               OpStore %66 %59
         %67 = OpIAdd %uint %50 %uint_64
               OpBranch %48
         %46 = OpLabel
         %68 = OpIAdd %uint %45 %31
               OpBranch %43
         %40 = OpLabel
         %69 = OpIAdd %uint %39 %29
               OpBranch %36
         %38 = OpLabel
               OpReturn
               OpFunctionEnd
END

BUFFER buf0 DATA_TYPE float DATA
1 2 3 4 5 6
END

BUFFER buf1 DATA_TYPE float DATA
0 0 0 0 0 0
END

PIPELINE compute pipeline
  ATTACH repro ENTRY_POINT _reverse_dim0_dispatch_0

  BIND BUFFER buf0 AS storage DESCRIPTOR_SET 0 BINDING 0
  BIND BUFFER buf1 AS storage DESCRIPTOR_SET 0 BINDING 1
END


RUN pipeline 1 2 1

EXPECT buf1 IDX 0 EQ 4.0 5.0 6.0 1.0 2.0 3.0

@kuhar
Copy link
Member Author

kuhar commented Mar 6, 2023

The minimized test cases (both IREE and Amber) also fail on Moto E w/ Adreno.
The original one only fails on Pixel 6. I updated all snippets to match the original testcase.

@kuhar
Copy link
Member Author

kuhar commented Mar 7, 2023

The test passes with robustBufferAccess enabled, both under IREE and Amber.

kuhar added a commit that referenced this issue Mar 7, 2023
This is useful when debugging suspected out-of-bounds memory access
issues.

Issue: #12415
qedawkins pushed a commit to qedawkins/iree that referenced this issue Apr 2, 2023
…12416)

We currently do not have a better mechanism to disable this only on
affected Vulkan targets.

This is so that we can update our Pixel phones and use new Vulkan
extensions.

Issue: iree-org#12415
qedawkins pushed a commit to qedawkins/iree that referenced this issue Apr 2, 2023
This is useful when debugging suspected out-of-bounds memory access
issues.

Issue: iree-org#12415
@allieculp allieculp moved this from Not Started to Needs Scheduling in (Deprecated) IREE Apr 28, 2023
jpienaar pushed a commit that referenced this issue May 1, 2023
We currently do not have a better mechanism to disable this only on
affected Vulkan targets.

This is so that we can update our Pixel phones and use new Vulkan
extensions.

Issue: #12415
jpienaar pushed a commit that referenced this issue May 1, 2023
This is useful when debugging suspected out-of-bounds memory access
issues.

Issue: #12415
rengolin pushed a commit to plaidml/iree that referenced this issue May 2, 2023
…12416)

We currently do not have a better mechanism to disable this only on
affected Vulkan targets.

This is so that we can update our Pixel phones and use new Vulkan
extensions.

Issue: iree-org#12415
rengolin pushed a commit to plaidml/iree that referenced this issue May 2, 2023
This is useful when debugging suspected out-of-bounds memory access
issues.

Issue: iree-org#12415
NatashaKnk pushed a commit to NatashaKnk/iree that referenced this issue Jul 6, 2023
…12416)

We currently do not have a better mechanism to disable this only on
affected Vulkan targets.

This is so that we can update our Pixel phones and use new Vulkan
extensions.

Issue: iree-org#12415
NatashaKnk pushed a commit to NatashaKnk/iree that referenced this issue Jul 6, 2023
This is useful when debugging suspected out-of-bounds memory access
issues.

Issue: iree-org#12415
@allieculp allieculp moved this from Needs Scheduling to Backlog in (Deprecated) IREE Aug 29, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Done in (Deprecated) IREE Jul 10, 2024
@ScottTodd ScottTodd reopened this Jul 10, 2024
@ScottTodd
Copy link
Member

Might be able to close this after #17866 removed LinalgExt::ReverseOp. Can check if the new lowering path fails on Android.

"reverse.mlir", # TODO(#12415): disabled due to miscompilation on Pixel 6.

LLITCHEV pushed a commit to LLITCHEV/iree that referenced this issue Jul 30, 2024
Forking this from iree-org#17766 to just
look at a single directory.

* Moved Metal and ROCm tests from being exclusively defined in CMake to
being defined (but then no-op'd) in Bazel
* Taught the test function to insert
`--iree-rocm-target-chip=${IREE_HIP_TEST_TARGET_CHIP}` (not happy that
this is required though)
* Merged test srcs down to a single `ALL_SRCS` glob for test suites that
work across all configurations
* Enabled previously disabled tests
  * Fixes iree-org#9583
* Fixes iree-org#12415 (maybe, might have
to disable those tests on Android/Vulkan again)

Signed-off-by: Lubo Litchev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working codegen/spirv SPIR-V code generation compiler backend platform/android 🤖 Android-specific build, execution, benchmarking, and deployment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants