Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 6, 2024
1 parent fb189f5 commit eb55a17
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 23 deletions.
14 changes: 7 additions & 7 deletions .azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
In general follow instructions in [Bare Metal Fresh OS Installation](https://docs.habana.ai/en/v1.15.0/Installation_Guide/Bare_Metal_Fresh_OS.html#) and in particular [Habana Driver Unattended Upgrade](https://docs.habana.ai/en/v1.15.0/Installation_Guide/Bare_Metal_Fresh_OS.html#habana-driver-unattended-upgrade).

1. check what is the actual state and version of HW - `hl-smi`
1. check the actual OS version - `lsb_release -a`
1. update sources - `sudo apt update --fix-missing`
1. run upgrade to the latest - `sudo apt upgrade`
1. reboot the machine...
2. check the actual OS version - `lsb_release -a`
3. update sources - `sudo apt update --fix-missing`
4. run upgrade to the latest - `sudo apt upgrade`
5. reboot the machine...

### Troubleshooting

Expand All @@ -25,19 +25,19 @@ In some cases you may get stack with hanged libs linked to past kernel (for exam
sudo mv /var/lib/dpkg/info_old /var/lib/dpkg/info
sudo apt-get update && sudo apt-get -f install
```
1. purge the hanging package
2. purge the hanging package
```bash
apt list --installed | grep habana
sudo rm /var/lib/dpkg/info/habanalabs-dkms*
sudo dpkg --configure -D 777 habanalabs-dkms
sudo apt -f install
sudo apt purge habanalabs-dkms
```
1. if the package folder hangs, drop it:
3. if the package folder hangs, drop it:
```bash
sudo rm -rf /var/lib/dkms/habanalabs-dkms
```
1. install all, if some failed try rerun the script
4. install all, if some failed try rerun the script
```bash
wget -nv https://vault.habana.ai/artifactory/gaudi-installer/latest/habanalabs-installer.sh
chmod +x habanalabs-installer.sh
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ assignees: ''
Steps to reproduce the behavior:

1. Go to '...'
1. Run '....'
1. Scroll down to '....'
1. See error
2. Run '....'
3. Scroll down to '....'
4. See error

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: ''
For typos and doc fixes, please go ahead and:

1. Create an issue.
1. Fix the typo.
1. Submit a PR.
2. Fix the typo.
3. Submit a PR.

Thanks!
8 changes: 1 addition & 7 deletions examples/fabric/image_classifier/train_fabric.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,7 @@ def run(hparams):
optimizer.step()
if (batch_idx == 0) or ((batch_idx + 1) % hparams.log_interval == 0):
print(
"Train Epoch: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}".format(
epoch,
batch_idx * len(data),
len(train_loader.dataset),
100.0 * batch_idx / len(train_loader),
loss.item(),
)
f"Train Epoch: {epoch} [{batch_idx * len(data)}/{len(train_loader.dataset)} ({100.0 * batch_idx / len(train_loader):.0f}%)]\tLoss: {loss.item():.6f}"
)
if hparams.dry_run:
break
Expand Down
2 changes: 1 addition & 1 deletion src/lightning_habana/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from lightning_utilities import compare_version

from lightning_habana.__about__ import * # noqa: F401, F403
from lightning_habana.__about__ import * # noqa: F403
from lightning_habana.pytorch.accelerator import HPUAccelerator
from lightning_habana.pytorch.datamodule.datamodule import HPUDataModule
from lightning_habana.pytorch.plugins.deepspeed_precision import HPUDeepSpeedPrecisionPlugin
Expand Down
4 changes: 2 additions & 2 deletions src/lightning_habana/pytorch/plugins/deepspeed_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def backward(
"You have overridden the `LightningModule.backward` hook but it will be ignored since DeepSpeed handles"
" the backward logic internally."
)
deepspeed_engine: "deepspeed.DeepSpeedEngine" = model.trainer.model
deepspeed_engine: deepspeed.DeepSpeedEngine = model.trainer.model
deepspeed_engine.backward(tensor, *args, **kwargs)

def optimizer_step(
Expand All @@ -124,7 +124,7 @@ def optimizer_step(
"Skipping backward by returning `None` from your `training_step` is not supported by `DeepSpeed`"
)
# DeepSpeed handles the optimizer step internally
deepspeed_engine: "deepspeed.DeepSpeedEngine" = model.trainer.model
deepspeed_engine: deepspeed.DeepSpeedEngine = model.trainer.model
return deepspeed_engine.step(**kwargs)

def clip_gradients(
Expand Down
2 changes: 1 addition & 1 deletion src/lightning_habana/pytorch/plugins/precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def __init__(
self.device = device
self.precision = precision

self.recipe: Union[Mapping[str, Any], "DelayedScaling"] = None
self.recipe: Union[Mapping[str, Any], DelayedScaling] = None
self.replace_layers = False
self.fp8_training_available = False
self.fp8_inference_available = False
Expand Down

0 comments on commit eb55a17

Please sign in to comment.