Skip to content

Commit

Permalink
linter stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegmd committed Feb 4, 2024
1 parent eb300b6 commit 67c70d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""setup.py for axolotl"""

import platform
from importlib.metadata import PackageNotFoundError, version

from packaging.version import Version, parse
import platform
from setuptools import find_packages, setup


Expand Down
1 change: 1 addition & 0 deletions src/axolotl/utils/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def gpu_memory_usage_all(device=0):
smi = gpu_memory_usage_smi(device)
return usage, reserved - usage, max(0, smi - reserved)


def mps_memory_usage_all():
usage = torch.mps.current_allocated_memory() / 1024.0**3
reserved = torch.mps.driver_allocated_memory() / 1024.0**3
Expand Down
2 changes: 1 addition & 1 deletion src/axolotl/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def load_model(
):
model.config.eos_token_id = tokenizer.eos_token_id

if hasattr(model, "device") and (model.device.type == "cuda" or model.device.type == "mps"):
if hasattr(model, "device") and model.device.type in ("cuda", "mps"):
log_gpu_memory_usage(LOG, "after model load", model.device)

# make sure these are fp32 per Ramesh et al. (2021)
Expand Down

0 comments on commit 67c70d1

Please sign in to comment.