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
MIGraphX
Commits
94256bc4
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "9b176db8c7c64a41be6f74de6de26ee5b5c05409"
Commit
94256bc4
authored
Jul 02, 2022
by
Paul
Browse files
Update block size calculation
parent
0ee486c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
src/targets/gpu/compile_hip_code_object.cpp
src/targets/gpu/compile_hip_code_object.cpp
+3
-4
src/targets/gpu/jit/layernorm.cpp
src/targets/gpu/jit/layernorm.cpp
+1
-1
src/targets/gpu/jit/softmax.cpp
src/targets/gpu/jit/softmax.cpp
+1
-1
No files found.
src/targets/gpu/compile_hip_code_object.cpp
View file @
94256bc4
...
...
@@ -144,10 +144,9 @@ compute_global_for(context& ctx, std::size_t n, std::size_t over)
std
::
size_t
compute_block_size
(
std
::
size_t
n
,
std
::
size_t
max_block_size
)
{
size_t
block_size
=
128
;
while
(
block_size
<=
max_block_size
and
block_size
<=
n
)
block_size
*=
2
;
return
block_size
/
2
;
const
std
::
size_t
min_block_size
=
64
;
auto
block_size
=
(((
n
-
1
)
/
min_block_size
+
1
))
*
min_block_size
;
return
std
::
min
(
block_size
,
max_block_size
);
}
operation
compile_hip_code_object
(
const
std
::
string
&
content
,
hip_compile_options
options
)
...
...
src/targets/gpu/jit/layernorm.cpp
View file @
94256bc4
...
...
@@ -62,7 +62,7 @@ struct layernorm_compiler : compiler<layernorm_compiler>
auto
preloads
=
preload
::
broadcasts
(
axis
,
inputs
);
auto
relements
=
inputs
[
0
].
lens
()[
axis
]
/
vec
.
size
;
auto
nelements
=
inputs
.
back
().
elements
()
/
relements
;
auto
block_size
=
compute_block_size
(
relements
,
256
);
auto
block_size
=
compute_block_size
(
relements
,
512
);
hip_compile_options
options
;
options
.
set_launch_params
(
v
,
compute_global_for
(
ctx
,
nelements
*
block_size
,
256
),
block_size
);
...
...
src/targets/gpu/jit/softmax.cpp
View file @
94256bc4
...
...
@@ -58,7 +58,7 @@ struct softmax_compiler : compiler<softmax_compiler>
}
auto
relements
=
inputs
[
0
].
lens
()[
axis
]
/
vec
.
size
;
auto
nelements
=
inputs
.
back
().
elements
()
/
relements
;
auto
block_size
=
compute_block_size
(
relements
,
256
);
auto
block_size
=
compute_block_size
(
relements
,
512
);
hip_compile_options
options
;
options
.
set_launch_params
(
v
,
compute_global_for
(
ctx
,
nelements
*
block_size
,
256
),
block_size
);
...
...
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