Skip to content

Commit

Permalink
Add GPU device compute capability check for LTensor (#803)
Browse files Browse the repository at this point in the history
### 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
      [`tests`](../tests) 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`.

- [x] Add a new entry to the `.github/CHANGELOG.md` file, summarizing
the
      change, and including a link back to the PR.

- [x] Ensure that code is properly formatted by running `make format`. 

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


------------------------------------------------------------------------------------------------------------

**Context:**

Add GPU device compute capability check. L-Tensor has device compute
capability check like L-GPU now.
[SC-69118]

**Description of the Change:**

**Benefits:**

Error will be raised when running `lightning.tensor` on a unsupported
GPU.

**Possible Drawbacks:**

**Related GitHub Issues:**

#799

---------

Co-authored-by: ringo-but-quantum <[email protected]>
  • Loading branch information
multiphaseCFD and ringo-but-quantum authored Jul 17, 2024
1 parent 7deee74 commit c81ce7d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

### Improvements

* Add GPU device compute capability check for Lightning-Tensor.
[(#803)](https://github.com/PennyLaneAI/pennylane-lightning/pull/803)

* Refactor CUDA utils Python bindings to a separate module.
[(#801)](https://github.com/PennyLaneAI/pennylane-lightning/pull/801)

Expand Down
2 changes: 1 addition & 1 deletion pennylane_lightning/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.38.0-dev9"
__version__ = "0.38.0-dev10"
9 changes: 8 additions & 1 deletion pennylane_lightning/lightning_tensor/lightning_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@

try:
# pylint: disable=import-error, unused-import
from pennylane_lightning.lightning_tensor_ops import backend_info
from pennylane_lightning.lightning_tensor_ops import (
backend_info,
get_gpu_arch,
is_gpu_supported,
)

if not is_gpu_supported(): # pragma: no cover
raise ValueError(f"CUDA device is an unsupported version: {get_gpu_arch()}")

LT_CPP_BINARY_AVAILABLE = True
except ImportError:
Expand Down

0 comments on commit c81ce7d

Please sign in to comment.