{"action":"created","comment":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/205690095","pull_request_review_id":141010796,"id":205690095,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTY5MDA5NQ==","diff_hunk":"@@ -65,5 +65,40 @@ CUDA_ATOMIC_WRAPPER(Add, double) {\n   return __longlong_as_double(old);\n }\n #endif\n+\n+#if defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 800\n+#ifdef PADDLE_CUDA_FP16\n+// NOTE(dzhwinter): cuda do not have atomicCAS for half.\n+// Just use the half address as a unsigned value address and\n+// do the atomicCAS. According to the value store at high 16 bits\n+// or low 16 bits, then do a different sum and CAS.\n+// Given most warp-threads will failed on the atomicCAS, so this\n+// implemented should be avoided in high concurrency. It's will be\n+// slower than the way convert value into 32bits and do a full atomicCAS.\n+CUDA_ATOMIC_WRAPPER(Add, float16) {\n+  unsigned int* address_as_ui =\n+      (unsigned int*)(reinterpret_cast<char*>(address) -\n+                      ((size_t)address & 0x2));\n+  unsigned int old = *address_as_ui;\n+  unsigned int sum;\n+  unsigned int newval;\n+  unsigned int assumed;\n+\n+  do {\n+    assumed = old;\n+    sum = static_cast<unsigned>(val) + (size_t)address & 0x2","path":"paddle/fluid/platform/cuda_primitives.h","position":null,"original_position":25,"commit_id":"5e7a3edf88333d89f9b4c554d0043f3cd97bbf9c","original_commit_id":"cd70a75476d7e6b9f36a4bd202fc8b7cd3a096f4","user":{"login":"dzhwinter","id":6687176,"node_id":"MDQ6VXNlcjY2ODcxNzY=","avatar_url":"https://avatars2.githubusercontent.com/u/6687176?v=4","gravatar_id":"","url":"https://api.github.com/users/dzhwinter","html_url":"https://github.com/dzhwinter","followers_url":"https://api.github.com/users/dzhwinter/followers","following_url":"https://api.github.com/users/dzhwinter/following{/other_user}","gists_url":"https://api.github.com/users/dzhwinter/gists{/gist_id}","starred_url":"https://api.github.com/users/dzhwinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzhwinter/subscriptions","organizations_url":"https://api.github.com/users/dzhwinter/orgs","repos_url":"https://api.github.com/users/dzhwinter/repos","events_url":"https://api.github.com/users/dzhwinter/events{/privacy}","received_events_url":"https://api.github.com/users/dzhwinter/received_events","type":"User","site_admin":false},"body":"Thanks the review!  tests and comment added. ","created_at":"2018-07-27T07:33:38Z","updated_at":"2018-07-27T07:33:39Z","html_url":"https://github.com/PaddlePaddle/Paddle/pull/12181#discussion_r205690095","pull_request_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12181","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments/205690095"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/12181#discussion_r205690095"},"pull_request":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12181"}},"in_reply_to_id":204613821},"pull_request":{"url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12181","id":201858431,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxODU4NDMx","html_url":"https://github.com/PaddlePaddle/Paddle/pull/12181","diff_url":"https://github.com/PaddlePaddle/Paddle/pull/12181.diff","patch_url":"https://github.com/PaddlePaddle/Paddle/pull/12181.patch","issue_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/12181","number":12181,"state":"open","locked":false,"title":"float16 type support enhance ","user":{"login":"dzhwinter","id":6687176,"node_id":"MDQ6VXNlcjY2ODcxNzY=","avatar_url":"https://avatars2.githubusercontent.com/u/6687176?v=4","gravatar_id":"","url":"https://api.github.com/users/dzhwinter","html_url":"https://github.com/dzhwinter","followers_url":"https://api.github.com/users/dzhwinter/followers","following_url":"https://api.github.com/users/dzhwinter/following{/other_user}","gists_url":"https://api.github.com/users/dzhwinter/gists{/gist_id}","starred_url":"https://api.github.com/users/dzhwinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzhwinter/subscriptions","organizations_url":"https://api.github.com/users/dzhwinter/orgs","repos_url":"https://api.github.com/users/dzhwinter/repos","events_url":"https://api.github.com/users/dzhwinter/events{/privacy}","received_events_url":"https://api.github.com/users/dzhwinter/received_events","type":"User","site_admin":false},"body":"add float16 datatype support","created_at":"2018-07-17T08:16:09Z","updated_at":"2018-07-27T07:33:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"717edb69f16891e32430ecef30d75ea0121cd824","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12181/commits","review_comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12181/comments","review_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/12181/comments","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/5e7a3edf88333d89f9b4c554d0043f3cd97bbf9c","head":{"label":"dzhwinter:feature/mixed_training_0","ref":"feature/mixed_training_0","sha":"5e7a3edf88333d89f9b4c554d0043f3cd97bbf9c","user":{"login":"dzhwinter","id":6687176,"node_id":"MDQ6VXNlcjY2ODcxNzY=","avatar_url":"https://avatars2.githubusercontent.com/u/6687176?v=4","gravatar_id":"","url":"https://api.github.com/users/dzhwinter","html_url":"https://github.com/dzhwinter","followers_url":"https://api.github.com/users/dzhwinter/followers","following_url":"https://api.github.com/users/dzhwinter/following{/other_user}","gists_url":"https://api.github.com/users/dzhwinter/gists{/gist_id}","starred_url":"https://api.github.com/users/dzhwinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzhwinter/subscriptions","organizations_url":"https://api.github.com/users/dzhwinter/orgs","repos_url":"https://api.github.com/users/dzhwinter/repos","events_url":"https://api.github.com/users/dzhwinter/events{/privacy}","received_events_url":"https://api.github.com/users/dzhwinter/received_events","type":"User","site_admin":false},"repo":{"id":88926226,"node_id":"MDEwOlJlcG9zaXRvcnk4ODkyNjIyNg==","name":"Paddle","full_name":"dzhwinter/Paddle","owner":{"login":"dzhwinter","id":6687176,"node_id":"MDQ6VXNlcjY2ODcxNzY=","avatar_url":"https://avatars2.githubusercontent.com/u/6687176?v=4","gravatar_id":"","url":"https://api.github.com/users/dzhwinter","html_url":"https://github.com/dzhwinter","followers_url":"https://api.github.com/users/dzhwinter/followers","following_url":"https://api.github.com/users/dzhwinter/following{/other_user}","gists_url":"https://api.github.com/users/dzhwinter/gists{/gist_id}","starred_url":"https://api.github.com/users/dzhwinter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzhwinter/subscriptions","organizations_url":"https://api.github.com/users/dzhwinter/orgs","repos_url":"https://api.github.com/users/dzhwinter/repos","events_url":"https://api.github.com/users/dzhwinter/events{/privacy}","received_events_url":"https://api.github.com/users/dzhwinter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dzhwinter/Paddle","description":"PArallel Distributed Deep LEarning","fork":true,"url":"https://api.github.com/repos/dzhwinter/Paddle","forks_url":"https://api.github.com/repos/dzhwinter/Paddle/forks","keys_url":"https://api.github.com/repos/dzhwinter/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dzhwinter/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dzhwinter/Paddle/teams","hooks_url":"https://api.github.com/repos/dzhwinter/Paddle/hooks","issue_events_url":"https://api.github.com/repos/dzhwinter/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/dzhwinter/Paddle/events","assignees_url":"https://api.github.com/repos/dzhwinter/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/dzhwinter/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/dzhwinter/Paddle/tags","blobs_url":"https://api.github.com/repos/dzhwinter/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dzhwinter/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dzhwinter/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/dzhwinter/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dzhwinter/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/dzhwinter/Paddle/languages","stargazers_url":"https://api.github.com/repos/dzhwinter/Paddle/stargazers","contributors_url":"https://api.github.com/repos/dzhwinter/Paddle/contributors","subscribers_url":"https://api.github.com/repos/dzhwinter/Paddle/subscribers","subscription_url":"https://api.github.com/repos/dzhwinter/Paddle/subscription","commits_url":"https://api.github.com/repos/dzhwinter/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/dzhwinter/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/dzhwinter/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/dzhwinter/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/dzhwinter/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/dzhwinter/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dzhwinter/Paddle/merges","archive_url":"https://api.github.com/repos/dzhwinter/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dzhwinter/Paddle/downloads","issues_url":"https://api.github.com/repos/dzhwinter/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/dzhwinter/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/dzhwinter/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/dzhwinter/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dzhwinter/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/dzhwinter/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/dzhwinter/Paddle/deployments","created_at":"2017-04-21T01:29:56Z","updated_at":"2017-04-21T01:30:00Z","pushed_at":"2018-07-27T06:59:42Z","git_url":"git://github.com/dzhwinter/Paddle.git","ssh_url":"git@github.com:dzhwinter/Paddle.git","clone_url":"https://github.com/dzhwinter/Paddle.git","svn_url":"https://github.com/dzhwinter/Paddle","homepage":"http://www.paddlepaddle.org/","size":75977,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"PaddlePaddle:develop","ref":"develop","sha":"e90678c05124e87a770fdec1b10d09852f1b40a2","user":{"login":"PaddlePaddle","id":23534030,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0MDMw","avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"repo":{"id":65711522,"node_id":"MDEwOlJlcG9zaXRvcnk2NTcxMTUyMg==","name":"Paddle","full_name":"PaddlePaddle/Paddle","owner":{"login":"PaddlePaddle","id":23534030,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzNTM0MDMw","avatar_url":"https://avatars3.githubusercontent.com/u/23534030?v=4","gravatar_id":"","url":"https://api.github.com/users/PaddlePaddle","html_url":"https://github.com/PaddlePaddle","followers_url":"https://api.github.com/users/PaddlePaddle/followers","following_url":"https://api.github.com/users/PaddlePaddle/following{/other_user}","gists_url":"https://api.github.com/users/PaddlePaddle/gists{/gist_id}","starred_url":"https://api.github.com/users/PaddlePaddle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaddlePaddle/subscriptions","organizations_url":"https://api.github.com/users/PaddlePaddle/orgs","repos_url":"https://api.github.com/users/PaddlePaddle/repos","events_url":"https://api.github.com/users/PaddlePaddle/events{/privacy}","received_events_url":"https://api.github.com/users/PaddlePaddle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PaddlePaddle/Paddle","description":"PArallel Distributed Deep LEarning","fork":false,"url":"https://api.github.com/repos/PaddlePaddle/Paddle","forks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/forks","keys_url":"https://api.github.com/repos/PaddlePaddle/Paddle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PaddlePaddle/Paddle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PaddlePaddle/Paddle/teams","hooks_url":"https://api.github.com/repos/PaddlePaddle/Paddle/hooks","issue_events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/events{/number}","events_url":"https://api.github.com/repos/PaddlePaddle/Paddle/events","assignees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/assignees{/user}","branches_url":"https://api.github.com/repos/PaddlePaddle/Paddle/branches{/branch}","tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/tags","blobs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/refs{/sha}","trees_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/{sha}","languages_url":"https://api.github.com/repos/PaddlePaddle/Paddle/languages","stargazers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/stargazers","contributors_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contributors","subscribers_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscribers","subscription_url":"https://api.github.com/repos/PaddlePaddle/Paddle/subscription","commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/commits{/sha}","git_commits_url":"https://api.github.com/repos/PaddlePaddle/Paddle/git/commits{/sha}","comments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/comments{/number}","issue_comment_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/comments{/number}","contents_url":"https://api.github.com/repos/PaddlePaddle/Paddle/contents/{+path}","compare_url":"https://api.github.com/repos/PaddlePaddle/Paddle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PaddlePaddle/Paddle/merges","archive_url":"https://api.github.com/repos/PaddlePaddle/Paddle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PaddlePaddle/Paddle/downloads","issues_url":"https://api.github.com/repos/PaddlePaddle/Paddle/issues{/number}","pulls_url":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls{/number}","milestones_url":"https://api.github.com/repos/PaddlePaddle/Paddle/milestones{/number}","notifications_url":"https://api.github.com/repos/PaddlePaddle/Paddle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PaddlePaddle/Paddle/labels{/name}","releases_url":"https://api.github.com/repos/PaddlePaddle/Paddle/releases{/id}","deployments_url":"https://api.github.com/repos/PaddlePaddle/Paddle/deployments","created_at":"2016-08-15T06:59:08Z","updated_at":"2018-07-27T07:32:55Z","pushed_at":"2018-07-27T07:32:09Z","git_url":"git://github.com/PaddlePaddle/Paddle.git","ssh_url":"git@github.com:PaddlePaddle/Paddle.git","clone_url":"https://github.com/PaddlePaddle/Paddle.git","svn_url":"https://github.com/PaddlePaddle/Paddle","homepage":"http://www.paddlepaddle.org/","size":121937,"stargazers_count":7318,"watchers_count":7318,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2000,"mirror_url":null,"archived":false,"open_issues_count":1377,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2000,"open_issues":1377,"watchers":7318,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12181"},"html":{"href":"https://github.com/PaddlePaddle/Paddle/pull/12181"},"issue":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/12181"},"comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/issues/12181/comments"},"review_comments":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12181/comments"},"review_comment":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/pulls/12181/commits"},"statuses":{"href":"https://api.github.com/repos/PaddlePaddle/Paddle/statuses/5e7a3edf88333d89f9b4c554d0043f3cd97bbf9c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dzhwinter"}}