Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
one
spconv
Commits
647927ce
Commit
647927ce
authored
Dec 09, 2021
by
yan.yan
Browse files
add env to control splitk in bwd
parent
52594038
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
CHANGELOG.md
CHANGELOG.md
+1
-0
spconv/algo.py
spconv/algo.py
+3
-3
spconv/constants.py
spconv/constants.py
+4
-0
No files found.
CHANGELOG.md
View file @
647927ce
...
...
@@ -4,6 +4,7 @@
### Added
-
add sm_37
-
add fp16 kernels witl fp32 accumulator (run slower, but can avoid nan if channel size is too large)
-
add SPCONV_BWD_SPLITK env to control splitk candidates.
## [2.1.20] - 2021-12-6
### Added
...
...
spconv/algo.py
View file @
647927ce
...
...
@@ -20,7 +20,7 @@ from spconv.core_cc.cumm.conv.main import ConvAlgoDesp, ConvMainUnitTest, ConvPa
from
cumm.conv.bases
import
ConvLayout
,
ConvLayoutType
,
ConvOpType
from
cumm.gemm.algospec.core
import
GemmAlgo
,
ShuffleStrideType
,
get_min_arch_of_algo_str
,
get_available_algo_str_from_arch
from
cumm.gemm.codeops
import
group_by
,
div_up
from
spconv.constants
import
NDIM_DONT_CARE
from
spconv.constants
import
NDIM_DONT_CARE
,
SPCONV_BWD_SPLITK
from
typing
import
Optional
import
time
from
threading
import
Lock
...
...
@@ -345,7 +345,7 @@ class SimpleGemm:
params
.
beta
=
beta
params
.
stream
=
stream
if
desp
.
split_k_serial
and
hint
&
AlgoHint
.
BackwardWeight
.
value
:
splitk_tests
=
[
1
,
2
,
4
,
8
,
16
,
32
,
64
]
splitk_tests
=
SPCONV_BWD_SPLITK
else
:
splitk_tests
=
[
1
]
spk_speeds
=
[]
...
...
@@ -646,7 +646,7 @@ class SimpleConv:
params
.
reverse_mask
=
reverse_mask
params
.
mask_filter
=
mask_filter
if
desp
.
split_k_serial
and
op_type
==
ConvOpType
.
kBackwardWeight
:
splitk_tests
=
[
1
,
2
,
4
,
8
,
16
,
32
,
64
]
splitk_tests
=
SPCONV_BWD_SPLITK
# splitk_tests = [1]
else
:
splitk_tests
=
[
1
]
...
...
spconv/constants.py
View file @
647927ce
...
...
@@ -39,3 +39,7 @@ else:
BOOST_ROOT
=
Path
(
_BOOST_ROOT
)
assert
BOOST_ROOT
.
exists
(),
"you provide BOOST_ROOT, but it not exists"
assert
(
BOOST_ROOT
/
"boost"
/
"geometry"
).
exists
(),
"you provide BOOST_ROOT, but BOOST_ROOT/boost/geometry not exists"
# for f16 backward weight, larger splitk, larger compute error.
# so we use this env to control maximum splitk.
SPCONV_BWD_SPLITK
=
list
(
map
(
int
,
os
.
getenv
(
"SPCONV_BWD_SPLITK"
,
"1,2,4,8,16,32,64"
).
split
(
","
)))
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