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

[OpenCL/GPU] Kernel binary caching @open sesame 04/04 09:22 #2503

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

s-debadri
Copy link
Contributor

Changes for GPU kernel caching:

  • Added utility for saving kernel as binary files using clGetProgramInfo.
  • Added wrapper for clCreateProgramWithBinary.

Signed-off-by: Debadri Samaddar [email protected]

Added utilities for saving kernel as binary files.
Added wrapper for clCreateProgramWithBinary.

Signed-off-by: Debadri Samaddar <[email protected]>
@taos-ci
Copy link

taos-ci commented Mar 11, 2024

📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2503. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/.

@taos-ci
Copy link

taos-ci commented Mar 11, 2024

:octocat: cibot: @s-debadri, nntrainer/opencl/opencl_loader.cpp includes bug(s). Please fix incorrect coding constructs in your commit before entering a review process.

Copy link

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-debadri, 💯 All CI checkers are successfully verified. Thanks.

@s-debadri s-debadri changed the title [OpenCL/GPU] Kernel binary caching [Do Not Merge][OpenCL/GPU] Kernel binary caching Mar 12, 2024
Used better C++ paradigm to enhance readability.
Added proper cleanup stub.

Signed-off-by: Debadri Samaddar <[email protected]>
@taos-ci
Copy link

taos-ci commented Mar 14, 2024

:octocat: cibot: @s-debadri, nntrainer/opencl/opencl_program.cpp includes bug(s). Please fix incorrect coding constructs in your commit before entering a review process.

Copy link

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-debadri, 💯 All CI checkers are successfully verified. Thanks.

@s-debadri s-debadri changed the title [Do Not Merge][OpenCL/GPU] Kernel binary caching [OpenCL/GPU] Kernel binary caching Mar 14, 2024
// Write the binary to file
// All kernels in the program will be saved in the binary file
for (unsigned int i = 0; i < num_devices; ++i) {
std::ofstream fs(std::string(kernel_names) + "_kernel.bin",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to get a parameter save path like kernel_path + ... which can be defined by option.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorporated opencl-kernel-path pre-processor directive in latest commit

@@ -29,8 +31,8 @@ namespace nntrainer::opencl {
* @return true if successful or false otherwise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to add a comment for @param binaryCreated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in latest commit.

Added opencl-kernel-path preprocessor directive and handled inside opencl_program.

Signed-off-by: Debadri Samaddar <[email protected]>
@taos-ci
Copy link

taos-ci commented Mar 15, 2024

:octocat: cibot: @s-debadri, nntrainer/opencl/opencl_program.cpp includes bug(s). Please fix incorrect coding constructs in your commit before entering a review process.

@taos-ci
Copy link

taos-ci commented Mar 15, 2024

:octocat: cibot: @s-debadri, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://ci.nnstreamer.ai/nntrainer/ci/repo-workers/pr-checker/2503-202403152117300.24992704391479-2d0ba968c8c5e44471a42361ff58b6b72a957738/.

meson.build Outdated Show resolved Hide resolved
Add DEFAULT_KERNEL_PATH as static member of Program class
Modified macros for stringification

Signed-off-by: Debadri Samaddar <[email protected]>
@taos-ci
Copy link

taos-ci commented Apr 2, 2024

:octocat: cibot: @s-debadri, nntrainer/opencl/opencl_program.cpp includes bug(s). Please fix incorrect coding constructs in your commit before entering a review process.

Copy link

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-debadri, 💯 All CI checkers are successfully verified. Thanks.

@myungjoo
Copy link
Member

myungjoo commented Apr 3, 2024

@EunjuYang @jihochu PTAL. This is taking too long.

@jijoongmoon
Copy link
Collaborator

could you check the CI?

@DonghakPark DonghakPark changed the title [OpenCL/GPU] Kernel binary caching [OpenCL/GPU] Kernel binary caching @open sesame 04/04 09:22 Apr 4, 2024
@taos-ci
Copy link

taos-ci commented Apr 4, 2024

:octocat: cibot: @s-debadri, nntrainer/opencl/opencl_program.cpp includes bug(s). Please fix incorrect coding constructs in your commit before entering a review process.

Copy link
Member

@DonghakPark DonghakPark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!
i will check CI!!

@DonghakPark
Copy link
Member

@s-debadri @jijoongmoon

nofile:0:0: information: Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information. [toomanyconfigs]

It means that there are too many conditional compilation directives (#ifdef and others) in the code being analyzed. Cppcheck can handle up to 12 such configurations at a time by default

and i give --force option and run in my local environment --> There is no cppcheck error on this PR

Copy link

@taos-ci taos-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s-debadri, 💯 All CI checkers are successfully verified. Thanks.

Copy link
Collaborator

@jijoongmoon jijoongmoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jijoongmoon jijoongmoon merged commit 8c2caa0 into nnstreamer:main Apr 4, 2024
33 of 35 checks passed
@s-debadri s-debadri deleted the gpu_caching branch April 4, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants