llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[COMGR] Codegen is slow.

Open lshqqytiger opened this issue 1 year ago • 2 comments

Suggestion Description

AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE takes lots of time than other tasks. It depends on the input and environment, but it is hard to accept considering system configuration. (I assume it is single thread) The best: 1~2s Most cases: 20~30s or 60~70s The worst: 80~100s

Is there any way to make it faster?

maybe related: #36

HIP SDK version

6.1.40252-53f3e11ac (official AMD release)

CPU

Intel Core i9 14900K

Operating System

Windows 11 Pro

GPU

RX 7900 XTX

ROCm Component

COMGR

lshqqytiger avatar Jul 12 '24 09:07 lshqqytiger

@lshqqytiger Are you getting between 1 and 100 seconds when using Comgr to Codegen the same bitcode? Or different execution times for different bitcodes?

The size of the bitcode passed to the Codegen action will impact the length of time taken for the compilation.

Can you provide a simple reproducer that's calling AMD_COMGR_ACTION_CODEGEN_BC_TO_RELOCATABLE on your bc file?

lamb-j avatar Jul 12 '24 18:07 lamb-j

Thanks for reply. I'm getting difference times for different bitcodes. I know and understand that the execution times will vary, but comgr doesn't seem to use system resources efficiently. (low cpu usage) I just want to know whether there's any way to boost the execution speed. If it is not possible, it's ok. Here's bc files that I'm handling: Drive

0.bc
size: 970452
elapsed: 1.37s

1.bc
size: 35541704
elapsed: 98.64s

2.bc
size: 4514820
elapsed: 9.26s

lshqqytiger avatar Jul 12 '24 19:07 lshqqytiger

This is a probably general LLVM/clang issue, and not anything specific to Comgr or ROCm LLVM.

I'd assume if you tried the same compilation with upstream clang you'd see similar results.

That said, we do have some work in progress that will hopefully result in long-term improvements for compilation time, especially for large files.

lamb-j avatar Jul 15 '24 23:07 lamb-j