Should I set `inter_op_parallelism_threads` and `intra_op_parallelism_threads` to 1 when I use ray to create a actor?How can I safely create a nested directory?Why are Python lambdas useful?“Least Astonishment” and the Mutable Default ArgumentShould I use 'has_key()' or 'in' on Python dicts?In Python, when to use a Dictionary, List or Set?Python string formatting: % vs. .formatInstalling specific package versions with pipWay to create multiline comments in Python?How to change the order of DataFrame columns?Ray: How to run many actors on one GPU?

Why use water tanks from a retired Space Shuttle?

Can a wire having a 610-670 THz (frequency of blue light) AC frequency supply, generate blue light?

Where can I find the list of all tendons in the human body?

Singlequote and backslash

The term for the person/group a political party aligns themselves with to appear concerned about the general public

Can I ask a publisher for a paper that I need for reviewing

How can I offer a test ride while selling a bike?

Is there an evolutionary advantage to having two heads?

Group manager threw me under the bus to save her friend

Does nuclear propulsion applied to military ships fall under civil or military nuclear power?

Grep complete name including dot in the word

Explain Ant-Man's "not it" scene from Avengers: Endgame

'chmod' would set file permission to 000 no matter what permission I try to set

arcpy.GetParameterAsText not passing arguments to script?

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

How can I stop my presentation being derailed by audience questions?

Did airlines fly their aircraft slower in response to oil prices in the 1970s?

What if you don't bring your credit card or debit for incidentals?

Strange math syntax in old basic listing

Can you use a concentration spell while using Mantle of Majesty?

Why does the UK have more political parties than the US?

Change TeXForm of ArcTan

Double integral bounds of integration polar change of coordinate

Looking for an old image of designing a cpu with plan laid out / being edited on a literal floor



Should I set `inter_op_parallelism_threads` and `intra_op_parallelism_threads` to 1 when I use ray to create a actor?


How can I safely create a nested directory?Why are Python lambdas useful?“Least Astonishment” and the Mutable Default ArgumentShould I use 'has_key()' or 'in' on Python dicts?In Python, when to use a Dictionary, List or Set?Python string formatting: % vs. .formatInstalling specific package versions with pipWay to create multiline comments in Python?How to change the order of DataFrame columns?Ray: How to run many actors on one GPU?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















When I use ray to create the actors and learner in A2C, should I set inter_op_parallelism_threads and intra_op_parallelism_threads to 1, or leave it by default?










share|improve this question




























    1















    When I use ray to create the actors and learner in A2C, should I set inter_op_parallelism_threads and intra_op_parallelism_threads to 1, or leave it by default?










    share|improve this question
























      1












      1








      1








      When I use ray to create the actors and learner in A2C, should I set inter_op_parallelism_threads and intra_op_parallelism_threads to 1, or leave it by default?










      share|improve this question














      When I use ray to create the actors and learner in A2C, should I set inter_op_parallelism_threads and intra_op_parallelism_threads to 1, or leave it by default?







      python tensorflow ray






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 24 at 11:08









      Sherwin ChenSherwin Chen

      410415




      410415






















          1 Answer
          1






          active

          oldest

          votes


















          1














          It depends how many resources you want to the actor to use. If there is a dedicated machine for a given actor, and it's ok for the actor to use all of the resources on that machine, then use TensorFlow's default settings. If you are creating more like one actor per core, then setting inter_op_parallelism_threads and intra_op_parallelism_threads to small values like 1 or 2 is a good idea.



          In general, you can try both approaches and see which is faster.






          share|improve this answer























          • Thanks, so if I create an actor per core, then both should be set to 1?

            – Sherwin Chen
            Mar 25 at 10:04











          • Yes, though it's worth trying setting inter_op_parallelism_threads to 2 as well to see how that performs. Depending on what the actors are actually doing (e.g., are some of them idle some of the time), that may perform better. However, if they're all busy the whole time, then 1 will prevent too much contention between the actors.

            – Robert Nishihara
            Mar 25 at 22:10











          • Thanks for your patience. I now understand most of your answer, except that "1 will prevent too much contention between the actors. If I've clearly set num_cpus=1`, would there still be any contention between the actors?

            – Sherwin Chen
            Mar 26 at 0:13











          • Yes there can still be contention, when you specify num_cpus=1 in the remote decorator, the Ray scheduler will make sure not to create more than one such actor per core. However, the actor could still be heavily multithreaded and could still use all of the available CPU cores. Ray does not actually prevent the actor from using all of the resources on the machine. Does that make sense?

            – Robert Nishihara
            Mar 26 at 5:52











          • I see. Please allow me to repeat it and see if I understand it right. If I decorate all actors with num_cpus=1, the maximum number of actor allowed to be created is the number of cpus specified in ray.init. But it does not say anything about how much cpu resources an actor are allowed to use.

            – Sherwin Chen
            Mar 26 at 7:04











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323169%2fshould-i-set-inter-op-parallelism-threads-and-intra-op-parallelism-threads-t%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          It depends how many resources you want to the actor to use. If there is a dedicated machine for a given actor, and it's ok for the actor to use all of the resources on that machine, then use TensorFlow's default settings. If you are creating more like one actor per core, then setting inter_op_parallelism_threads and intra_op_parallelism_threads to small values like 1 or 2 is a good idea.



          In general, you can try both approaches and see which is faster.






          share|improve this answer























          • Thanks, so if I create an actor per core, then both should be set to 1?

            – Sherwin Chen
            Mar 25 at 10:04











          • Yes, though it's worth trying setting inter_op_parallelism_threads to 2 as well to see how that performs. Depending on what the actors are actually doing (e.g., are some of them idle some of the time), that may perform better. However, if they're all busy the whole time, then 1 will prevent too much contention between the actors.

            – Robert Nishihara
            Mar 25 at 22:10











          • Thanks for your patience. I now understand most of your answer, except that "1 will prevent too much contention between the actors. If I've clearly set num_cpus=1`, would there still be any contention between the actors?

            – Sherwin Chen
            Mar 26 at 0:13











          • Yes there can still be contention, when you specify num_cpus=1 in the remote decorator, the Ray scheduler will make sure not to create more than one such actor per core. However, the actor could still be heavily multithreaded and could still use all of the available CPU cores. Ray does not actually prevent the actor from using all of the resources on the machine. Does that make sense?

            – Robert Nishihara
            Mar 26 at 5:52











          • I see. Please allow me to repeat it and see if I understand it right. If I decorate all actors with num_cpus=1, the maximum number of actor allowed to be created is the number of cpus specified in ray.init. But it does not say anything about how much cpu resources an actor are allowed to use.

            – Sherwin Chen
            Mar 26 at 7:04















          1














          It depends how many resources you want to the actor to use. If there is a dedicated machine for a given actor, and it's ok for the actor to use all of the resources on that machine, then use TensorFlow's default settings. If you are creating more like one actor per core, then setting inter_op_parallelism_threads and intra_op_parallelism_threads to small values like 1 or 2 is a good idea.



          In general, you can try both approaches and see which is faster.






          share|improve this answer























          • Thanks, so if I create an actor per core, then both should be set to 1?

            – Sherwin Chen
            Mar 25 at 10:04











          • Yes, though it's worth trying setting inter_op_parallelism_threads to 2 as well to see how that performs. Depending on what the actors are actually doing (e.g., are some of them idle some of the time), that may perform better. However, if they're all busy the whole time, then 1 will prevent too much contention between the actors.

            – Robert Nishihara
            Mar 25 at 22:10











          • Thanks for your patience. I now understand most of your answer, except that "1 will prevent too much contention between the actors. If I've clearly set num_cpus=1`, would there still be any contention between the actors?

            – Sherwin Chen
            Mar 26 at 0:13











          • Yes there can still be contention, when you specify num_cpus=1 in the remote decorator, the Ray scheduler will make sure not to create more than one such actor per core. However, the actor could still be heavily multithreaded and could still use all of the available CPU cores. Ray does not actually prevent the actor from using all of the resources on the machine. Does that make sense?

            – Robert Nishihara
            Mar 26 at 5:52











          • I see. Please allow me to repeat it and see if I understand it right. If I decorate all actors with num_cpus=1, the maximum number of actor allowed to be created is the number of cpus specified in ray.init. But it does not say anything about how much cpu resources an actor are allowed to use.

            – Sherwin Chen
            Mar 26 at 7:04













          1












          1








          1







          It depends how many resources you want to the actor to use. If there is a dedicated machine for a given actor, and it's ok for the actor to use all of the resources on that machine, then use TensorFlow's default settings. If you are creating more like one actor per core, then setting inter_op_parallelism_threads and intra_op_parallelism_threads to small values like 1 or 2 is a good idea.



          In general, you can try both approaches and see which is faster.






          share|improve this answer













          It depends how many resources you want to the actor to use. If there is a dedicated machine for a given actor, and it's ok for the actor to use all of the resources on that machine, then use TensorFlow's default settings. If you are creating more like one actor per core, then setting inter_op_parallelism_threads and intra_op_parallelism_threads to small values like 1 or 2 is a good idea.



          In general, you can try both approaches and see which is faster.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 24 at 22:05









          Robert NishiharaRobert Nishihara

          85569




          85569












          • Thanks, so if I create an actor per core, then both should be set to 1?

            – Sherwin Chen
            Mar 25 at 10:04











          • Yes, though it's worth trying setting inter_op_parallelism_threads to 2 as well to see how that performs. Depending on what the actors are actually doing (e.g., are some of them idle some of the time), that may perform better. However, if they're all busy the whole time, then 1 will prevent too much contention between the actors.

            – Robert Nishihara
            Mar 25 at 22:10











          • Thanks for your patience. I now understand most of your answer, except that "1 will prevent too much contention between the actors. If I've clearly set num_cpus=1`, would there still be any contention between the actors?

            – Sherwin Chen
            Mar 26 at 0:13











          • Yes there can still be contention, when you specify num_cpus=1 in the remote decorator, the Ray scheduler will make sure not to create more than one such actor per core. However, the actor could still be heavily multithreaded and could still use all of the available CPU cores. Ray does not actually prevent the actor from using all of the resources on the machine. Does that make sense?

            – Robert Nishihara
            Mar 26 at 5:52











          • I see. Please allow me to repeat it and see if I understand it right. If I decorate all actors with num_cpus=1, the maximum number of actor allowed to be created is the number of cpus specified in ray.init. But it does not say anything about how much cpu resources an actor are allowed to use.

            – Sherwin Chen
            Mar 26 at 7:04

















          • Thanks, so if I create an actor per core, then both should be set to 1?

            – Sherwin Chen
            Mar 25 at 10:04











          • Yes, though it's worth trying setting inter_op_parallelism_threads to 2 as well to see how that performs. Depending on what the actors are actually doing (e.g., are some of them idle some of the time), that may perform better. However, if they're all busy the whole time, then 1 will prevent too much contention between the actors.

            – Robert Nishihara
            Mar 25 at 22:10











          • Thanks for your patience. I now understand most of your answer, except that "1 will prevent too much contention between the actors. If I've clearly set num_cpus=1`, would there still be any contention between the actors?

            – Sherwin Chen
            Mar 26 at 0:13











          • Yes there can still be contention, when you specify num_cpus=1 in the remote decorator, the Ray scheduler will make sure not to create more than one such actor per core. However, the actor could still be heavily multithreaded and could still use all of the available CPU cores. Ray does not actually prevent the actor from using all of the resources on the machine. Does that make sense?

            – Robert Nishihara
            Mar 26 at 5:52











          • I see. Please allow me to repeat it and see if I understand it right. If I decorate all actors with num_cpus=1, the maximum number of actor allowed to be created is the number of cpus specified in ray.init. But it does not say anything about how much cpu resources an actor are allowed to use.

            – Sherwin Chen
            Mar 26 at 7:04
















          Thanks, so if I create an actor per core, then both should be set to 1?

          – Sherwin Chen
          Mar 25 at 10:04





          Thanks, so if I create an actor per core, then both should be set to 1?

          – Sherwin Chen
          Mar 25 at 10:04













          Yes, though it's worth trying setting inter_op_parallelism_threads to 2 as well to see how that performs. Depending on what the actors are actually doing (e.g., are some of them idle some of the time), that may perform better. However, if they're all busy the whole time, then 1 will prevent too much contention between the actors.

          – Robert Nishihara
          Mar 25 at 22:10





          Yes, though it's worth trying setting inter_op_parallelism_threads to 2 as well to see how that performs. Depending on what the actors are actually doing (e.g., are some of them idle some of the time), that may perform better. However, if they're all busy the whole time, then 1 will prevent too much contention between the actors.

          – Robert Nishihara
          Mar 25 at 22:10













          Thanks for your patience. I now understand most of your answer, except that "1 will prevent too much contention between the actors. If I've clearly set num_cpus=1`, would there still be any contention between the actors?

          – Sherwin Chen
          Mar 26 at 0:13





          Thanks for your patience. I now understand most of your answer, except that "1 will prevent too much contention between the actors. If I've clearly set num_cpus=1`, would there still be any contention between the actors?

          – Sherwin Chen
          Mar 26 at 0:13













          Yes there can still be contention, when you specify num_cpus=1 in the remote decorator, the Ray scheduler will make sure not to create more than one such actor per core. However, the actor could still be heavily multithreaded and could still use all of the available CPU cores. Ray does not actually prevent the actor from using all of the resources on the machine. Does that make sense?

          – Robert Nishihara
          Mar 26 at 5:52





          Yes there can still be contention, when you specify num_cpus=1 in the remote decorator, the Ray scheduler will make sure not to create more than one such actor per core. However, the actor could still be heavily multithreaded and could still use all of the available CPU cores. Ray does not actually prevent the actor from using all of the resources on the machine. Does that make sense?

          – Robert Nishihara
          Mar 26 at 5:52













          I see. Please allow me to repeat it and see if I understand it right. If I decorate all actors with num_cpus=1, the maximum number of actor allowed to be created is the number of cpus specified in ray.init. But it does not say anything about how much cpu resources an actor are allowed to use.

          – Sherwin Chen
          Mar 26 at 7:04





          I see. Please allow me to repeat it and see if I understand it right. If I decorate all actors with num_cpus=1, the maximum number of actor allowed to be created is the number of cpus specified in ray.init. But it does not say anything about how much cpu resources an actor are allowed to use.

          – Sherwin Chen
          Mar 26 at 7:04



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323169%2fshould-i-set-inter-op-parallelism-threads-and-intra-op-parallelism-threads-t%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해