Comments (3)
So far, the experiments show the split
option that anyway assumes that the entire array fits into memory. Do the same spikes also occure for is_split
? (In my opinion this would be a larger problem because in the is_split option one might work with arrays that are that large that memory really can become a problem easily)
from heat.
Branch bugs/1412-_Bug_High_memory_consumption_spikes_in_ht_array_method created!
from heat.
Did some further experimenting, found out that the spikes appear because I was printing the first element of each array after creating/copying the DNDArray.
I will close the issue now, but leave the script for future reference:
import heat as ht
import time
import argparse
import numpy as np
import torch as pt
import perun
import time
matrix_size = 750
factories = {
"heat": {
"zeros": ht.zeros,
"ones": ht.ones,
"random": ht.random.random
},
"torch": {
"zeros": pt.zeros,
"ones": pt.ones,
"random": pt.rand
},
"numpy": {
"zeros": np.zeros,
"ones": np.ones,
"random": np.random.random
}
}
if __name__ == "__main__":
# Application should accept the following arguments: device, split, copy, factory, source
# Parse arguments
parser = argparse.ArgumentParser(description='Memory test')
parser.add_argument('--device', type=str, default='cpu', help='Device to use [cpu, gpu]')
parser.add_argument('--split', type=int, default=-1, help='Split [None, 0, 1, 2]')
parser.add_argument('--copy', type=str, default="false", help='Copy [false, true]')
parser.add_argument('--factory', type=str, default='zeros', help='Factory [zeros, ones, random]')
parser.add_argument('--source', type=str, default='numpy', help='Source, [numpy, torch, heat]')
args = parser.parse_args()
print(args)
device = args.device
split = args.split if args.split != -1 else None
copy = True if args.copy == "true" else False
factory = args.factory
source = args.source
if device == "cpu":
pt.set_default_device("cpu")
ht.use_device("cpu")
elif device == "gpu":
pt.set_default_device("cuda")
ht.use_device("gpu")
print(f"{ht.comm.rank}: Start")
start = time.time()
time.sleep(2)
print(f"{ht.comm.rank}: Create: {time.time() - start}")
if source == "heat":
original = factories[source][factory]((matrix_size, matrix_size, matrix_size), split=None, dtype=ht.float32)
elif source == "torch":
original = factories[source][factory]((matrix_size, matrix_size, matrix_size), dtype=pt.float32)
elif source == "numpy":
original = factories[source][factory]((matrix_size, matrix_size, matrix_size)).astype(np.float32)
time.sleep(2)
print(f"{ht.comm.rank}: Copy: {time.time() - start}")
copy = ht.array(original, split=split, copy=copy)
copy += 1
print(f"{ht.comm.rank}: Copy done {time.time() - start}")
print(original[0,0,0])
time.sleep(2)
print(f"{ht.comm.rank}: Delete: {time.time() - start}")
del original
del copy
pt.cuda.empty_cache()
time.sleep(2)
print(f"{ht.comm.rank}: End: {time.time() - start}")
from heat.
Related Issues (20)
- [Bug]: versioning on main branch HOT 1
- Speed up `ht.percentile` HOT 3
- Declutter automated release notes HOT 2
- Support 2-D convolution on n-D arrays HOT 2
- Implement unfold-operation similar to `torch.Tensor.unfold` HOT 2
- Implement sketched percentile HOT 2
- [Bug]: Scorecard analysis failure HOT 5
- Support new PyTorch release
- [Bug]: Citation file cannot be parsed HOT 2
- [Bug]: `solve_triangular` fails in unit tests on `main` HOT 2
- [Bug]: Changelog update after release did not happen automatically HOT 2
- Allow random arrays of arbitrary size / speed up random arrays HOT 3
- Add decomposition-module and PCA-interface HOT 2
- Add tall-skinny SVD HOT 2
- Add randomized SVD
- Add incremental SVD/PCA
- [Bug]: `_like` factory functions mistakenly set device to Default
- Support new PyTorch release
- Update spack recipe and RELEASE docs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heat.