torch-memory-saver 0.0.4__tar.gz → 0.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.1
2
+ Name: torch_memory_saver
3
+ Version: 0.0.6
4
+ Summary: UNKNOWN
5
+ Home-page: UNKNOWN
6
+ License: UNKNOWN
7
+ Platform: UNKNOWN
8
+ Requires-Python: >=3.9
9
+ License-File: LICENSE
10
+
11
+ UNKNOWN
12
+
@@ -0,0 +1,49 @@
1
+ import logging
2
+ import os
3
+ import shutil
4
+ from pathlib import Path
5
+
6
+ import setuptools
7
+ from setuptools import setup
8
+
9
+ logger = logging.getLogger(__name__)
10
+
11
+
12
+ # copy & modify from torch/utils/cpp_extension.py
13
+ def _find_cuda_home():
14
+ """Find the CUDA install path."""
15
+ # Guess #1
16
+ cuda_home = os.environ.get('CUDA_HOME') or os.environ.get('CUDA_PATH')
17
+ if cuda_home is None:
18
+ # Guess #2
19
+ nvcc_path = shutil.which("nvcc")
20
+ if nvcc_path is not None:
21
+ cuda_home = os.path.dirname(os.path.dirname(nvcc_path))
22
+ else:
23
+ # Guess #3
24
+ cuda_home = '/usr/local/cuda'
25
+ return cuda_home
26
+
27
+
28
+ cuda_home = Path(_find_cuda_home())
29
+ include_dirs = [
30
+ str(cuda_home.resolve() / 'targets/x86_64-linux/include'),
31
+ ]
32
+ library_dirs = [
33
+ str(cuda_home.resolve() / 'lib64'),
34
+ str(cuda_home.resolve() / 'lib64/stubs'),
35
+ ]
36
+
37
+ setup(
38
+ name='torch_memory_saver',
39
+ version='0.0.6',
40
+ ext_modules=[setuptools.Extension(
41
+ 'torch_memory_saver_cpp',
42
+ ['csrc/torch_memory_saver.cpp'],
43
+ include_dirs=include_dirs,
44
+ library_dirs=library_dirs,
45
+ libraries=['cuda']
46
+ )],
47
+ python_requires=">=3.9",
48
+ packages=['torch_memory_saver'],
49
+ )
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.1
2
+ Name: torch-memory-saver
3
+ Version: 0.0.6
4
+ Summary: UNKNOWN
5
+ Home-page: UNKNOWN
6
+ License: UNKNOWN
7
+ Platform: UNKNOWN
8
+ Requires-Python: >=3.9
9
+ License-File: LICENSE
10
+
11
+ UNKNOWN
12
+
@@ -1,5 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: torch_memory_saver
3
- Version: 0.0.4
4
- Requires-Python: >=3.9
5
- License-File: LICENSE
@@ -1,19 +0,0 @@
1
- import logging
2
-
3
- import setuptools
4
- from setuptools import setup
5
-
6
- logger = logging.getLogger(__name__)
7
-
8
- setup(
9
- name='torch_memory_saver',
10
- version='0.0.4',
11
- ext_modules=[setuptools.Extension(
12
- 'torch_memory_saver_cpp',
13
- ['csrc/torch_memory_saver.cpp'],
14
- extra_compile_args=['-I/usr/local/cuda/include'],
15
- extra_link_args=['-lcuda'],
16
- )],
17
- python_requires=">=3.9",
18
- packages=['torch_memory_saver'],
19
- )
@@ -1,5 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: torch_memory_saver
3
- Version: 0.0.4
4
- Requires-Python: >=3.9
5
- License-File: LICENSE