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
1e02e941
"include/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "095c2a4948b8b28f3fc65108629fa04cc45daa33"
Commit
1e02e941
authored
Nov 13, 2023
by
Paul
Browse files
Adjust block_size for navi
parent
308db690
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
src/targets/gpu/compile_hip_code_object.cpp
src/targets/gpu/compile_hip_code_object.cpp
+2
-2
src/targets/gpu/include/migraphx/gpu/compile_hip_code_object.hpp
...gets/gpu/include/migraphx/gpu/compile_hip_code_object.hpp
+1
-1
src/targets/gpu/jit/reduce.cpp
src/targets/gpu/jit/reduce.cpp
+2
-2
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 @
1e02e941
...
...
@@ -164,9 +164,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
)
std
::
size_t
compute_block_size
(
context
&
ctx
,
std
::
size_t
n
,
std
::
size_t
max_block_size
)
{
const
std
::
size_t
min_block_size
=
64
;
const
std
::
size_t
min_block_size
=
ctx
.
get_current_device
().
get_wavefront_size
()
;
auto
block_size
=
(((
n
-
1
)
/
min_block_size
+
1
))
*
min_block_size
;
return
std
::
min
(
std
::
max
(
min_block_size
,
block_size
),
max_block_size
);
}
...
...
src/targets/gpu/include/migraphx/gpu/compile_hip_code_object.hpp
View file @
1e02e941
...
...
@@ -72,7 +72,7 @@ compute_global_for(context& ctx, std::size_t n, std::size_t over = 1);
MIGRAPHX_GPU_EXPORT
operation
compile_hip_code_object
(
const
std
::
string
&
content
,
hip_compile_options
options
);
MIGRAPHX_GPU_EXPORT
std
::
size_t
compute_block_size
(
std
::
size_t
n
,
MIGRAPHX_GPU_EXPORT
std
::
size_t
compute_block_size
(
context
&
ctx
,
std
::
size_t
n
,
std
::
size_t
max_block_size
=
1024
);
MIGRAPHX_GPU_EXPORT
std
::
string
generate_make_shape
(
const
shape
&
s
);
...
...
src/targets/gpu/jit/reduce.cpp
View file @
1e02e941
...
...
@@ -166,7 +166,7 @@ struct simple_reduce_compiler : compiler<simple_reduce_compiler>
auto
relements
=
get_reduce_elements
(
options
.
virtual_inputs
)
/
vec
.
size
;
if
(
algo
==
"block"
)
{
auto
block_size
=
compute_block_size
(
relements
,
256
);
auto
block_size
=
compute_block_size
(
ctx
,
relements
,
256
);
if
(
relements
>=
block_size
*
256
)
algo
=
"block_large"
;
options
.
set_launch_params
(
...
...
@@ -274,7 +274,7 @@ struct fused_reduce_compiler : compiler<fused_reduce_compiler>
auto
relements
=
reduction_shape
.
elements
()
/
vec
.
size
;
if
(
algo
==
"block"
)
{
auto
block_size
=
compute_block_size
(
relements
,
256
);
auto
block_size
=
compute_block_size
(
ctx
,
relements
,
256
);
if
(
relements
>=
block_size
*
256
)
algo
=
"block_large"
;
options
.
set_launch_params
(
...
...
src/targets/gpu/jit/softmax.cpp
View file @
1e02e941
...
...
@@ -75,7 +75,7 @@ struct softmax_compiler : compiler<softmax_compiler>
}
auto
relements
=
inputs
[
0
].
lens
()[
axis
]
/
vec
.
size
;
auto
nelements
=
(
inputs
.
back
().
elements
()
/
inputs
[
0
].
lens
()[
axis
]);
auto
block_size
=
compute_block_size
(
relements
,
256
);
auto
block_size
=
compute_block_size
(
ctx
,
relements
,
256
);
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