-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GPU filter operator (2D, 3D) #4525
Conversation
!build |
CI MESSAGE: [6915075]: BUILD STARTED |
CI MESSAGE: [6915075]: BUILD FAILED |
!build |
CI MESSAGE: [6915466]: BUILD STARTED |
CI MESSAGE: [6915466]: BUILD PASSED |
the filter and the image. | ||
|
||
)code") | ||
.NumInput(2, 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.NumInput(2, 3) | |
.NumInput(2, 3) | |
.InputDox(0, "data", "TensorList", R"code(Batch of input data.)code") | |
.InputDox(1, "filter", "TensorList", R"code(Batch of filters.)code") | |
.InputDox(2, ...) |
Please add documentation of the inputs, and perhaps remove the sentence in line 25.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I moved whole sections from the main description to relevant parameters' docs.
|
||
.. note:: | ||
In fact, the operator computes a correlation, not a convolution, | ||
i.e. the order of filter elements is not flipped when computing product of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e. the order of filter elements is not flipped when computing product of | |
i.e. the order of filter elements is not flipped when computing the product of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dine
.NumOutput(1) | ||
.AllowSequences() | ||
.AddOptionalArg("anchor", | ||
R"code(Specifies position of the filter over the input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R"code(Specifies position of the filter over the input. | |
R"code(Specifies the position of the filter over the input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
namespace filter { | ||
|
||
extern template std::unique_ptr<OpImplBase<GPUBackend>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: use a macro to reduce verbosity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
fill_value_bacthes = [list(fvs) for _, _, fvs in batches] | ||
|
||
@pipeline_def | ||
def piepline(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def piepline(): | |
def pipeline(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
const filter::InputDesc& input_desc); | ||
|
||
bool SetupImpl(std::vector<OutputDesc>& output_desc, const Workspace& ws) override { | ||
if (!impl_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about checking that the current impl_ instance matches the previous input and filter type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense on the one hand, on the other isn't it something that should the exectur do?
!build |
CI MESSAGE: [6922910]: BUILD FAILED |
!build |
CI MESSAGE: [6923202]: BUILD FAILED |
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Add variable batch size test Add volumetric tests Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski <[email protected]>
I had to rebase over the operator tests split. |
!build |
CI MESSAGE: [6923309]: BUILD STARTED |
CI MESSAGE: [6923309]: BUILD PASSED |
.AddOptionalArg("border", | ||
R"code(Controls how to handle out-of-bound filter positions over the sample. | ||
|
||
Supported values are: ``"reflect_101"``, ``"reflect_1001"``, ``"wrap"``, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the tests I've seen just "101" and "1001" values and not "reflect_*". Is it something different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same, just out of convenience.
The boundary.h
if (type == "reflect_1001" || type == "reflect1001" || type == "1001")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, understood
* Add GPU filter operator (2D, 3D) Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Kamil Tokarski [email protected]
Category:
New feature (non-breaking change which adds functionality)
Description:
Adds GPU filter operator (2D and 3D convolutions with use-provided filters).
The relevant kernel part was merged here: #4298
Additional information:
border
- what values to use to "pad" the input, possible modes are reflect 101, reflect 1001, wrap, clamp and constant. If the constant mode is used, user can provide a third argument that contains scalars to be used as a padding.anchor
- enables user to shift filter placement over the imagemode
parameter which can be "same" (default) or "valid".Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: DALI-2951