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

[Wait for 2759][GPU/OpenCL] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. @open sesame 12/02 16:21 #2752

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yashSingh0723
Copy link
Contributor

@yashSingh0723 yashSingh0723 commented Oct 9, 2024

Added initial version of LM Head Layer for GPU. Also Updated the addition layer for GPU with latest pipeline changes.
Changes added with this PR:

  • lm_head_layer_cl.cpp added containing the new CustomLMHeadLayerCl class for OpenCL implementation.
  • Updated with new GPU pipeline changes
  • Added unittest_layers_lm_head_cl.cpp to test LM Head Layer on GPU.
  • Removed cl_context dependencies for addition layer

Signed-off-by: Yash Singh [email protected]

@taos-ci
Copy link

taos-ci commented Oct 9, 2024

📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2752. 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 Oct 9, 2024

:octocat: cibot: @yashSingh0723, nntrainer/layers/cl_layers/lm_head_layer_cl.h does not include Doxygen tags such as @file @brief @author @bug. You must include the Doxygen tags in the source code. Please refer to a Doxygen manual at http://github.com/nnstreamer/TAOS-CI/blob/main/ci/doc/doxygen-documentation.md

@yashSingh0723 yashSingh0723 changed the title [GPU/OpenCL/Update] Initial version of LM Head layer with OpencCl ops and updated Addition Layer with latest pipeline changes. [Wait for 2736][GPU/OpenCL/Update] Initial version of LM Head layer with OpencCl ops and updated Addition Layer with latest pipeline changes. Oct 9, 2024
@taos-ci
Copy link

taos-ci commented Oct 9, 2024

:octocat: cibot: @yashSingh0723, nntrainer/layers/cl_layers/lm_head_layer_cl.h does not include Doxygen tags such as @file @brief @author @bug. You must include the Doxygen tags in the source code. Please refer to a Doxygen manual at http://github.com/nnstreamer/TAOS-CI/blob/main/ci/doc/doxygen-documentation.md

@taos-ci
Copy link

taos-ci commented Oct 9, 2024

:octocat: cibot: @yashSingh0723, nntrainer/layers/cl_layers/lm_head_layer_cl.h does not include Doxygen tags such as @file @brief @author @bug. You must include the Doxygen tags in the source code. Please refer to a Doxygen manual at http://github.com/nnstreamer/TAOS-CI/blob/main/ci/doc/doxygen-documentation.md

@yashSingh0723 yashSingh0723 changed the title [Wait for 2736][GPU/OpenCL/Update] Initial version of LM Head layer with OpencCl ops and updated Addition Layer with latest pipeline changes. [Wait for 2736][GPU/OpenCL/Update] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. Oct 9, 2024
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.

@yashSingh0723, 💯 All CI checkers are successfully verified. Thanks.

Copy link
Contributor

@EunjuYang EunjuYang left a comment

Choose a reason for hiding this comment

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

I'm glad to see the implementation of the key blocks for LLM in opencl version.
Here are some opinions in my side:

nntrainer/layers/cl_layers/custom_vocab_selection.cpp Outdated Show resolved Hide resolved
nntrainer/layers/cl_layers/lm_head_layer_cl.cpp Outdated Show resolved Hide resolved
nntrainer/layers/cl_layers/lm_head_layer_cl.cpp Outdated Show resolved Hide resolved
test/input_gen/gen_layer_tests.py Outdated Show resolved Hide resolved
nntrainer/utils/custom_properties.h Outdated Show resolved Hide resolved
@yashSingh0723 yashSingh0723 changed the title [Wait for 2736][GPU/OpenCL/Update] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. [Wait for 2759][GPU/OpenCL/Update] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. Nov 19, 2024
@yashSingh0723 yashSingh0723 changed the title [Wait for 2759][GPU/OpenCL/Update] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. [Wait for 2759][GPU/OpenCL] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. Nov 19, 2024
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.

@yashSingh0723, 💯 All CI checkers are successfully verified. Thanks.

@yashSingh0723 yashSingh0723 force-pushed the opencl_lmhead_layer branch 3 times, most recently from 27cf3d5 to 0b9ff2a Compare November 22, 2024 09:38
@taos-ci
Copy link

taos-ci commented Nov 22, 2024

:octocat: cibot: @yashSingh0723, 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/2752-202411221838150.57073402404785-0b9ff2aa74fcfcdb01e1dff03a229df8f4457b55/.

@yashSingh0723 yashSingh0723 changed the title [Wait for 2759][GPU/OpenCL] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. [Wait for 2759][GPU/OpenCL] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. @open sesame 11/22 17:14 Nov 22, 2024
@taos-ci
Copy link

taos-ci commented Nov 22, 2024

:octocat: cibot: @yashSingh0723, 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/2752-202411222045320.65086197853088-57ae5ed2a75efcba64c20bad9b312233da9d6a95/.

@yashSingh0723 yashSingh0723 changed the title [Wait for 2759][GPU/OpenCL] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. @open sesame 11/22 17:14 [Wait for 2759][GPU/OpenCL] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. @open sesame 11/25 11:58 Nov 25, 2024
@taos-ci
Copy link

taos-ci commented Nov 25, 2024

:octocat: cibot: @yashSingh0723, 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/2752-202411251537140.93050694465637-5c0e60a0a35fdc17a75ad5e5420b9086781d56df/.

@yashSingh0723 yashSingh0723 changed the title [Wait for 2759][GPU/OpenCL] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. @open sesame 11/25 11:58 [Wait for 2759][GPU/OpenCL] Initial version of LM Head layer with OpenCl ops and updated Addition Layer with latest pipeline changes. @open sesame 12/02 16:21 Dec 2, 2024
@taos-ci
Copy link

taos-ci commented Dec 2, 2024

:octocat: cibot: @yashSingh0723, 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/2752-202412021954220.7212700843811-d0b5e1c22ba9c2426ecf23fb18344942573209b0/.

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.

@yashSingh0723, 💯 All CI checkers are successfully verified. Thanks.

Copy link
Contributor

@EunjuYang EunjuYang left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -108,7 +108,8 @@ enum LayerType {
LAYER_UPSAMPLE2D, /**< Upsample 2D Layer type */
LAYER_RMSNORM = ML_TRAIN_LAYER_TYPE_RMSNORM, /**<RMS NORM Layer */
LAYER_TRANSPOSE = ML_TRAIN_LAYER_TYPE_TRANSPOSE, /**< Transpose Layer type */
LAYER_UNKNOWN = ML_TRAIN_LAYER_TYPE_UNKNOWN /**< Unknown */
LAYER_UNKNOWN = ML_TRAIN_LAYER_TYPE_UNKNOWN, /**< Unknown */
LAYER_LM_HEAD = ML_TRAIN_LAYER_TYPE_LM_HEAD, /**< LM Head Layer */
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a big deal, but I think setting the LAYER_UNKNOWN at the end would be better.

/**
* @copydoc bool supportBackwarding() const
*/
bool supportBackwarding() const override { return true; };
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool supportBackwarding() const override { return true; };
bool supportBackwarding() const override { return false; };

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in the latest commit, Thank you for pointing it out.

Copy link
Contributor

@s-debadri s-debadri left a comment

Choose a reason for hiding this comment

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

LGTM

… and Update Addition Layer on GPU with latest Pipeline changes

Added initial version of LM head layer fpr GPU and removed dependencies of cl_context for addition_layer.

Signed-off-by: Yash Singh <[email protected]>
Clang format fixed and comments removed.
Rebased PR with latest changes.

Signed-off-by: Yash Singh <[email protected]>
Addressed multiple review comments
Removed unnecessary code
Added nnlayer golden files

Signed-off-by: Yash Singh <[email protected]>
Reviewed PR comments
SupportBackwarding() set to false

Signed-off-by: Yash Singh <[email protected]>
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