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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fabric imports for HPU strategies #126

Merged
merged 8 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased version] - YYYY-MM-DD

### Added

-

### Changed



### Fixed

- Fixed fabric imports for HPU strategies ([#126](https://github.com/Lightning-AI/lightning-Habana/pull/126))

### Removed

-

### Deprecated

-


## [1.3.0] - 2023-12-06

### Added
Expand All @@ -20,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

-
- Fixed fabric imports for HPU strategies ([#126](https://github.com/Lightning-AI/lightning-Habana/pull/126))

### Removed

Expand Down
2 changes: 1 addition & 1 deletion src/lightning_habana/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.3.0"
__version__ = "1.4.0-dev0"
jerome-habana marked this conversation as resolved.
Show resolved Hide resolved
__author__ = "Lightning-AI et al."
__author_email__ = "name@lightning.ai"
__license__ = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions src/lightning_habana/fabric/accelerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
from lightning_utilities import module_available

if module_available("lightning"):
from lightning.pytorch.accelerators.accelerator import Accelerator
from lightning.fabric.accelerators import Accelerator
elif module_available("pytorch_lightning"):
from pytorch_lightning.accelerators.accelerator import Accelerator
from lightning_fabric.accelerators import Accelerator
else:
raise ModuleNotFoundError("You are missing `lightning` or `pytorch-lightning` package, please install it.")

Expand Down
2 changes: 1 addition & 1 deletion src/lightning_habana/fabric/strategies/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def determine_ddp_device_ids(self) -> None:
# return obj[0]

def backward(self, tensor: Tensor, module: Optional[Module], *args: Any, **kwargs: Any) -> None:
super().backward(tensor=Tensor, module=module, args=args, kwargs=kwargs)
super().backward(tensor, module=module, args=args, kwargs=kwargs)
if _TORCH_LESSER_EQUAL_1_13_1:
# Break lazy accumulation of graph after fwd+bwd
htcore.mark_step()
Expand Down
2 changes: 1 addition & 1 deletion src/lightning_habana/fabric/strategies/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def checkpoint_io(self, io: Optional[CheckpointIO]) -> None:
self._checkpoint_io = io

def backward(self, tensor: Tensor, module: Optional[Module], *args: Any, **kwargs: Any) -> None:
super().backward(tensor=Tensor, module=module, *args, **kwargs)
super().backward(tensor, module=module, *args, **kwargs)
if _TORCH_LESSER_EQUAL_1_13_1:
# Break lazy accumulation of graph after fwd+bwd
htcore.mark_step()
Expand Down