neuralmagic / deepsparse

Sparsity-aware deep learning inference runtime for CPUs
https://neuralmagic.com/deepsparse/
Other
2.94k stars 169 forks source link

[V2 Logger] Filters #1540

Closed horheynm closed 5 months ago

horheynm commented 6 months ago
Screenshot 2024-01-17 at 1 49 11 PM

Please review https://github.com/neuralmagic/deepsparse/pull/1533 and https://github.com/neuralmagic/deepsparse/pull/1537 first

Desctiption:

This is the juiciest component of the loggers. The PR is responsible for filtering incoming value to log or ignore based on the rules.

Rule 1. Filtering by tag. The incoming log(value, tag, log_type), will be filtered if the tag from arg does not match with any of the tag from the config (inside config.yaml) inside the root logger. The tag in the config can be a regex. Rule 2. Filtering by the number of encounters of {log_type}.{tag}.{func} for each system, metric, performance root logger after rule 1 passes. The incoming log(value, tag, log_type), may be called many times. We dont want to log every logger call. Based on the freq value in the config file, ignore any call number that is not a multiple of freq.

Usage:

Check tests