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

[onert] Revisits python API #13583

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Conversation

hseok-oh
Copy link
Contributor

@hseok-oh hseok-oh commented Aug 2, 2024

  • Rename python package: nnfwapi -> onert
  • Native library install path: "nnfwapi/onert" -> "nnfw_onert/natvie"
  • Rename binding script: "libnnfw_api_pybind.py" -> "infer.py"
  • Rename binding session class: "nnfw_session" -> "session"
  • Update documentation
  • Update example

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh [email protected]

@hseok-oh hseok-oh changed the title Draft: revise python API Draft: Revisits onert python API Aug 2, 2024
Copy link
Contributor

@jiwaszki jiwaszki left a comment

Choose a reason for hiding this comment

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

I really like this idea of renaming! It's making the API so much cleaner from user perspective.

Few small remarks in later comments. More of a clean up than anything.

Comment on lines 25 to 28
if operations:
session = nnfw_session(nnpackage_path, backends, operations)
session = nnfw_onert.onert.session(nnpackage_path, backends, operations)
else:
session = nnfw_session(nnpackage_path, backends)
session = nnfw_onert.onert.session(nnpackage_path, backends)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to point out the overload for onert.session(nnpackage_path, backends, operations) has been removed in #13468 Could it be removed in this PR along other changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I'll remove

@@ -7,9 +7,9 @@ def main(nnpackage_path, backends="cpu", operations=""):
# operations is optional to assign a specific backends to each operation.
# The default value of backends is "cpu".
if operations:
session = nnfw_session(nnpackage_path, backends, operations)
session = onert.session(nnpackage_path, backends, operations)
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
session = onert.session(nnpackage_path, backends, operations)

Same as previous comment ref: #13468 Could it be removed in this PR along other changes?

```

This definition has to be set at the top of the script using nnfw python API.

```
from nnfwapi.libnnfw_api_pybind import *
import nnfw_onert
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
import nnfw_onert
from nnfw_onert import onert

Wouldn't it be more inline with actual usage? As far as I understand nnfw_onert is just a namespace package, so pointing out to shorter path would be even better, just to use onert.something later on.

@hseok-oh
Copy link
Contributor Author

hseok-oh commented Aug 5, 2024

  • Remove deprecated 'operation' setting
  • Package name: 'nnfw-onert' -> 'onert'
    • Pair with 'onecc'
  • Binding script: 'onert.py' -> 'infer.py'
    • We may need train, I/O lib, etc

@hseok-oh hseok-oh changed the title Draft: Revisits onert python API [onert] Rivisits python API Aug 9, 2024
@hseok-oh hseok-oh marked this pull request as ready for review August 9, 2024 07:51
@hseok-oh hseok-oh added the PR/ready for review It is ready to review. Please review it. label Aug 9, 2024
@hseok-oh hseok-oh requested a review from a team August 9, 2024 07:52
@hseok-oh
Copy link
Contributor Author

hseok-oh commented Aug 9, 2024

@Samsung/one_onert PTAL

@hseok-oh hseok-oh changed the title [onert] Rivisits python API [onert] Revisits python API Aug 13, 2024
- Rename python package: nnfwapi -> onert
- Native library install path: "nnfwapi/onert" -> "nnfw_onert/natvie"
- Rename binding script: "libnnfw_api_pybind.py" -> "infer.py"
- Rename binding session class: "nnfw_session" -> "session"
- Update documentation
- Update example

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
Copy link
Contributor

@ragmani ragmani left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Contributor

@jyoungyun jyoungyun left a comment

Choose a reason for hiding this comment

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

LGTM

@hseok-oh hseok-oh merged commit 097e82c into Samsung:master Aug 14, 2024
9 checks passed
@hseok-oh hseok-oh deleted the python_api_update branch August 14, 2024 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR/ready for review It is ready to review. Please review it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants