forked from YdrMaster/operators
-
Notifications
You must be signed in to change notification settings - Fork 24
Add ConvBiasAct #123
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
Open
Ziminli
wants to merge
9
commits into
dev
Choose a base branch
from
add_convBiasAct
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add ConvBiasAct #123
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1d3798b
Add convBiasAct
Ziminli c38b04c
Uncomment mathtype statement
Ziminli 79c2859
Add conv optimization and updates, including mathType, argument data …
Ziminli 15b6c30
Rename ConvBiasAct to ConvAct, make bias optional for both conv and c…
Ziminli 17ab100
Fix rebase issue
Ziminli 1d54c25
Add ActivationMode_t, add ConvActParam_t, and fixed misc. issues
Ziminli f1d343b
Add functional header to conv_act_cpu.h
Ziminli 1ca4474
Rename ActivationMode_t to InfiniActivationMode_t
Ziminli 00a8076
Resolve merge conflicts
Ziminli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,3 +89,4 @@ jobs: | |
| fi | ||
| env: | ||
| INFINI_ROOT: ${{ env.INFINI_ROOT }} | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #ifndef CONV_ACT_H | ||
| #define CONV_ACT_H | ||
|
|
||
| #include "../../export.h" | ||
| #include "../../operators.h" | ||
| #include <cstddef> | ||
|
|
||
| /** | ||
| * @brief Specifies the type of activation function | ||
| */ | ||
| struct ActivationMode { | ||
|
Ziminli marked this conversation as resolved.
Outdated
|
||
|
|
||
| enum Mode { | ||
| // activation functions | ||
| IDENTITY, | ||
| RELU, | ||
| SIGMOID, | ||
|
|
||
| // Count | ||
| // NOTE: new activation functions should add before "Count" | ||
| Count, | ||
| }; | ||
| constexpr static size_t numOfActivationFunctions = Mode::Count; | ||
| }; | ||
|
|
||
| typedef struct ConvActDescriptor { | ||
| Device device; | ||
| } ConvActDescriptor; | ||
|
|
||
| typedef ConvActDescriptor *infiniopConvActDescriptor_t; | ||
|
|
||
| __C __export infiniopStatus_t infiniopCreateConvActDescriptor(infiniopHandle_t handle, | ||
| infiniopConvActDescriptor_t *desc_ptr, | ||
| infiniopTensorDescriptor_t y, | ||
| infiniopTensorDescriptor_t x, | ||
| infiniopTensorDescriptor_t w, | ||
| infiniopTensorDescriptor_t b, | ||
| uint64_t const *pads, | ||
| int64_t const *strides, | ||
| uint64_t const *dilations, | ||
| uint64_t n, | ||
| ActivationMode::Mode activation_mode, | ||
| double clip_coef = 0.0); | ||
|
|
||
| __C __export infiniopStatus_t infiniopGetConvActWorkspaceSize(infiniopConvActDescriptor_t desc, uint64_t *size); | ||
|
|
||
| __C __export infiniopStatus_t infiniopConvAct(infiniopConvActDescriptor_t desc, void *workspace, uint64_t workspace_size, void *y, void const *x, void const *w, void const *b, void *stream); | ||
|
|
||
| __C __export infiniopStatus_t infiniopDestroyConvActDescriptor(infiniopConvActDescriptor_t desc); | ||
|
|
||
|
|
||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.