Skip to content
Snippets Groups Projects

[Add] first MetaOperator implementation: PaddedConv

Merged Maxence Naud requested to merge feat_add-first-metaop-impl into dev
1 unresolved thread

Context

This implementation works but is not fed to the Registrar system because it is less efficient than the combination of Pad->Conv in MetaOperator with an optimized non-padded convolution.

Modified files

  • PaddedConvImpl.hpp
  • PaddedConvImpl.cpp
  • PaddedConvImpl_kernel.hpp

Detailed major modifications

Add first functional metaoperator implementation.

TODO

  • Optimize the implementation inference time
Edited by Maxence Naud

Merge request reports

Merge request pipeline #60529 passed

Merge request pipeline passed for 887e6ee8

Merged by Maxence NaudMaxence Naud 3 months ago (Dec 2, 2024 10:37am UTC)

Loading

Pipeline #60606 passed

Pipeline passed for 8b99d4f1 on dev

Test coverage 81.65% from 0 jobs

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
84 const std::size_t oIndexFull = oIndex + ox;
85 const signedsize ix = static_cast<signedsize>(ox * strideDims[0]) - static_cast<signedsize>(beginEndBorders[0]);
86
87 for (std::size_t sx = sxMin; sx*dilationDims[0] < sxMax; ++sx) {
88 output[oIndexFull] += weights[wIndex + sx] *
89 input[iIndex + static_cast<std::size_t>(ix+static_cast<signedsize>(sx*dilationDims[0]))];
90 }
91 }
92 }
93 }
94 }
95 }
96
97 // Kernels registration to implementation entry point
98 REGISTRAR(PaddedConvImpl1D_cpu,
99 {{DataType::Any, DataFormat::NCHW}, {DataType::Float32, DataFormat::NCHW}, DynamicAttributes(std::map<std::string, future_std::any>({std::make_pair("type", future_std::any(std::string("PaddedConv1D")))}))},
  • Actually, I introduced the type attribute for ImplSpec, but I think it is useless, because I didn't recall that the registrar for meta op is already a tuple! So this seems redundant, but it is nevertheless the only POC on attribute handling in ImplSpec right now...

  • Author Maintainer

    I don't understand if you want to change this line and by what or if you approve the MR.

    Edited by Maxence Naud
  • We can leave it as it for now, but once we will have other examples of attributes handling we will remove the "type" attribute which is redundant with the registrar key.

  • Please register or sign in to reply
  • Maxence Naud changed the description

    changed the description

  • requested review from @olivierbichler

  • Maxence Naud marked this merge request as ready

    marked this merge request as ready

  • Maxence Naud mentioned in commit 8b99d4f1

    mentioned in commit 8b99d4f1

  • merged

  • Please register or sign in to reply
    Loading