Add HPU support to leakpro#425
Open
Muhaddisabarat wants to merge 5 commits into
Open
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
- leakpro/__init__.py: drop typing.Any in __getattr__ (use object + TYPE_CHECKING block so `from leakpro import LeakPro` still resolves for type checkers); replace inner try/except/pass with contextlib.suppress to silence S110; suppress PLC0415 on the deliberate deferred imports that keep `import leakpro` resilient to a broken torch install. - leakpro/utils/hardware_setup.py: same PLC0415 suppression on the intentional fault-tolerant `import torch` and lazy get_device import. - leakpro/utils/seed.py: PLC0415 suppression on the habana_frameworks import that only fires when the device is HPU. Verified with `ruff==0.11.2 check leakpro/` (matches CI version).
e0af62f to
01c875d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of changes
Many files have been modified mostly based on import get.device
2 files added.
a) leakpro/utils/hardware_setup.py (Hardware selection order )
habana_frameworks.torchis installed and reports an available device).torch.cuda.is_available()).b) leakpro/utils/device.py (Hardware detection utility for selecting the runtime device).