Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
ebfcd28c
Unverified
Commit
ebfcd28c
authored
Oct 31, 2019
by
Tianqi Chen
Committed by
GitHub
Oct 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CUDA] Fix fp16 intrin, disable bad fp16 vecadd test for now (#4239)
parent
b2155f70
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
16 deletions
+20
-16
docker/bash.sh
+2
-2
src/codegen/codegen_cuda.cc
+14
-14
tests/python/unittest/test_codegen_cuda.py
+4
-0
No files found.
docker/bash.sh
View file @
ebfcd28c
...
...
@@ -58,7 +58,7 @@ else
fi
if
[[
"
${
DOCKER_IMAGE_NAME
}
"
==
*
"gpu"
*
]]
;
then
if
!
type
"nvidia-docker"
>
/dev/null
if
!
type
"nvidia-docker"
1> /dev/null 2
> /dev/null
then
DOCKER_BINARY
=
"docker"
CUDA_ENV
=
" --gpus all "
${
CUDA_ENV
}
...
...
@@ -79,7 +79,6 @@ echo "Running '${COMMAND[@]}' inside ${DOCKER_IMAGE_NAME}..."
# By default we cleanup - remove the container once it finish running (--rm)
# and share the PID namespace (--pid=host) so the process inside does not have
# pid 1 and SIGKILL is propagated to the process inside (jenkins can kill it).
echo
${
DOCKER_BINARY
}
${
DOCKER_BINARY
}
run
--rm
--pid
=
host
\
-v
${
WORKSPACE
}
:/workspace
\
-v
${
SCRIPT_DIR
}
:/docker
\
...
...
@@ -95,3 +94,4 @@ ${DOCKER_BINARY} run --rm --pid=host\
${
DOCKER_IMAGE_NAME
}
\
bash
--login
/docker/with_the_same_user
\
${
COMMAND
[@]
}
src/codegen/codegen_cuda.cc
View file @
ebfcd28c
...
...
@@ -51,20 +51,20 @@ void CodeGenCUDA::AddFunction(LoweredFunc f) {
std
::
string
CodeGenCUDA
::
Finish
()
{
if
(
enable_fp16_
)
{
decl_stream
<<
"#include <cuda_fp16.h>
\n
"
;
decl_stream
<<
"__device__ half max"
\
"(const half a, const
half b)
\n
"
"{
\n
return __hgt(__half(a), __half(b)) ? a : b;
\n
}
\n
"
;
decl_stream
<<
"__device__ half min(
const half a, const
half b)
\n
"
"{
\n
return __hlt(__half(a), __half(b)) ? a : b;
\n
}
\n
"
;
decl_stream
<<
"__device__ half operator
+"
\
"(const volatile __half &a, const volatile __half &
b)
\n
"
"{
\n
return __hadd
(a, b);
\n
}
\n
"
;
decl_stream
<<
"__device__ half operator
<="
\
"(const volatile __half &a, const volatile
__half &b)
\n
"
"{
\n
return __hlt
(a, b);
\n
}
\n
"
;
decl_stream
<<
"__device__ half operator*"
\
"(const volatile __half &a, const volatile __half &
b)
\n
"
"{
\n
return __hmul(a, b);
\n
}
\n
"
;
decl_stream
<<
"__device__ half max"
<<
"(half a,
half b)
\n
"
<<
"{
\n
return __hgt(__half(a), __half(b)) ? a : b;
\n
}
\n
"
;
decl_stream
<<
"__device__ half min(
half a,
half b)
\n
"
<<
"{
\n
return __hlt(__half(a), __half(b)) ? a : b;
\n
}
\n
"
;
decl_stream
<<
"__device__ half operator
<="
<<
"(__half a, __half
b)
\n
"
<<
"{
\n
return __hlt
(a, b);
\n
}
\n
"
;
decl_stream
<<
"__device__ half operator
+"
<<
"(__half a,
__half &b)
\n
"
<<
"{
\n
return __hadd
(a, b);
\n
}
\n
"
;
decl_stream
<<
"__device__ half operator*"
<<
"(__half a, __half
b)
\n
"
<<
"{
\n
return __hmul(a, b);
\n
}
\n
"
;
}
if
(
enable_int8_
)
{
...
...
tests/python/unittest/test_codegen_cuda.py
View file @
ebfcd28c
...
...
@@ -54,6 +54,10 @@ def test_cuda_vectorize_add():
check_cuda
(
"int8"
,
64
,
4
)
# check_cuda("float16", 64, 2)
# TODO(tvm-team) fix fp16 codegen here
# or hit an error if it is less frequently used.
# check_cuda("float16", 64, 2)
def
test_cuda_multiply_add
():
num_thread
=
8
...
...
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