-
Notifications
You must be signed in to change notification settings - Fork 586
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
Expand logging configuration support in PennyLane, and also target Catalyst #5528
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5528 +/- ##
==========================================
- Coverage 99.67% 99.53% -0.15%
==========================================
Files 416 418 +2
Lines 38686 38873 +187
==========================================
+ Hits 38562 38691 +129
- Misses 124 182 +58 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mlxd! Please could you tag the corresponding Shortcut story?
[sc-61591] |
### Before submitting Please complete the following checklist when submitting a PR: - [ ] All new features must include a unit test. If you've fixed a bug or added code that should be tested, add a test to the test directory! - [ ] All new functions and code must be clearly commented and documented. If you do make documentation changes, make sure that the docs build and render correctly by running `make docs`. - [ ] Ensure that the test suite passes, by running `make test`. - [ ] Add a new entry to the `doc/releases/changelog-dev.md` file, summarizing the change, and including a link back to the PR. - [ ] The PennyLane source code conforms to [PEP8 standards](https://www.python.org/dev/peps/pep-0008/). We check all of our code against [Pylint](https://www.pylint.org/). To lint modified files, simply `pip install pylint`, and then run `pylint pennylane/path/to/file.py`. When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** This PR expands the logging functionality in PennyLane for both internal and inter-library (e.g. Lightning, Catalyst) use. **Description of the Change:** Add support for decorator-defined logging functions, and updates the internal usage of logging with this. **Benefits:** Allows more ease-of-use by developers to include logging with new functionality to the library. **Possible Drawbacks:** Does not replace custom-defined log-level messages and trace-level expansion of functions. **Related GitHub Issues:** #5528
…I/pennylane into update/logging_rules_catalyst
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
FYI, the CodeCov complaints are due to the newly added untestable source. We ignore these as pytest-runs are negatively impacted in CI runtime if these are hit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mlxd
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
### Before submitting Please complete the following checklist when submitting a PR: - [x] All new functions and code must be clearly commented and documented. - [x] Ensure that code is properly formatted by running `make format`. The latest version of black and `clang-format-14` are used in CI/CD to check formatting. - [ ] All new features must include a unit test. Integration and frontend tests should be added to [`frontend/test`](../frontend/test/), Quantum dialect and MLIR tests should be added to [`mlir/test`](../mlir/test/), and Runtime tests should be added to [`runtime/tests`](../runtime/tests/). When all the above are checked, delete everything above the dashed line and fill in the pull request template. ------------------------------------------------------------------------------------------------------------ **Context:** PennyLane's [logging support](https://docs.pennylane.ai/en/stable/introduction/logging.html) allows developers to explore the execution pipeline end-to-end, while tying into the Python-native logging framework. This has the advantage of being enterprise ready, consumable by a variety of log sinks, and unifies/removes the need for adding `print` statements throughout a code-base, with all control to be handled by the Python [language standard libraries](https://docs.python.org/3/library/logging.html). This PR aims to unify Catalyst to follow the same design as PennyLane to support logging with the same unified configuration, allowing ease of examining of function entry points at the `DEBUG` level, and a custom `TRACE` method for expanding functions passed as arguments. **Description of the Change:** Adds preliminary support to a variety of Catalyst frontend public API entry-points. Any workload using `qml.logging.enable_logging()` allows the function entry data to be streamed to the pre-configured log-handlers from PennyLane. **Benefits:** More easily allows time-order and standardised data formatting for consumption with complex application execution, debugging, and end-to-end validation of call-points. **Possible Drawbacks:** **Related GitHub Issues:** PennyLaneAI/pennylane#5528 --------- Co-authored-by: David Ittah <dime10@users.noreply.github.com>
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
test directory!
All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs
.Ensure that the test suite passes, by running
make test
.Add a new entry to the
doc/releases/changelog-dev.md
file, summarizing thechange, and including a link back to the PR.
The PennyLane source code conforms to
PEP8 standards.
We check all of our code against Pylint.
To lint modified files, simply
pip install pylint
, and thenrun
pylint pennylane/path/to/file.py
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context: To better unify PennyLane's logging support, updates to control PennyLane's logging behaviour enabling use with Catalyst allow a unified way to examine execution pipelines throughout the Pythonic layer. This PR expands the configuration of logging, allowing direct editing by a user, as well as adds new module-level log-levels for Catalyst, and expands jax to also enable logging with jaxlib. The above will be useful to define interactions across components in the ecosystem, and aid in building a model of explicit interactions across the packages.
Description of the Change: As above.
Benefits: Expands the logging framework to be more configurable, and extends upcoming support for Catalyst.
Possible Drawbacks:
Related GitHub Issues: