GenericTensor 2.0
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- csharp
- Lĩnh vực
- data, performance
Hướng nghiên cứu
Bắt đầu bằng việc lập danh mục interface lớn hiện tại, kiểu tensor tổng quát, các phép biến đổi thưa và các entry point hiện có được mô tả trong issue. So sánh các interface dành riêng cho từng action được đề xuất, các API của Tensor dense và TensorView, các tùy chọn tăng tốc, những thay đổi về cách đặt tên và thao tác ConvolutedMap trước khi giải quyết các câu hỏi còn bỏ ngỏ về số chiều. Hoàn thành có nghĩa là có một thiết kế đã được thống nhất và một kế hoạch API tương thích đã được triển khai, thay vì một chỉnh sửa đơn lẻ, tách biệt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
GenericTensor 2.0: plan
Alright, time for improvement
1 action - 1 interface
Currently we have a large interface which forces the user to implement all its methods. It's not as good as it was thought to be:
- You may want not to implement a method, but you can't guess whether some GT's function uses it or not
- The interface is not extendable - adding a new method immediately breaks backward comaptibility
Instead, we will have one method in each interface (there will be multiple interfaces - like IAddAction<A, B, C> etc.).
Now we will be able to constrain each function separately, and the tensor itself won't be constrained (the type will have only one type argument - T). It makes all things much more convenient, and it also allows for more advanced API - for example, adding tensors would look like:
Tensor<C> AddElementwise<A, B, C, TAdd>(Tensor<A> a, Tensor<B> b) where TAdd : IAdd<A, B, C>
Non-generic entry point class API
Currently we need to type the typename with its arguments. Instead, there will be a non-generic static class to handle those things: thanks to type inference, we will type less.
No sparse transformation
Currently, there are some transformations, like transposition and slicing, which makes the tensor "sparse" - that is, instead of rewriting elements themselves, they rewrite the meanings of indices. That means, that going over a just created 2D tensor by width and height would be much faster than if we transpose that tensor beforehand.
In new API such a feature will remain in some different more explicit form, for example, TensorView<T>. It behaves similarly to BCL's Span<T>, which is basically a view on some piece of memory. Likewise, TensorView just allows to read/write to a tensor, but is not a tensor itself. Might be useful for some operations, where the user doesn't want to think about the order of axes or size of a tensor. Though not all API will be available for TensorView<T>.
But tensors itself will be strictly linear/dense. Slicing and transposition will produce a new dense tensor.
Hardware acceleration
Now, with dense tensors we can use three types of acceleration:
- Multithreading
- SIMD (HonkPerf.NET.GenericSIMD)
- GPU
Though the third one is questioned, the first two are definitely doable and will require new methods with type constrained to unmanaged. As simple as that.
New project name - GenericTensor.NET. New type name - Tensor.
Alright, this one is questionable. Should we rename to a more "modern" name? It would mean a new "slot" in nuget packages, and hence, not visible by current users (if there are any aside from AngouriMath, hehe).
New operations
We could implement convoluted map for it. Example of convoluted map:
Imagine matrix A
1 2 3
4 5 6
7 8 9
and then code:
B = A.ConvolutedMap(width: 2, height: 2, step: 1, view: TensorView -> view[0, 0] + view[0, 1] + view[1, 0] + view[1, 1]);
then B is
12 16
24 28
This way we can basically process, reshape, "bend", collapse or add axes anyhow we need. Upscale for instance:
A =
1 2 3
4 5 6
7 8 9
B = A.ConvolutedMap(
inputWidth: 2,
inputHeight: 2,
step: 2,
outputWidth: 3,
outputHeight: 3,
(source: TensorView, destination: TensorView) ->
destination[0, 0] = source[0, 0]
destination[0, 2] = source[0, 1]
destination[2, 0] = source[1, 0]
destination[2, 2] = source[1, 1]
destination[0, 1] = (destination[0, 0] + destination[0, 2]) / 2
destination[1, 0] = (destination[0, 0] + destination[2, 1]) / 2
etc...
)
Note, that we don't limit to 2d convolution here, though not sure where we could ever need 4D+ convolutions.
Unresolved questions
Should there be single type Tensor or by dimension - Tensor1D, Tensor2D, etc.? If the latter, should there be TensorND or just cover a fixed number of dimensions?
- Ngôn ngữ chính
- C#
- Star
- 52
- Fork
- 6
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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.
Issue khác của ASC-Community/GenericTensor
-
Determinant and Inverse return wrong values when called from more than one threadCó thể đã có người làm @Rafael-SOWNet đã nhận 32 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Null reference warnings to fixĐang mởgood first issue
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
proposal
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
ASC-Community/GenericTensor#36 · 1 bình luận ·
-
Opinions wanted proposal
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
ASC-Community/GenericTensor#31 · 2 bình luận ·
-
Will this package support MKL or OpenBlas as backend to accelerate matrix inverse computing speedĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
ASC-Community/GenericTensor#30 · 1 bình luận ·
Tất cả issue của ASC-Community/GenericTensor
Issue tương tự
-
Bug: Hidden loading rings keep the compositor running, so Files uses 7-94% of a CPU core while idleĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
files-community/Files#19026 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
BHoM/Civil3D_Toolkit#118 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
rjmurillo/moq.analyzers#1468 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
-
test(e2e): the signed-in CSP spec times out behind the match-setup dialog and asserts nothingĐang mởarea:frontend FE P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
klasolsson81/jobbliggaren#2139 ·
Maintainer thường phản hồi trong vòng 1 ngày