Unintuitive out of memory errors, and odd OOMs
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 928
- Fork
- 227
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I'm experimenting with TensorScope, and thus using large amounts of memory for tensors. However, when I try this, I get odd oom-related errors.
Example (kotlin):
repeat(1000) {
TFloat32.tensorOf(Shape.of(10000, 10000))
}
gives
2021-01-11 20:36:45.599992: W external/org_tensorflow/tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 400000000 exceeds 10% of free system memory.
2021-01-11 20:36:45.625897: W external/org_tensorflow/tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 400000000 exceeds 10% of free system memory.
2021-01-11 20:36:45.626092: W external/org_tensorflow/tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 400000000 exceeds 10% of free system memory.
2021-01-11 20:36:45.626180: W external/org_tensorflow/tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 400000000 exceeds 10% of free system memory.
2021-01-11 20:36:45.626262: W external/org_tensorflow/tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 400000000 exceeds 10% of free system memory.
Exception in thread "main" java.lang.NullPointerException
at org.tensorflow.internal.buffer.TensorBuffers.tensorMemory(TensorBuffers.java:180)
at org.tensorflow.internal.buffer.TensorBuffers.toFloats(TensorBuffers.java:102)
at org.tensorflow.internal.types.TFloat32Mapper.mapDense(TFloat32Mapper.java:34)
at org.tensorflow.internal.types.TFloat32Mapper.mapDense(TFloat32Mapper.java:30)
at org.tensorflow.RawTensor.asTypedTensor(RawTensor.java:215)
at org.tensorflow.Tensor.of(Tensor.java:90)
at org.tensorflow.Tensor.of(Tensor.java:63)
at org.tensorflow.types.TFloat32.tensorOf(TFloat32.java:79)
at tester.TensorScopeKt.main(TensorScope.kt:8)
at tester.TensorScopeKt.main(TensorScope.kt)
I'd think this is a fairly straight forward OOM, just without nice error messages, but the used memory in Task Manager (I'm on Windows) barely moves. I do start using heap memory, but it caps 100MB, even with -Xmx6g. Is there some limit on tensor allocations I'm not aware of?
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ Kotlin thông qua TFloat32.tensorOf và truy vết lỗi được báo cáo tại org/tensorflow/internal/buffer/TensorBuffers.java:180. So sánh các cảnh báo cấp phát native với exception phía Java và định nghĩa done là báo cáo các lỗi cấp phát bằng một lỗi chính xác, có thể hành động, thay vì NullPointerException đã quan sát được.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, kotlin
- Lĩnh vực
- machine-learning
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100