Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_backend_cpu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jerome Hue
aidge_backend_cpu
Commits
fd321fc0
Commit
fd321fc0
authored
2 months ago
by
Jerome Hue
Browse files
Options
Downloads
Patches
Plain Diff
Fix forward signature of NFixedBitFlip op
parent
ae873a18
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/backend/cpu/operator/FixedNBitFlipImpl_kernels.hpp
+13
-14
13 additions, 14 deletions
.../aidge/backend/cpu/operator/FixedNBitFlipImpl_kernels.hpp
include/aidge/backend/cpu_version.h
+3
-3
3 additions, 3 deletions
include/aidge/backend/cpu_version.h
with
16 additions
and
17 deletions
include/aidge/backend/cpu/operator/FixedNBitFlipImpl_kernels.hpp
+
13
−
14
View file @
fd321fc0
...
...
@@ -23,7 +23,7 @@ namespace Aidge {
template
<
typename
T2
,
typename
T1
>
struct
BitCastHelper
{
static
constexpr
bool
isValid
=
static
constexpr
bool
isValid
=
sizeof
(
T1
)
==
sizeof
(
T2
)
and
std
::
is_trivially_copyable
<
T1
>::
value
and
std
::
is_trivially_copyable
<
T2
>::
value
and
...
...
@@ -61,7 +61,7 @@ template<typename T>
typename
std
::
enable_if
<
(
sizeof
(
T
)
!=
4
and
sizeof
(
T
)
!=
8
)
>::
type
flipSingleBit
(
T
&
vlaue
,
std
::
size_t
bitToFlip
)
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"BitFlip error not implemented for this type of data."
);
}
...
...
@@ -69,11 +69,11 @@ template <class I, class O>
void
FixedNBitFlipImpl_cpu_forward_kernel
(
const
void
*
input_
,
void
*
output_
,
std
::
size_t
inputLength
,
std
::
uint32_t
nBitToFlip
,
std
::
vector
<
int
>
weights
,
std
::
vector
<
int
>
bits
)
{
std
::
size_t
nBitToFlip
,
std
::
vector
<
std
::
size_t
>
weights
,
std
::
vector
<
uint8_t
>
bits
)
{
const
I
*
input
=
static_cast
<
const
I
*>
(
input_
);
O
*
output
=
static_cast
<
O
*>
(
output_
);
...
...
@@ -107,7 +107,7 @@ void FixedNBitFlipImpl_cpu_forward_kernel(const void* input_,
O
oldValue
=
output
[
randomIndex
];
flipSingleBit
(
output
[
randomIndex
],
bitToFlip
);
O
newValue
=
output
[
randomIndex
];
Log
::
notice
(
"
\t
Flipping bit {} of weight {}.
\t
From {} to {}"
,
bitToFlip
,
randomIndex
,
...
...
@@ -121,20 +121,19 @@ void FixedNBitFlipImpl_cpu_forward_kernel(const void* input_,
// Kernels registration to implementation entry point
REGISTRAR
(
FixedNBitFlipImpl_cpu
,
{
DataType
::
Float32
},
{
ProdConso
::
inPlaceModel
,
Aidge
::
FixedNBitFlipImpl_cpu_forward_kernel
<
float
,
float
>
,
{
ProdConso
::
inPlaceModel
,
Aidge
::
FixedNBitFlipImpl_cpu_forward_kernel
<
float
,
float
>
,
nullptr
});
REGISTRAR
(
FixedNBitFlipImpl_cpu
,
{
DataType
::
Float64
},
{
ProdConso
::
inPlaceModel
,
Aidge
::
FixedNBitFlipImpl_cpu_forward_kernel
<
double
,
double
>
,
{
ProdConso
::
inPlaceModel
,
Aidge
::
FixedNBitFlipImpl_cpu_forward_kernel
<
double
,
double
>
,
nullptr
});
REGISTRAR
(
FixedNBitFlipImpl_cpu
,
{
DataType
::
Int32
},
{
ProdConso
::
inPlaceModel
,
Aidge
::
FixedNBitFlipImpl_cpu_forward_kernel
<
std
::
uint32_t
,
std
::
uint32_t
>
,
{
ProdConso
::
inPlaceModel
,
Aidge
::
FixedNBitFlipImpl_cpu_forward_kernel
<
std
::
uint32_t
,
std
::
uint32_t
>
,
nullptr
});
}
// namespace Aidge
#endif
This diff is collapsed.
Click to expand it.
include/aidge/backend/cpu_version.h
+
3
−
3
View file @
fd321fc0
...
...
@@ -4,8 +4,8 @@
namespace
Aidge
{
static
constexpr
const
int
PROJECT_VERSION_MAJOR
=
0
;
static
constexpr
const
int
PROJECT_VERSION_MINOR
=
6
;
static
constexpr
const
int
PROJECT_VERSION_PATCH
=
0
;
static
constexpr
const
char
*
PROJECT_VERSION
=
"0.6.
0
"
;
static
constexpr
const
char
*
PROJECT_GIT_HASH
=
"
1af5777
"
;
static
constexpr
const
int
PROJECT_VERSION_PATCH
=
1
;
static
constexpr
const
char
*
PROJECT_VERSION
=
"0.6.
1
"
;
static
constexpr
const
char
*
PROJECT_GIT_HASH
=
"
ae873a1
"
;
}
#endif // VERSION_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment