Optimize 1x1 and Depthwise Convolution for Small Shapes#4607
Optimize 1x1 and Depthwise Convolution for Small Shapes#4607
Conversation
For small shape + large output channel, Gemm based convolution is not efficient. In this kernel, each CU handle one channel's FMA.
For depthwise convolution, GEMM is low efficiency, use direct conv for high CU utilization.
This build is not recommended to merge 🔴 |
❌unet: ERROR - check error output/tmp/comgr-c845cb/input/main.cpp:11:6: error: failed to meet occupancy target given by 'amdgpu-waves-per-eu' in 'conv1x1_kernel': desired occupancy was 16, final occupancy is 8 [-Werror,-Wpass-failed]11 | void conv1x1_kernel(const float* restrict input, | ^ 1 error generated when compiling for gfx90a. /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:177: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed. [conv1x1] EXCEPTION in compile(): /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:272: compile_hip_src: hiprtc compilation failed! /tmp/comgr-204236/input/main.cpp:11:6: error: failed to meet occupancy target given by 'amdgpu-waves-per-eu' in 'conv1x1_kernel': desired occupancy was 16, final occupancy is 8 [-Werror,-Wpass-failed] 11 | void conv1x1_kernel(const float* restrict input, | ^ 1 error generated when compiling for gfx90a. /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:177: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed. [conv1x1] EXCEPTION in compile(): /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:272: compile_hip_src: hiprtc compilation failed! /tmp/comgr-90b773/input/main.cpp:11:6: error: failed to meet occupancy target given by 'amdgpu-waves-per-eu' in 'conv1x1_kernel': desired occupancy was 16, final occupancy is 8 [-Werror,-Wpass-failed] 11 | void conv1x1_kernel(const float* restrict input, | ^ 1 error generated when compiling for gfx90a. /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:177: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed. [conv1x1] EXCEPTION in compile(): /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:272: compile_hip_src: hiprtc compilation failed! Error gpu::compile_ops: /src/AMDMIGraphX/src/targets/gpu/compile_ops.cpp:218: benchmark: No valid tuned compilation for gpu::pre_conv1x1 with Problem: no config provided Module: Input Shapes: float_type, {1, 2560, 8, 8}, {163840, 64, 8, 1} float_type, {1280, 2560}, {2560, 1} float_type, {1, 1280, 8, 8}, {81920, 64, 8, 1} Dump: "/tmp/migraphx/gpu::compile_ops6699169785851322.mxr" Traceback (most recent call last): File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 359, in main() File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 233, in main model.compile( RuntimeError: /src/AMDMIGraphX/src/targets/gpu/compile_ops.cpp:218: benchmark: No valid tuned compilation for gpu::pre_conv1x1 with Problem: no config provided Module: Input Shapes: float_type, {1, 2560, 8, 8}, {163840, 64, 8, 1} float_type, {1280, 2560}, {2560, 1} float_type, {1, 1280, 8, 8}, {81920, 64, 8, 1} ❌resnet50v1: ERROR - check error output/tmp/comgr-7057e0/input/main.cpp:11:6: error: failed to meet occupancy target given by 'amdgpu-waves-per-eu' in 'conv1x1_kernel': desired occupancy was 16, final occupancy is 8 [-Werror,-Wpass-failed]11 | void conv1x1_kernel(const float* restrict input, | ^ 1 error generated when compiling for gfx90a. /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:177: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed. [conv1x1] EXCEPTION in compile(): /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:272: compile_hip_src: hiprtc compilation failed! /tmp/comgr-0257a5/input/main.cpp:11:6: error: failed to meet occupancy target given by 'amdgpu-waves-per-eu' in 'conv1x1_kernel': desired occupancy was 16, final occupancy is 8 [-Werror,-Wpass-failed] 11 | void conv1x1_kernel(const float* restrict input, | ^ 1 error generated when compiling for gfx90a. /tmp/comgr-ea6a52/input/main.cpp:11:6: error: failed to meet occupancy target given by 'amdgpu-waves-per-eu' in 'conv1x1_kernel': desired occupancy was 16, final occupancy is 8 [-Werror,-Wpass-failed] 11 | void conv1x1_kernel(const float* restrict input, | ^ 1 error generated when compiling for gfx90a. /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:177: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed. /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:177: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed. [conv1x1] EXCEPTION in compile(): /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:272: compile_hip_src: hiprtc compilation failed! [conv1x1] EXCEPTION in compile(): /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:272: compile_hip_src: hiprtc compilation failed! /tmp/comgr-572349/input/main.cpp:11:6: error: failed to meet occupancy target given by 'amdgpu-waves-per-eu' in 'conv1x1_kernel': desired occupancy was 16, final occupancy is 8 [-Werror,-Wpass-failed] 11 | void conv1x1_kernel(const float* restrict input, | ^ 1 error generated when compiling for gfx90a. /tmp/comgr-3b6ebc/input/main.cpp:11:6: error: failed to meet occupancy target given by 'amdgpu-waves-per-eu' in 'conv1x1_kernel': desired occupancy was 16, final occupancy is 8 [-Werror,-Wpass-failed] 11 | void conv1x1_kernel(const float* restrict input, | ^ 1 error generated when compiling for gfx90a. /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:177: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed. [conv1x1] EXCEPTION in compile(): /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:272: compile_hip_src: hiprtc compilation failed! /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:177: compile: hiprtc: HIPRTC_ERROR_COMPILATION: Compilation failed. [conv1x1] EXCEPTION in compile(): /src/AMDMIGraphX/src/targets/gpu/compile_hip.cpp:272: compile_hip_src: hiprtc compilation failed! Error gpu::compile_ops: /src/AMDMIGraphX/src/targets/gpu/compile_ops.cpp:218: benchmark: No valid tuned compilation for gpu::pre_conv1x1 with Problem: no config provided Module: Input Shapes: float_type, {1, 1536, 7, 7}, {75264, 49, 7, 1} float_type, {2048, 1536}, {1536, 1} float_type, {2048}, {1} float_type, {1, 2048, 7, 7}, {100352, 49, 7, 1} Dump: "/tmp/migraphx/gpu::compile_ops6699205933362497.mxr" Traceback (most recent call last): File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 359, in main() File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 233, in main model.compile( RuntimeError: /src/AMDMIGraphX/src/targets/gpu/compile_ops.cpp:218: benchmark: No valid tuned compilation for gpu::pre_conv1x1 with Problem: no config provided Module: Input Shapes: float_type, {1, 1536, 7, 7}, {75264, 49, 7, 1} float_type, {2048, 1536}, {1536, 1} float_type, {2048}, {1} float_type, {1, 2048, 7, 7}, {100352, 49, 7, 1} ❌bert_base_cased_fp16: ERROR - check error output�[1;31m2026-02-12 03:12:20.180381232 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175583, index: 63, mask: {64, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m�[1;31m2026-02-12 03:12:20.189680770 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175619, index: 99, mask: {100, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189902067 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175587, index: 67, mask: {68, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189926052 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175595, index: 75, mask: {76, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189936842 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175621, index: 101, mask: {102, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193894327 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175589, index: 69, mask: {70, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193900188 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175602, index: 82, mask: {83, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189909340 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175611, index: 91, mask: {92, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189910613 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175613, index: 93, mask: {94, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189921593 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175586, index: 66, mask: {67, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189914219 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175612, index: 92, mask: {93, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189925561 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175584, index: 64, mask: {65, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189919519 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175614, index: 94, mask: {95, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189936141 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175592, index: 72, mask: {73, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.197675921 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175604, index: 84, mask: {85, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.197897268 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175624, index: 104, mask: {105, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189908990 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175593, index: 73, mask: {74, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189945078 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175620, index: 100, mask: {101, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.206543825 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175642, index: 122, mask: {123, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.206867925 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175628, index: 108, mask: {109, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.206888093 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175634, index: 114, mask: {115, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189956068 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175594, index: 74, mask: {75, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193895519 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175597, index: 77, mask: {78, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193897623 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175590, index: 70, mask: {71, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193897593 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175608, index: 88, mask: {89, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193899557 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175607, index: 87, mask: {88, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193900539 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175610, index: 90, mask: {91, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193905248 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175625, index: 105, mask: {106, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193903745 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175605, index: 85, mask: {86, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193902643 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175601, index: 81, mask: {82, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189908388 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175585, index: 65, mask: {66, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193915226 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175609, index: 89, mask: {90, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193917350 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175626, index: 106, mask: {107, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193922039 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175623, index: 103, mask: {104, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193919845 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175596, index: 76, mask: {77, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193921017 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175616, index: 96, mask: {97, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193921037 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175598, index: 78, mask: {79, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193924073 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175606, index: 86, mask: {87, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193926407 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175599, index: 79, mask: {80, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193929593 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175622, index: 102, mask: {103, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193926357 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175615, index: 95, mask: {96, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.193926387 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175603, index: 83, mask: {84, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.207486981 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175646, index: 126, mask: {127, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189907527 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175591, index: 71, mask: {72, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189939377 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175618, index: 98, mask: {99, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189936752 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175617, index: 97, mask: {98, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.207587190 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175632, index: 112, mask: {113, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.207598722 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175639, index: 119, mask: {120, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.207875854 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175631, index: 111, mask: {112, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.207974480 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175638, index: 118, mask: {119, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.208006480 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175645, index: 125, mask: {126, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.208369314 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175627, index: 107, mask: {108, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.208765841 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175629, index: 109, mask: {110, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.207448639 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175633, index: 113, mask: {114, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.197895695 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175600, index: 80, mask: {81, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.207521847 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175640, index: 120, mask: {121, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.208403869 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175630, index: 110, mask: {111, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.208427443 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175637, index: 117, mask: {118, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.208458992 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175644, index: 124, mask: {125, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.208780678 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175636, index: 116, mask: {117, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.208818820 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175643, index: 123, mask: {124, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.206913080 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175641, index: 121, mask: {122, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.206932116 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175635, index: 115, mask: {116, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:20.189907637 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 175588, index: 68, mask: {69, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:12:21.525246193 [E:onnxruntime:, inference_session.cc:2544 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/graph/graph_utils.cc:29 int onnxruntime::graph_utils::GetIndexFromName(const onnxruntime::Node&, const std::string&, bool) itr != node_args.end() was false. Attempting to get index by a name which does not exist:InsertedPrecisionFreeCast_onnx::Pow_1623for node: Mul_53/SimplifiedLayerNormFusion/ �[m Traceback (most recent call last): File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 359, in main() File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 278, in main sess = ort.InferenceSession(model_name, File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 485, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 584, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/graph/graph_utils.cc:29 int onnxruntime::graph_utils::GetIndexFromName(const onnxruntime::Node&, const std::string&, bool) itr != node_args.end() was false. Attempting to get index by a name which does not exist:InsertedPrecisionFreeCast_onnx::Pow_1623for node: Mul_53/SimplifiedLayerNormFusion/ ❌bert_large_uncased_fp16: ERROR - check error output�[1;31m2026-02-12 03:13:05.205517812 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182567, index: 63, mask: {64, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m�[1;31m2026-02-12 03:13:05.213900913 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182573, index: 69, mask: {70, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.217898804 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182571, index: 67, mask: {68, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.213909710 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182568, index: 64, mask: {65, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.213909900 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182576, index: 72, mask: {73, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.213926121 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182578, index: 74, mask: {75, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.225895908 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182577, index: 73, mask: {74, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.213932853 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182569, index: 65, mask: {66, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.213927634 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182575, index: 71, mask: {72, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.217899005 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182572, index: 68, mask: {69, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.217899085 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182570, index: 66, mask: {67, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.213906544 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182574, index: 70, mask: {71, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.231834335 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182592, index: 88, mask: {89, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.231859262 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182599, index: 95, mask: {96, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.231874971 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182606, index: 102, mask: {103, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.231885742 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182613, index: 109, mask: {110, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.231900940 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182620, index: 116, mask: {117, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.231911721 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182627, index: 123, mask: {124, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232042417 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182585, index: 81, mask: {82, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232073145 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182598, index: 94, mask: {95, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232052806 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182591, index: 87, mask: {88, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232116857 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182611, index: 107, mask: {108, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232132086 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182618, index: 114, mask: {115, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232161531 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182625, index: 121, mask: {122, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232253043 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182583, index: 79, mask: {80, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232273171 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182597, index: 93, mask: {94, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232284593 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182604, index: 100, mask: {101, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232258013 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182590, index: 86, mask: {87, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232309229 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182612, index: 108, mask: {109, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232390623 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182626, index: 122, mask: {123, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232559150 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182617, index: 113, mask: {114, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232600919 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182589, index: 85, mask: {86, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232624954 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182596, index: 92, mask: {93, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232780537 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182630, index: 126, mask: {127, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232674808 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182624, index: 120, mask: {121, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232707139 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182610, index: 106, mask: {107, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232729050 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182616, index: 112, mask: {113, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232741323 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182582, index: 78, mask: {79, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232760369 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182623, index: 119, mask: {120, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232896275 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182609, index: 105, mask: {106, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232960416 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182581, index: 77, mask: {78, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233367122 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182580, index: 76, mask: {77, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232806566 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182588, index: 84, mask: {85, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232807959 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182595, index: 91, mask: {92, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232844538 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182602, index: 98, mask: {99, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233391147 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182587, index: 83, mask: {84, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233409522 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182594, index: 90, mask: {91, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233639716 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182608, index: 104, mask: {105, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233666406 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182615, index: 111, mask: {112, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233669382 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182601, index: 97, mask: {98, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233695972 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182622, index: 118, mask: {119, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233701412 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182629, index: 125, mask: {126, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233739113 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182579, index: 75, mask: {76, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233739143 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182621, index: 117, mask: {118, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233755203 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182586, index: 82, mask: {83, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233782465 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182593, index: 89, mask: {90, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233799677 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182600, index: 96, mask: {97, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233828101 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182607, index: 103, mask: {104, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233849310 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182614, index: 110, mask: {111, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233870751 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182628, index: 124, mask: {125, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232316944 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182619, index: 115, mask: {116, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.233895427 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182584, index: 80, mask: {81, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232081771 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182605, index: 101, mask: {102, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:05.232648038 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 182603, index: 99, mask: {100, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:13:09.524751225 [E:onnxruntime:, inference_session.cc:2544 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/graph/graph_utils.cc:29 int onnxruntime::graph_utils::GetIndexFromName(const onnxruntime::Node&, const std::string&, bool) itr != node_args.end() was false. Attempting to get index by a name which does not exist:InsertedPrecisionFreeCast_onnx::Pow_3183for node: Mul_53/SimplifiedLayerNormFusion/ �[m Traceback (most recent call last): File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 359, in main() File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 278, in main sess = ort.InferenceSession(model_name, File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 485, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 584, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/graph/graph_utils.cc:29 int onnxruntime::graph_utils::GetIndexFromName(const onnxruntime::Node&, const std::string&, bool) itr != node_args.end() was false. Attempting to get index by a name which does not exist:InsertedPrecisionFreeCast_onnx::Pow_3183for node: Mul_53/SimplifiedLayerNormFusion/ ❌distilgpt2_fp16: ERROR - check error output�[1;31m2026-02-12 03:16:28.037916552 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198552, index: 63, mask: {64, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m�[1;31m2026-02-12 03:16:28.049919222 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198591, index: 102, mask: {103, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049943097 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198584, index: 95, mask: {96, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.051578538 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198600, index: 111, mask: {112, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.052643634 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198586, index: 97, mask: {98, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.056248865 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198559, index: 70, mask: {71, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049924051 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198598, index: 109, mask: {110, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049927278 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198577, index: 88, mask: {89, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049924603 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198569, index: 80, mask: {81, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.056513273 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198612, index: 123, mask: {124, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049927137 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198602, index: 113, mask: {114, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049927107 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198588, index: 99, mask: {100, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049933038 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198583, index: 94, mask: {95, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049937136 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198590, index: 101, mask: {102, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049939380 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198567, index: 78, mask: {79, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049939240 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198572, index: 83, mask: {84, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049940653 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198570, index: 81, mask: {82, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049939761 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198589, index: 100, mask: {101, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049940212 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198575, index: 86, mask: {87, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049946233 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198582, index: 93, mask: {94, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049948548 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198604, index: 115, mask: {116, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049945061 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198565, index: 76, mask: {77, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049945101 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198599, index: 110, mask: {111, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049945081 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198585, index: 96, mask: {97, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049951433 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198568, index: 79, mask: {80, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049957825 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198576, index: 87, mask: {88, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049959819 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198596, index: 107, mask: {108, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049960771 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198611, index: 122, mask: {123, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049962704 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198613, index: 124, mask: {125, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049963776 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198593, index: 104, mask: {105, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049964888 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198578, index: 89, mask: {90, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049967794 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198592, index: 103, mask: {104, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049966772 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198554, index: 65, mask: {66, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049962123 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198555, index: 66, mask: {67, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049966712 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198558, index: 69, mask: {70, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049965690 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198557, index: 68, mask: {69, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.057061997 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198603, index: 114, mask: {115, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049966181 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198601, index: 112, mask: {113, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049965179 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198573, index: 84, mask: {85, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049967654 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198587, index: 98, mask: {99, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049976771 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198556, index: 67, mask: {68, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049979386 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198615, index: 126, mask: {127, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049973074 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198563, index: 74, mask: {75, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049985026 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198566, index: 77, mask: {78, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049988333 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198580, index: 91, mask: {92, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.057346042 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198574, index: 85, mask: {86, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.057360499 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198581, index: 92, mask: {93, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049997650 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198553, index: 64, mask: {65, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.057444628 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198609, index: 120, mask: {121, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.057835133 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198571, index: 82, mask: {83, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.058129418 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198579, index: 90, mask: {91, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.058188749 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198607, index: 118, mask: {119, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049993773 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198561, index: 72, mask: {73, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049999664 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198562, index: 73, mask: {74, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.050001137 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198608, index: 119, mask: {120, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049991589 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198560, index: 71, mask: {72, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049919202 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198605, index: 116, mask: {117, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049927157 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198595, index: 106, mask: {107, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.056834138 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198597, index: 108, mask: {109, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049967463 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198594, index: 105, mask: {106, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.057095360 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198610, index: 121, mask: {122, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.057907189 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198614, index: 125, mask: {126, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.058020262 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198606, index: 117, mask: {118, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.049994494 [E:onnxruntime:Default, env.cc:226 ThreadMain] pthread_setaffinity_np failed for thread: 198564, index: 75, mask: {76, }, error code: 22 error msg: Invalid argument. Specify the number of threads explicitly so the affinity is not set.�[m �[1;31m2026-02-12 03:16:28.780980307 [E:onnxruntime:, inference_session.cc:2544 operator()] Exception during initialization: /onnxruntime_src/onnxruntime/core/graph/graph_utils.cc:29 int onnxruntime::graph_utils::GetIndexFromName(const onnxruntime::Node&, const std::string&, bool) itr != node_args.end() was false. Attempting to get index by a name which does not exist:InsertedPrecisionFreeCast_onnx::Pow_1551for node: Mul_33/SimplifiedLayerNormFusion/ �[m Traceback (most recent call last): File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 359, in main() File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 278, in main sess = ort.InferenceSession(model_name, File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 485, in init self._create_inference_session(providers, provider_options, disabled_optimizers) File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 584, in _create_inference_session sess.initialize_session(providers, provider_options, disabled_optimizers) onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/graph/graph_utils.cc:29 int onnxruntime::graph_utils::GetIndexFromName(const onnxruntime::Node&, const std::string&, bool) itr != node_args.end() was false. Attempting to get index by a name which does not exist:InsertedPrecisionFreeCast_onnx::Pow_1551for node: Mul_33/SimplifiedLayerNormFusion/ |
|
It seems it would be better to rewrite 1x1 conv to a gemm so it can use hipblaslt(we already do that here) and rewrite 1x1 depthwise to a elementwise multiply which would enables it to do more fusions. |
|
We tried enabling MIGRAPHX_ENABLE_REWRITE_DOT. However, the performance for 1x1 convolution is not good. For depthwise convolution, we encountered 3x3, 5x5, and other kernel sizes. |
Are you saying your gemm performs better than hipblaslt from some sizes?
I see, I thought it was for 1x1 depthwise. I have #4647 that implements depthwise with tuning and fusions, so it now always performs better than rocmlir for fp32:
From #4647 (comment) |
Yes. Our testing platform is STX Halo...maybe that's a reson.
For depthwise conv, this one is better than rocMLIR, but worse than the code in the PR on STX Halo. |
|
Some of the models we tested: |
Hi @pfultz2 , could you share the methodology used to generate this report? We’d like to replicate these tests on STX Halo and MI250. |
Interesting. It does better than this PR on navi48. Its the same algorithm in this PR, but it tunes the tile sizes and adds pointwise fusions.
I will check out those models. I dont capture the configs from those models.
Here is the script that was used: bench_depthwise_conv.py#!/usr/bin/env python3
"""
Benchmark depthwise convolution sizes using migraphx-driver time.
Generates a temporary .py program for each size and times it with the driver.
Usage:
python3 tools/bench_depthwise_conv.py
python3 tools/bench_depthwise_conv.py -n 1000 -j 4
python3 tools/bench_depthwise_conv.py --gpu
python3 tools/bench_depthwise_conv.py --json baseline.json
python3 tools/bench_depthwise_conv.py --baseline baseline.json --markdown
"""
import argparse
import json
import os
import re
import subprocess
import sys
import tempfile
from concurrent.futures import ProcessPoolExecutor, as_completed
DRIVER = os.path.join(os.path.dirname(__file__), "..", "build", "bin", "migraphx-driver")
# (input_lens, weight_lens, count)
SIZES = [
([1, 3, 22, 22], [3, 1, 7, 7], 10),
([1, 3, 24, 24], [3, 1, 13, 13], 6),
([1, 3, 38, 38], [3, 1, 7, 7], 4),
([1, 3, 512, 514], [3, 1, 1, 3], 4),
([1, 3, 514, 512], [3, 1, 3, 1], 4),
([1, 3, 256, 258], [3, 1, 1, 3], 4),
([1, 3, 258, 256], [3, 1, 3, 1], 4),
([1, 3, 128, 130], [3, 1, 1, 3], 4),
([1, 3, 130, 128], [3, 1, 3, 1], 4),
([1, 3, 64, 66], [3, 1, 1, 3], 4),
([1, 3, 66, 64], [3, 1, 3, 1], 4),
([1, 3, 32, 34], [3, 1, 1, 3], 4),
([1, 3, 34, 32], [3, 1, 3, 1], 4),
([1, 3, 97, 97], [3, 1, 7, 7], 1),
([1, 3, 96, 96], [3, 1, 7, 7], 1),
]
def make_program_source(input_lens, weight_lens, dtype="float_type", nhwc=False):
"""Generate a MIGraphX Python program string for a depthwise convolution."""
group = input_lens[1]
if nhwc:
ndim = len(input_lens) - 2
perm = [0] + list(range(2, 2 + ndim)) + [1]
input_shape = (f"migraphx.shape(type=\"{dtype}\", lens={input_lens},"
f" permutation={perm})")
weight_shape = (f"migraphx.shape(type=\"{dtype}\", lens={weight_lens},"
f" permutation={perm})")
else:
input_shape = f"migraphx.shape(type=\"{dtype}\", lens={input_lens})"
weight_shape = f"migraphx.shape(type=\"{dtype}\", lens={weight_lens})"
return (
f"p = migraphx.program()\n"
f"m = p.get_main_module()\n"
f"p_x = m.add_parameter(\"x\", {input_shape})\n"
f"w = m.add_literal(migraphx.generate_argument({weight_shape}, 1))\n"
f"y = m.add_instruction(migraphx.op(\"convolution\", group={group}), [p_x, w])\n"
f"m.add_return([y])\n"
)
def format_shape(lens):
return "x".join(str(d) for d in lens)
def run_bench(entry, driver, target, iterations, dtype, exhaustive_tune, nhwc):
"""Write a temp .py file, run driver time, return (entry, time_ms, error)."""
input_lens, weight_lens, count = entry
source = make_program_source(input_lens, weight_lens, dtype, nhwc)
with tempfile.NamedTemporaryFile(
mode="w", suffix=".py", prefix="dw_conv_", delete=False
) as f:
f.write(source)
tmp_path = f.name
try:
cmd = [driver, "time", tmp_path, f"--{target}", "-n", str(iterations)]
if exhaustive_tune:
cmd.append("--exhaustive-tune")
result = subprocess.run(cmd, capture_output=True, text=True, timeout=1000)
if result.returncode != 0:
return (entry, None, result.stderr.strip())
for line in result.stdout.splitlines():
m = re.search(r"Total time:\s*([\d.]+)\s*ms", line)
if m:
return (entry, float(m.group(1)), None)
return (entry, None, "Could not parse time from output")
except subprocess.TimeoutExpired:
return (entry, None, "Timeout")
except Exception as e:
return (entry, None, str(e))
finally:
os.unlink(tmp_path)
def main():
parser = argparse.ArgumentParser(
description="Benchmark depthwise convolution sizes with migraphx-driver."
)
parser.add_argument(
"--driver",
default=DRIVER,
help="Path to migraphx-driver binary",
)
parser.add_argument(
"-n",
"--iterations",
type=int,
default=5000,
help="Number of iterations for timing (default: 5000)",
)
parser.add_argument(
"-j",
type=int,
default=1,
metavar="N",
help="Number of benchmarks to run in parallel (default: 1)",
)
parser.add_argument(
"--gpu", action="store_const", const="gpu", dest="target", help="Compile on the GPU"
)
parser.add_argument(
"--cpu", action="store_const", const="cpu", dest="target", help="Compile on the CPU"
)
parser.add_argument(
"--ref", action="store_const", const="ref", dest="target", help="Compile on ref"
)
parser.add_argument(
"--type",
default="float_type",
dest="dtype",
help="Data type for tensors (default: float_type)",
)
parser.add_argument(
"--batch",
type=int,
nargs="+",
default=None,
metavar="N",
help="Batch size(s) to benchmark (default: use sizes from table)",
)
parser.add_argument(
"--exhaustive-tune",
action="store_true",
help="Enable exhaustive tuning during compilation",
)
parser.add_argument(
"--nhwc",
action="store_true",
help="Use NHWC layout (adds permutation=[0, 2, 3, 1] to input/weight shapes)",
)
parser.add_argument(
"--markdown",
action="store_true",
help="Print results table in Markdown format",
)
parser.add_argument(
"--json",
dest="json_output",
metavar="FILE",
help="Save results to a JSON file",
)
parser.add_argument(
"--baseline",
metavar="FILE",
help="JSON file from a previous run to compare against",
)
parser.set_defaults(target="gpu")
args = parser.parse_args()
sizes = SIZES
if args.batch is not None:
sizes = [
([b] + il[1:], wl, count)
for il, wl, count in SIZES
for b in args.batch
]
layout = "NHWC" if args.nhwc else "NCHW"
total = len(sizes)
print(f"\nBenchmarking {total} depthwise conv sizes "
f"(target={args.target}, type={args.dtype}, layout={layout}, "
f"iterations={args.iterations}, jobs={args.j})\n")
# Run all benchmarks, potentially in parallel, showing progress.
results = {}
done = 0
with ProcessPoolExecutor(max_workers=args.j) as pool:
futures = {
pool.submit(run_bench, entry, args.driver, args.target,
args.iterations, args.dtype, args.exhaustive_tune,
args.nhwc): i
for i, entry in enumerate(sizes)
}
for future in as_completed(futures):
idx = futures[future]
results[idx] = future.result()
done += 1
entry, time_ms, error = results[idx]
input_lens, weight_lens, _ = entry
status = f"{time_ms:.4f} ms" if time_ms is not None else f"ERROR: {error}"
print(f" [{done}/{total}] {format_shape(input_lens)} / "
f"{format_shape(weight_lens)} => {status}")
# Build rows for output.
rows = []
for i in range(total):
entry, time_ms, error = results[i]
input_lens, weight_lens, count = entry
rows.append({
"input": format_shape(input_lens),
"weight": format_shape(weight_lens),
"count": count,
"time_ms": round(time_ms, 4) if time_ms is not None else None,
"error": error,
})
# Load baseline if provided.
baseline_map = {}
if args.baseline:
with open(args.baseline) as f:
baseline_data = json.load(f)
for r in baseline_data["results"]:
key = (r["input"], r["weight"])
baseline_map[key] = r.get("time_ms")
has_baseline = bool(baseline_map)
def fmt_change(cur, base):
if base is None or cur is None or cur == 0:
return "-"
pct = (base - cur) / cur * 100
sign = "+" if pct >= 0 else ""
return f"{sign}{pct:.1f}%"
# Print results table.
if has_baseline:
headers = ["Input", "Weight", "Count", "Baseline (ms)", "Time (ms)", "Change"]
if args.markdown:
print(f"\n**Results** (type={args.dtype}, layout={layout})\n")
print("| " + " | ".join(headers) + " |")
print("| " + " | ".join("---" for _ in headers) + " |")
for r in rows:
key = (r["input"], r["weight"])
base = baseline_map.get(key)
time_str = f"{r['time_ms']:.4f}" if r["time_ms"] is not None else "ERROR"
base_str = f"{base:.4f}" if base is not None else "-"
change = fmt_change(r["time_ms"], base)
print(f"| {r['input']} | {r['weight']} | {r['count']} "
f"| {base_str} | {time_str} | {change} |")
else:
header_fmt = " {:<20} {:<20} {:>5} {:>12} {:>12} {:>8}"
row_fmt = " {:<20} {:<20} {:>5} {:>12} {:>12} {:>8}"
print(f"\n {'='*89}")
print(f" RESULTS (layout={layout})")
print(f" {'='*89}")
print(header_fmt.format(*headers))
print(f" {'-'*20} {'-'*20} {'-'*5} {'-'*12} {'-'*12} {'-'*8}")
for r in rows:
key = (r["input"], r["weight"])
base = baseline_map.get(key)
time_str = f"{r['time_ms']:.4f}" if r["time_ms"] is not None else "ERROR"
base_str = f"{base:.4f}" if base is not None else "-"
change = fmt_change(r["time_ms"], base)
print(row_fmt.format(r["input"], r["weight"], r["count"],
base_str, time_str, change))
else:
headers = ["Input", "Weight", "Count", "Time (ms)"]
if args.markdown:
print(f"\n**Results** (type={args.dtype}, layout={layout})\n")
print("| " + " | ".join(headers) + " |")
print("| " + " | ".join("---" for _ in headers) + " |")
for r in rows:
time_str = f"{r['time_ms']:.4f}" if r["time_ms"] is not None else "ERROR"
print(f"| {r['input']} | {r['weight']} | {r['count']} | {time_str} |")
else:
header_fmt = " {:<20} {:<20} {:>5} {:>12}"
row_fmt = " {:<20} {:<20} {:>5} {:>12}"
print(f"\n {'='*65}")
print(f" RESULTS (layout={layout})")
print(f" {'='*65}")
print(header_fmt.format(*headers))
print(f" {'-'*20} {'-'*20} {'-'*5} {'-'*12}")
for r in rows:
time_str = f"{r['time_ms']:.4f}" if r["time_ms"] is not None else "ERROR"
print(row_fmt.format(r["input"], r["weight"], r["count"], time_str))
print()
# Save JSON if requested.
if args.json_output:
output = {
"config": {
"target": args.target,
"type": args.dtype,
"layout": layout,
"iterations": args.iterations,
},
"results": rows,
}
with open(args.json_output, "w") as f:
json.dump(output, f, indent=2)
print(f"Results saved to: {args.json_output}", file=sys.stderr)
if __name__ == "__main__":
main()
|
Motivation
This PR enhances the performance of 1x1 convolutions and depthwise convolutions.
Current rocMLIR kernels exhibit suboptimal performance for specific pointwise and depthwise convolution configurations.
Technical Details
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot Applicable