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

How to use coverage.cmake file #1826

Closed
vineel96 opened this issue Mar 11, 2024 · 5 comments
Closed

How to use coverage.cmake file #1826

vineel96 opened this issue Mar 11, 2024 · 5 comments
Assignees
Labels

Comments

@vineel96
Copy link

vineel96 commented Mar 11, 2024

How to use coverage.cmake file (https://github.com/oneapi-src/oneDNN/blob/main/cmake/coverage.cmake) to remove any unused steps in onednn code?

@shu1chen
Copy link
Contributor

shu1chen commented Mar 12, 2024

@vineel96 I'm not sure if I understand your question correctly. Are you trying to exclude some source files from coverage output, like the option -fprofile-exclude-files=regex(Program Instrumentation Options) supported by gcc, or the options gcov-filter supported by gcov?

@vineel96
Copy link
Author

@shu1chen, Yes similar to gcov tool. I wanted to remove any unused codes when we run a primitive. Example if I run oneDNN's matmul code, it should identify out of all oneDNN's matmul code which functions or code files are not used for any kind of input. So coverage.cmake file is used for this purpose ?

@shu1chen
Copy link
Contributor

@vineel96 No, I think it's not for the purpose you mentioned. As seen in the source code, coverage.cmake gets gcov tool involved, which helps to report the test code coverage.
There are some cross-dependencies in the source code and usually the oneDNN library is used as a full library. Can you explain why you want to remove the unused code? Is it to reduce the size of the binary?
I'm not aware of any tool/script that can automatically delete unused code. To reduce the code, it usually relies on developers who have a thorough understanding of the entire code base. Copy @vpirogov to see if there is any tool for this purpose

@vpirogov
Copy link
Member

oneDNN has build options to disable unused functionality:

  • ONEDNN_ENABLE_WORKLOAD allows to disable training functionality for inference cases
  • ONEDNN_ENABLE_PRIMITIVE allows to choose specific primitives (functions) and disable the rest
  • ONEDNN_ENABLE_PRIMITIVE_CPU_ISA and ONEDNN_ENABLE_PRIMITIVE_GPU_ISA allow to drop unused targets
  • ONEDNN_ENABLE_GEMM_KERNELS_ISA allows to drop legacy JIT GEMM kernels

@shu1chen
Copy link
Contributor

No updates for a week and no open questions in this thread. Closing this issue as completed

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

No branches or pull requests

4 participants