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

Telemetry coverage extension #3039

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

KodiaqQ
Copy link
Collaborator

@KodiaqQ KodiaqQ commented Oct 25, 2024

Changes

  • Extended coverage for telemetry.

Reason for changes

  • Telemetry update.

Related tickets

  • 154833

Tests

  • TBD

New categories/events are introduced:

Method Event category Event name Event label
nncf.strip MODEL_BASED function_call nncf.strip
nncf.data....generate_text_data nncf function_call nncf.data.generate_text_data
nncf.torch....wrap_model nncf_pt function_call nncf.torch.wrap_model
nncf.torch....load_from_config nncf_pt function_call nncf.torch.load_from_config
nncf.torch....get_config nncf_pt function_call nncf.torch.nncf_network.NNCFNetwork.get_config

@KodiaqQ KodiaqQ marked this pull request as ready for review October 25, 2024 10:23
@KodiaqQ KodiaqQ requested a review from a team as a code owner October 25, 2024 10:23
@github-actions github-actions bot added NNCF PT Pull requests that updates NNCF PyTorch NNCF Common Pull request that updates NNCF Common labels Oct 25, 2024

TModel = TypeVar("TModel")


@api(canonical_alias="nncf.strip")
@tracked_function(category=NNCF_COMMON_CATEGORY, extractors=[ModelProcessedWithStripApi()])
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to use MODEL_BASED_CATEGORY.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

@@ -15,6 +15,9 @@
from nncf.common.utils.backend import BackendType
from nncf.common.utils.backend import get_backend

# General categories
NNCF_COMMON_CATEGORY = "nncf_common"
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
NNCF_COMMON_CATEGORY = "nncf_common"
NNCF_CATEGORY = "nncf"

Copy link
Collaborator Author

@KodiaqQ KodiaqQ Oct 30, 2024

Choose a reason for hiding this comment

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

It does make no sense in terms of the categorisation. For example, nncf_ov or nncf_onnx may be the subsets of the nncf category, but not nncf_common. The originally proposed category reflects the category's differences.
IMHO.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

extractors=[
DatasetGeneratedFromApi(),
],
)
def generate_text_data(
Copy link
Contributor

Choose a reason for hiding this comment

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

Please mark this function with the api decorator.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.


class ModelProcessedWithStripApi(TelemetryExtractor):
def extract(self, _: Any) -> CollectedEvent:
return CollectedEvent(name="model_processed", data="strip_api")
Copy link
Contributor

@alexsu52 alexsu52 Oct 30, 2024

Choose a reason for hiding this comment

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

@KodiaqQ, @MaximProshin, @AlexKoff88 I would suggest to introduce function_call event to cover calling all NNCF functions instead of using named events, as following:

return CollectedEvent(name="function_call", data="nncf.strip")

I would like to know your opinion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds reasonable to me.
In this case, we'll have one event with different data values.
The only question is whether it is possible to analyse such an event in the front end.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable to me. In this case, we'll have one event with different data values. The only question is whether it is possible to analyse such an event in the front end.

I will try to clarify this question.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any updates? Should we do something with this PR or just hold?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds reasonable to me. In this case, we'll have one event with different data values. The only question is whether it is possible to analyse such an event in the front end.

@popovaan, could you provide your opinion?

Copy link

Choose a reason for hiding this comment

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

I see no problems in usage of common function_call event name and it is convenient in terms of making a report, as all values can be collected using only one filter Event name==function_call.

If you want a separate group of function calls, which are needed to be a separate table in report (for example, function calls that raised error), you can introduce another event name to group them. For example: failed_function_call. Otherwise separate names per method are redundant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@alexsu52 what should we do here then?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

@KodiaqQ KodiaqQ marked this pull request as draft December 9, 2024 08:01
@github-actions github-actions bot added the API Public API-impacting changes label Dec 9, 2024
@KodiaqQ KodiaqQ requested a review from alexsu52 December 9, 2024 12:06
@KodiaqQ KodiaqQ marked this pull request as ready for review December 9, 2024 12:06
@KodiaqQ
Copy link
Collaborator Author

KodiaqQ commented Dec 17, 2024

Do we need this, @alexsu52, @MaximProshin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Public API-impacting changes NNCF Common Pull request that updates NNCF Common NNCF PT Pull requests that updates NNCF PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants