Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rvandernoort committed Mar 31, 2023
2 parents d0fecc2 + b604f54 commit 3ac8b51
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
/results
**/runs
**/dist
**/build
*.pth
*.csv
*.png
*.egg-info
12 changes: 10 additions & 2 deletions GATorch/profilers/pyjoules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pyJoules.device.rapl_device import RaplPackageDomain, RaplDramDomain, RaplDevice
from pyJoules.device.nvidia_device import NvidiaGPUDomain, NvidiaGPUDevice
from pyJoules.energy_meter import EnergyMeter
from pyJoules.exception import NoSuchDeviceError
from .energyprofiler import EnergyProfiler

class ProfilerPyJoules(EnergyProfiler):
Expand All @@ -14,9 +15,16 @@ def __init__(self, device='cpu', index=0, disable=[]):
self.meter = EnergyMeter(devices)

def get_available_devices(self):
all_available = RaplDevice.available_domains()
try:
all_available = RaplDevice.available_domains()
except NoSuchDeviceError:
all_available = []
all_available = list(map(lambda x: x.get_domain_name(), all_available))
all_available += list(map(lambda x: x._repr.replace("_0", ""), NvidiaGPUDevice.available_domains()))
try:
nvidia_available = NvidiaGPUDevice.available_domains()
except NoSuchDeviceError:
nvidia_available = []
all_available += list(map(lambda x: x._repr.replace("_0", ""), nvidia_available))
return all_available

def check_available_devices(self, device):
Expand Down
19 changes: 17 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "GATorch"
Expand All @@ -19,6 +19,21 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
keywords = ["PyTorch", "ai", "green software"]
dependencies = [
"torch==2.0.0",
"torchvision",
"torchaudio",
"pyRAPL",
"pymongo",
"pandas",
"pyJoules",
"pyJoules[nvidia]",
"matplotlib",
"codecarbon",
"scipy",
"tensorboard"
]

[project.urls]
"Homepage" = "https://github.com/GreenAITorch/GATorch"
Expand Down

0 comments on commit 3ac8b51

Please sign in to comment.