Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
d6262fde
"...resnet50_tensorflow.git" did not exist on "c413c90ecad38196b40b15bf5dfec7aea8229fcf"
Commit
d6262fde
authored
Apr 24, 2020
by
Chao Liu
Browse files
extract channel bit
parent
9e0d6146
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
composable_kernel/include/tensor_operation/gridwise_gemm.hpp
composable_kernel/include/tensor_operation/gridwise_gemm.hpp
+23
-3
driver/src/conv_driver.cpp
driver/src/conv_driver.cpp
+5
-5
No files found.
composable_kernel/include/tensor_operation/gridwise_gemm.hpp
View file @
d6262fde
...
@@ -408,6 +408,10 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
...
@@ -408,6 +408,10 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
using
ACoord
=
typename
TensorCoordinate
<
AGlobalDesc
>::
type
;
using
ACoord
=
typename
TensorCoordinate
<
AGlobalDesc
>::
type
;
using
BCoord
=
typename
TensorCoordinate
<
BGlobalDesc
>::
type
;
using
BCoord
=
typename
TensorCoordinate
<
BGlobalDesc
>::
type
;
#define CHANNEL_BITS 5
#define NUM_CHANNELS (1 << CHANNEL_BITS)
#define CHANNEL_SHIFT 8
#define CHANNEL_MASK ((NUM_CHANNELS - 1) << CHANNEL_SHIFT)
for
(
index_t
m_block_work_id
=
0
;
m_block_work_id
<
MBlockWork
;
++
m_block_work_id
)
for
(
index_t
m_block_work_id
=
0
;
m_block_work_id
<
MBlockWork
;
++
m_block_work_id
)
{
{
...
@@ -419,9 +423,13 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
...
@@ -419,9 +423,13 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
afile
.
open
(
"a_mblock_"
+
std
::
to_string
(
m_block_work_id
)
+
"_nblock_"
+
std
::
to_string
(
n_block_work_id
)
+
".csv"
,
std
::
fstream
::
out
);
afile
.
open
(
"a_mblock_"
+
std
::
to_string
(
m_block_work_id
)
+
"_nblock_"
+
std
::
to_string
(
n_block_work_id
)
+
".csv"
,
std
::
fstream
::
out
);
afile
<<
"kblock,
offset
"
<<
std
::
endl
;
afile
<<
"kblock,
channel
"
<<
std
::
endl
;
#if 0
for(index_t k_block_work_id = 0; k_block_work_id < KBlockWork; ++k_block_work_id)
for(index_t k_block_work_id = 0; k_block_work_id < KBlockWork; ++k_block_work_id)
#else
index_t
k_block_work_id
=
0
;
#endif
{
{
for
(
index_t
k
=
k_block_work_id
*
KPerBlock
;
k
<
(
k_block_work_id
+
1
)
*
KPerBlock
;
++
k
)
for
(
index_t
k
=
k_block_work_id
*
KPerBlock
;
k
<
(
k_block_work_id
+
1
)
*
KPerBlock
;
++
k
)
{
{
...
@@ -431,7 +439,11 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
...
@@ -431,7 +439,11 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
if
(
a_coord
.
IsOffsetValidAssumingUpperIndexIsValid
())
if
(
a_coord
.
IsOffsetValidAssumingUpperIndexIsValid
())
{
{
afile
<<
k_block_work_id
*
100
<<
","
<<
a_coord
.
GetOffset
()
<<
std
::
endl
;
uint32_t
offset_u
=
static_cast
<
uint32_t
>
(
a_coord
.
GetOffset
())
*
sizeof
(
Float
);
uint32_t
channel
=
(
offset_u
&
CHANNEL_MASK
)
>>
CHANNEL_SHIFT
;
afile
<<
k_block_work_id
<<
","
<<
channel
<<
std
::
endl
;
}
}
}
}
}
}
...
@@ -448,7 +460,11 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
...
@@ -448,7 +460,11 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
bfile
<<
"kblock, offset"
<<
std
::
endl
;
bfile
<<
"kblock, offset"
<<
std
::
endl
;
#if 0
for(index_t k_block_work_id = 0; k_block_work_id < KBlockWork; ++k_block_work_id)
for(index_t k_block_work_id = 0; k_block_work_id < KBlockWork; ++k_block_work_id)
#else
index_t
k_block_work_id
=
0
;
#endif
{
{
for
(
index_t
k
=
k_block_work_id
*
KPerBlock
;
k
<
(
k_block_work_id
+
1
)
*
KPerBlock
;
++
k
)
for
(
index_t
k
=
k_block_work_id
*
KPerBlock
;
k
<
(
k_block_work_id
+
1
)
*
KPerBlock
;
++
k
)
{
{
...
@@ -458,7 +474,11 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
...
@@ -458,7 +474,11 @@ struct GridwiseGemmTransposedANormalBNormalC_v1
if
(
b_coord
.
IsOffsetValidAssumingUpperIndexIsValid
())
if
(
b_coord
.
IsOffsetValidAssumingUpperIndexIsValid
())
{
{
bfile
<<
k_block_work_id
*
100
<<
","
<<
b_coord
.
GetOffset
()
<<
std
::
endl
;
uint32_t
offset_u
=
static_cast
<
uint32_t
>
(
b_coord
.
GetOffset
())
*
sizeof
(
Float
);
uint32_t
channel
=
(
offset_u
&
CHANNEL_MASK
)
>>
CHANNEL_SHIFT
;
bfile
<<
k_block_work_id
<<
","
<<
channel
<<
std
::
endl
;
}
}
}
}
}
}
...
...
driver/src/conv_driver.cpp
View file @
d6262fde
...
@@ -328,13 +328,13 @@ int main(int argc, char* argv[])
...
@@ -328,13 +328,13 @@ int main(int argc, char* argv[])
using
LeftPads
=
Sequence
<
0
,
0
>
;
using
LeftPads
=
Sequence
<
0
,
0
>
;
using
RightPads
=
Sequence
<
0
,
0
>
;
using
RightPads
=
Sequence
<
0
,
0
>
;
#elif
0
#elif
1
// 1x1, 14x14
// 1x1, 14x14
constexpr
index_t
N
=
128
;
constexpr
index_t
N
=
64
;
constexpr
index_t
C
=
128
;
constexpr
index_t
C
=
1024
;
constexpr
index_t
HI
=
14
;
constexpr
index_t
HI
=
14
;
constexpr
index_t
WI
=
14
;
constexpr
index_t
WI
=
14
;
constexpr
index_t
K
=
12
8
;
constexpr
index_t
K
=
204
8
;
constexpr
index_t
Y
=
1
;
constexpr
index_t
Y
=
1
;
constexpr
index_t
X
=
1
;
constexpr
index_t
X
=
1
;
...
@@ -373,7 +373,7 @@ int main(int argc, char* argv[])
...
@@ -373,7 +373,7 @@ int main(int argc, char* argv[])
using
LeftPads
=
Sequence
<
1
,
1
>
;
using
LeftPads
=
Sequence
<
1
,
1
>
;
using
RightPads
=
Sequence
<
1
,
1
>
;
using
RightPads
=
Sequence
<
1
,
1
>
;
#elif
1
#elif
0
// 3x3, 14x14
// 3x3, 14x14
constexpr
index_t
N
=
128
;
constexpr
index_t
N
=
128
;
constexpr
index_t
C
=
128
;
constexpr
index_t
C
=
128
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment