{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/11514","repository_url":"https://api.github.com/repos/tensorflow/tensorflow","labels_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/11514/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/11514/comments","events_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/11514/events","html_url":"https://github.com/tensorflow/tensorflow/issues/11514","id":243165849,"node_id":"MDU6SXNzdWUyNDMxNjU4NDk=","number":11514,"title":"tf.assign is much slower than tf.assign_add on CPU","user":{"login":"suiyuan2009","id":5105569,"node_id":"MDQ6VXNlcjUxMDU1Njk=","avatar_url":"https://avatars0.githubusercontent.com/u/5105569?v=4","gravatar_id":"","url":"https://api.github.com/users/suiyuan2009","html_url":"https://github.com/suiyuan2009","followers_url":"https://api.github.com/users/suiyuan2009/followers","following_url":"https://api.github.com/users/suiyuan2009/following{/other_user}","gists_url":"https://api.github.com/users/suiyuan2009/gists{/gist_id}","starred_url":"https://api.github.com/users/suiyuan2009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suiyuan2009/subscriptions","organizations_url":"https://api.github.com/users/suiyuan2009/orgs","repos_url":"https://api.github.com/users/suiyuan2009/repos","events_url":"https://api.github.com/users/suiyuan2009/events{/privacy}","received_events_url":"https://api.github.com/users/suiyuan2009/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"zhangyaobit","id":1034716,"node_id":"MDQ6VXNlcjEwMzQ3MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1034716?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangyaobit","html_url":"https://github.com/zhangyaobit","followers_url":"https://api.github.com/users/zhangyaobit/followers","following_url":"https://api.github.com/users/zhangyaobit/following{/other_user}","gists_url":"https://api.github.com/users/zhangyaobit/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangyaobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangyaobit/subscriptions","organizations_url":"https://api.github.com/users/zhangyaobit/orgs","repos_url":"https://api.github.com/users/zhangyaobit/repos","events_url":"https://api.github.com/users/zhangyaobit/events{/privacy}","received_events_url":"https://api.github.com/users/zhangyaobit/received_events","type":"User","site_admin":false},"assignees":[{"login":"zhangyaobit","id":1034716,"node_id":"MDQ6VXNlcjEwMzQ3MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1034716?v=4","gravatar_id":"","url":"https://api.github.com/users/zhangyaobit","html_url":"https://github.com/zhangyaobit","followers_url":"https://api.github.com/users/zhangyaobit/followers","following_url":"https://api.github.com/users/zhangyaobit/following{/other_user}","gists_url":"https://api.github.com/users/zhangyaobit/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangyaobit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangyaobit/subscriptions","organizations_url":"https://api.github.com/users/zhangyaobit/orgs","repos_url":"https://api.github.com/users/zhangyaobit/repos","events_url":"https://api.github.com/users/zhangyaobit/events{/privacy}","received_events_url":"https://api.github.com/users/zhangyaobit/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2017-07-15T09:57:32Z","updated_at":"2018-09-08T18:35:19Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### System information\r\n- **Have I written custom code (as opposed to using a stock example script provided in TensorFlow)**: No\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: ubuntu 14.04\r\n- **TensorFlow installed from (source or binary)**: source\r\n- **TensorFlow version (use command below)**: ('v0.8.0rc0-16474-gac98d11', '1.2.1')\r\n- **Python version**: Python 2.7.13 :: Anaconda custom (64-bit)\r\n- **Bazel version (if compiling from source)**: 0.4.5\r\n- **CUDA/cuDNN version**:cuda8.0/cudnn6.0\r\n- **GPU model and memory**:old titan x / 12GB\r\n- **Exact command to reproduce**: a python script\r\n\r\n### Describe the problem\r\n`tf.assign` is much slower than `tf.assign_add` on CPU when `intra_op_parallelism_threads` set to 10. Although tensorflow treats these two operations a little different(maybe because `tf.assign` allows uninitialized tensor, accepts more tensor types), they all use a same class in eigen. I find this problem when doing some test about #11411.\r\n\r\n### Source code / logs\r\nscript is on [gist](https://gist.github.com/suiyuan2009/24315b35915bddbe2d53b764164bb8fb),\r\n```\r\ndtype is <dtype: 'float32'>\r\nuse tf.assign: 3480.53776469 MB/s\r\nuse tf.assign_add: 10737.1193186 MB/s\r\n```\r\nset `intra_op_parallelism_threads` to 1, \r\n```\r\ndtype is <dtype: 'float32'>\r\nuse tf.assign: 3481.3296105 MB/s\r\nuse tf.assign_add: 4244.41816359 MB/s\r\n```\r\non GPU,\r\n```\r\ndtype is <dtype: 'float32'>\r\nuse tf.assign: 120361.172131 MB/s\r\nuse tf.assign_add: 77835.7152633 MB/s\r\n```"},"comment":{"url":"https://api.github.com/repos/tensorflow/tensorflow/issues/comments/419664010","html_url":"https://github.com/tensorflow/tensorflow/issues/11514#issuecomment-419664010","issue_url":"https://api.github.com/repos/tensorflow/tensorflow/issues/11514","id":419664010,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTY2NDAxMA==","user":{"login":"tensorflowbutler","id":28546240,"node_id":"MDQ6VXNlcjI4NTQ2MjQw","avatar_url":"https://avatars2.githubusercontent.com/u/28546240?v=4","gravatar_id":"","url":"https://api.github.com/users/tensorflowbutler","html_url":"https://github.com/tensorflowbutler","followers_url":"https://api.github.com/users/tensorflowbutler/followers","following_url":"https://api.github.com/users/tensorflowbutler/following{/other_user}","gists_url":"https://api.github.com/users/tensorflowbutler/gists{/gist_id}","starred_url":"https://api.github.com/users/tensorflowbutler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tensorflowbutler/subscriptions","organizations_url":"https://api.github.com/users/tensorflowbutler/orgs","repos_url":"https://api.github.com/users/tensorflowbutler/repos","events_url":"https://api.github.com/users/tensorflowbutler/events{/privacy}","received_events_url":"https://api.github.com/users/tensorflowbutler/received_events","type":"User","site_admin":false},"created_at":"2018-09-08T18:35:19Z","updated_at":"2018-09-08T18:35:19Z","author_association":"MEMBER","body":"Nagging Assignee @zhangyaobit: It has been 248 days with no activity and this issue has an assignee. Please update the label and/or status accordingly."}}
{"actor":{"display_login":"tensorflowbutler"}}