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

[COMGR] Codegen is slow. #116

Closed
lshqqytiger opened this issue Jul 12, 2024 · 3 comments
Closed

[COMGR] Codegen is slow. #116

lshqqytiger opened this issue Jul 12, 2024 · 3 comments
Assignees
Labels
comgr Related to Code Object Manager

Comments

@lshqqytiger
Copy link

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

@lamb-j lamb-j self-assigned this Jul 12, 2024
@lamb-j lamb-j added the comgr Related to Code Object Manager label Jul 12, 2024
@lamb-j
Copy link
Collaborator

lamb-j commented Jul 12, 2024

@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?

@lshqqytiger
Copy link
Author

lshqqytiger commented Jul 12, 2024

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

@lamb-j
Copy link
Collaborator

lamb-j commented Jul 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comgr Related to Code Object Manager
Projects
None yet
Development

No branches or pull requests

2 participants