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

[api] Let single handle flexible filter #574

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

Conversation

anyj0527
Copy link
Member

  • Let single API handle flexible filter (executorch-llama)
  • Add a enum for new nnfw EXECUTORCH_LLAMA
  • Add a simple disabled test to show how to use executorch-llama with single api

- Add a enum for new nnfw `EXECUTORCH_LLAMA`

Signed-off-by: Yongjoo Ahn <[email protected]>
@taos-ci
Copy link
Collaborator

taos-ci commented Oct 29, 2024

📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #574. 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/.

- Let single API handle flexible filter (executorch-llama)

Signed-off-by: Yongjoo Ahn <[email protected]>
- Add a simple test to show how to use executorch-llama with single api

Signed-off-by: Yongjoo Ahn <[email protected]>
Copy link
Collaborator

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

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

ml_tensors_info_set_tensor_type (in_info, 0, ML_TENSOR_TYPE_UINT8);
ml_tensors_info_set_tensor_dimension (in_info, 0, dim);

ml_tensors_data_create (in_info, &in_data);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about checking if in_data is created properly?

status = ml_tensors_data_create (in_info, &in_data);
EXPECT_EQ (status, ML_ERROR_NONE);

ml_tensors_info_set_tensor_dimension (in_info, 0, dim);

ml_tensors_data_create (in_info, &in_data);
ml_tensors_data_set_tensor_data (in_data, 0, prompt.c_str (), prompt.size () + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's check the result, how about you?
EXPECT_EQ (status, ML_ERROR_NONE);

Copy link
Contributor

@songgot songgot left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@@ -1083,6 +1090,11 @@ ml_single_open_custom (ml_single_h * single, ml_single_preset * info)
status = ML_ERROR_STREAMS_PIPE;
goto error;
}
/* handle flexible single */
if (info->nnfw == ML_NNFW_TYPE_EXECUTORCH_LLAMA) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think if there are more flexible filter, we may revise this part later.
The llama2c filter I created doesn't seem to be scalable due to API limitations, so I won't add it now.

Copy link
Contributor

@niley7464 niley7464 left a comment

Choose a reason for hiding this comment

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

LGTM :)

@@ -75,6 +75,7 @@ typedef enum {
ML_NNFW_TYPE_NCNN = 18, /**< Tencent ncnn (Since 9.0) */
ML_NNFW_TYPE_TENSORRT = 19, /**< NVidia Tensor-RT (Since 9.0) */
ML_NNFW_TYPE_QNN = 20, /**< Qualcomm QNN (Qualcomm® AI Engine Direct) (Since 9.0) */
ML_NNFW_TYPE_EXECUTORCH_LLAMA = 21, /**< ExecuTorch Llama runner */
Copy link
Member

Choose a reason for hiding this comment

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

Add Tizen version requirement

@@ -75,6 +75,7 @@ typedef enum {
ML_NNFW_TYPE_NCNN = 18, /**< Tencent ncnn (Since 9.0) */
ML_NNFW_TYPE_TENSORRT = 19, /**< NVidia Tensor-RT (Since 9.0) */
ML_NNFW_TYPE_QNN = 20, /**< Qualcomm QNN (Qualcomm® AI Engine Direct) (Since 9.0) */
ML_NNFW_TYPE_EXECUTORCH_LLAMA = 21, /**< ExecuTorch Llama runner */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you separate new PR and add github label for next ACR?

@jaeyun-jung
Copy link
Collaborator

Please do not merge this until tizen gbm release is done!

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.

6 participants