BUILD 118 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260
  1. # --------------------------------------------------------------------
  2. # BAZEL/Buildkite-CI test cases.
  3. # --------------------------------------------------------------------
  4. # To add new RLlib tests, first find the correct category of your new test
  5. # within this file.
  6. # All new tests - within their category - should be added alphabetically!
  7. # Do not just add tests to the bottom of the file.
  8. # Currently we have the following categories:
  9. # - Learning tests/regression, tagged:
  10. # -- "learning_tests_[discrete|continuous]": distinguish discrete
  11. # actions vs continuous actions.
  12. # -- "crashing_cartpole" and "stateless_cartpole" to distinguish between
  13. # simple CartPole and more advanced variants of it.
  14. # -- "ray_data": Tests that rely on ray_data.
  15. # -- "learning_tests_with_ray_data": Learning tests that rely on ray_data.
  16. # - Folder-bound tests, tagged with the name of the top-level dir:
  17. # - `env` directory tests.
  18. # - `evaluation` directory tests.
  19. # - `models` directory tests.
  20. # - `offline` directory tests.
  21. # - `policy` directory tests.
  22. # - `utils` directory tests.
  23. # - Algorithm tests, tagged "algorithms_dir".
  24. # - Tests directory (everything in rllib/tests/...), tagged: "tests_dir"
  25. # - Examples directory (everything in rllib/examples/...), tagged: "examples"
  26. # - Memory leak tests tagged "memory_leak_tests".
  27. # Note: There is a special directory in examples: "documentation" which contains
  28. # all code that is linked to from within the RLlib docs. This code is tested
  29. # separately via the "documentation" tag.
  30. # Additional tags are:
  31. # - "team:rllib": Indicating that all tests in this file are the responsibility of
  32. # the RLlib Team.
  33. # - "needs_gpu": Indicating that a test needs to have a GPU in order to run.
  34. # - "gpu": Indicating that a test may (but doesn't have to) be run in the GPU
  35. # pipeline, defined in .buildkite/pipeline.gpu.yml.
  36. # - "multi_gpu": Indicating that a test will definitely be run in the Large GPU
  37. # pipeline, defined in .buildkite/pipeline.gpu.large.yml.
  38. # - "no_gpu": Indicating that a test should not be run in the GPU pipeline due
  39. # to certain incompatibilities.
  40. # - "no_tf_eager_tracing": Exclude this test from tf-eager tracing tests.
  41. # - "torch_only": Only run this test case with framework=torch.
  42. # Our .buildkite/pipeline.yml and .buildkite/pipeline.gpu.yml files execute all
  43. # these tests in n different jobs.
  44. load("//bazel:python.bzl", "py_test_module_list")
  45. load("//bazel:python.bzl", "doctest")
  46. filegroup(
  47. name = "cartpole-v1_large",
  48. data = glob(["tests/data/cartpole/cartpole-v1_large/*.parquet"]),
  49. visibility = ["//visibility:public"],
  50. )
  51. doctest(
  52. files = glob(
  53. ["**/*.py"],
  54. exclude=[
  55. "**/examples/**",
  56. "**/tests/**",
  57. "**/test_*.py",
  58. # Exclude `tuned_examples` *.py files.
  59. "**/tuned_examples/**",
  60. # Deprecated modules
  61. "utils/window_stat.py",
  62. "utils/timer.py",
  63. "utils/memory.py",
  64. "offline/off_policy_estimator.py",
  65. "offline/estimators/feature_importance.py",
  66. "env/wrappers/recsim_wrapper.py",
  67. "env/remote_vector_env.py",
  68. # Missing imports
  69. "algorithms/dreamerv3/**",
  70. # FIXME: These modules contain broken examples that weren't previously
  71. # tested.
  72. "algorithms/algorithm_config.py",
  73. "algorithms/alpha_star/alpha_star.py",
  74. "algorithms/r2d2/r2d2.py",
  75. "algorithms/sac/rnnsac.py",
  76. "algorithms/simple_q/simple_q.py",
  77. "core/models/base.py",
  78. "core/models/specs/specs_base.py",
  79. "core/models/specs/specs_dict.py",
  80. "env/wrappers/pettingzoo_env.py",
  81. "evaluation/collectors/sample_collector.py",
  82. "evaluation/episode.py",
  83. "evaluation/metrics.py",
  84. "evaluation/observation_function.py",
  85. "evaluation/postprocessing.py",
  86. "execution/buffers/mixin_replay_buffer.py",
  87. "models/base_model.py",
  88. "models/catalog.py",
  89. "models/preprocessors.py",
  90. "models/repeated_values.py",
  91. "models/tf/tf_distributions.py",
  92. "models/torch/model.py",
  93. "models/torch/torch_distributions.py",
  94. "policy/rnn_sequencing.py",
  95. "utils/actor_manager.py",
  96. "utils/filter.py",
  97. "utils/from_config.py",
  98. "utils/metrics/window_stat.py",
  99. "utils/nested_dict.py",
  100. "utils/pre_checks/env.py",
  101. "utils/replay_buffers/multi_agent_mixin_replay_buffer.py",
  102. "utils/spaces/space_utils.py"
  103. ]
  104. ),
  105. tags = ["team:rllib"],
  106. data = glob(["tests/data/cartpole/cartpole-v1_large/*.parquet"]),
  107. size = "enormous",
  108. )
  109. # --------------------------------------------------------------------
  110. # Benchmarks
  111. #
  112. # Tag: benchmark
  113. #
  114. # This is smoke-testing the benchmark scripts.
  115. # --------------------------------------------------------------------
  116. py_test(
  117. name = "torch_compile_inference_bm",
  118. main = "benchmarks/torch_compile/run_inference_bm.py",
  119. tags = ["team:rllib", "exclusive", "benchmark", "torch_2.x_only_benchmark"],
  120. size = "small",
  121. srcs = ["benchmarks/torch_compile/run_inference_bm.py"],
  122. args = ["--smoke-test"]
  123. )
  124. py_test(
  125. name = "torch_compile_ppo_with_inference",
  126. main = "benchmarks/torch_compile/run_ppo_with_inference_bm.py",
  127. tags = ["team:rllib", "exclusive", "benchmark", "torch_2.x_only_benchmark"],
  128. size = "medium",
  129. srcs = ["benchmarks/torch_compile/run_ppo_with_inference_bm.py"],
  130. args = ["--smoke-test"]
  131. )
  132. # --------------------------------------------------------------------
  133. # Algorithms learning regression tests.
  134. #
  135. # Tag: learning_tests
  136. #
  137. # This will test python/yaml config files
  138. # inside rllib/tuned_examples/[algo-name] for actual learning success.
  139. # --------------------------------------------------------------------
  140. # APPO
  141. # CartPole
  142. py_test(
  143. name = "learning_tests_cartpole_appo",
  144. main = "tuned_examples/appo/cartpole_appo.py",
  145. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "torch_only"],
  146. size = "large",
  147. srcs = ["tuned_examples/appo/cartpole_appo.py"],
  148. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  149. )
  150. py_test(
  151. name = "learning_tests_cartpole_appo_gpu",
  152. main = "tuned_examples/appo/cartpole_appo.py",
  153. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  154. size = "large",
  155. srcs = ["tuned_examples/appo/cartpole_appo.py"],
  156. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  157. )
  158. py_test(
  159. name = "learning_tests_cartpole_appo_multi_cpu",
  160. main = "tuned_examples/appo/cartpole_appo.py",
  161. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  162. size = "large",
  163. srcs = ["tuned_examples/appo/cartpole_appo.py"],
  164. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  165. )
  166. py_test(
  167. name = "learning_tests_cartpole_appo_multi_gpu",
  168. main = "tuned_examples/appo/cartpole_appo.py",
  169. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  170. size = "large",
  171. srcs = ["tuned_examples/appo/cartpole_appo.py"],
  172. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  173. )
  174. # MultiAgentCartPole
  175. py_test(
  176. name = "learning_tests_multi_agent_cartpole_appo",
  177. main = "tuned_examples/appo/multi_agent_cartpole_appo.py",
  178. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "torch_only"],
  179. size = "large",
  180. srcs = ["tuned_examples/appo/multi_agent_cartpole_appo.py"],
  181. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1"]
  182. )
  183. py_test(
  184. name = "learning_tests_multi_agent_cartpole_appo_gpu",
  185. main = "tuned_examples/appo/multi_agent_cartpole_appo.py",
  186. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  187. size = "large",
  188. srcs = ["tuned_examples/appo/multi_agent_cartpole_appo.py"],
  189. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1", "--num-cpus=6"]
  190. )
  191. py_test(
  192. name = "learning_tests_multi_agent_cartpole_appo_multi_cpu",
  193. main = "tuned_examples/appo/multi_agent_cartpole_appo.py",
  194. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  195. size = "large",
  196. srcs = ["tuned_examples/appo/multi_agent_cartpole_appo.py"],
  197. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2", "--num-cpus=7"]
  198. )
  199. py_test(
  200. name = "learning_tests_multi_agent_cartpole_appo_multi_gpu",
  201. main = "tuned_examples/appo/multi_agent_cartpole_appo.py",
  202. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  203. size = "large",
  204. srcs = ["tuned_examples/appo/multi_agent_cartpole_appo.py"],
  205. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2", "--num-cpus=7"]
  206. )
  207. # StatelessCartPole
  208. py_test(
  209. name = "learning_tests_stateless_cartpole_appo",
  210. main = "tuned_examples/appo/stateless_cartpole_appo.py",
  211. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  212. size = "large",
  213. srcs = ["tuned_examples/appo/stateless_cartpole_appo.py"],
  214. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  215. )
  216. py_test(
  217. name = "learning_tests_stateless_cartpole_appo_gpu",
  218. main = "tuned_examples/appo/stateless_cartpole_appo.py",
  219. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  220. size = "large",
  221. srcs = ["tuned_examples/appo/stateless_cartpole_appo.py"],
  222. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1"]
  223. )
  224. py_test(
  225. name = "learning_tests_stateless_cartpole_appo_multi_cpu",
  226. main = "tuned_examples/appo/stateless_cartpole_appo.py",
  227. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  228. size = "large",
  229. srcs = ["tuned_examples/appo/stateless_cartpole_appo.py"],
  230. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  231. )
  232. py_test(
  233. name = "learning_tests_stateless_cartpole_appo_multi_gpu",
  234. main = "tuned_examples/appo/stateless_cartpole_appo.py",
  235. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  236. size = "large",
  237. srcs = ["tuned_examples/appo/stateless_cartpole_appo.py"],
  238. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  239. )
  240. # MultiAgentStatelessCartPole
  241. py_test(
  242. name = "learning_tests_multi_agent_stateless_cartpole_appo",
  243. main = "tuned_examples/appo/multi_agent_stateless_cartpole_appo.py",
  244. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  245. size = "large",
  246. srcs = ["tuned_examples/appo/multi_agent_stateless_cartpole_appo.py"],
  247. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  248. )
  249. py_test(
  250. name = "learning_tests_multi_agent_stateless_cartpole_appo_gpu",
  251. main = "tuned_examples/appo/multi_agent_stateless_cartpole_appo.py",
  252. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  253. size = "large",
  254. srcs = ["tuned_examples/appo/multi_agent_stateless_cartpole_appo.py"],
  255. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1"]
  256. )
  257. py_test(
  258. name = "learning_tests_multi_agent_stateless_cartpole_appo_multi_cpu",
  259. main = "tuned_examples/appo/multi_agent_stateless_cartpole_appo.py",
  260. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  261. size = "enormous",
  262. srcs = ["tuned_examples/appo/multi_agent_stateless_cartpole_appo.py"],
  263. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  264. )
  265. py_test(
  266. name = "learning_tests_multi_agent_stateless_cartpole_appo_multi_gpu",
  267. main = "tuned_examples/appo/multi_agent_stateless_cartpole_appo.py",
  268. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  269. size = "enormous",
  270. srcs = ["tuned_examples/appo/multi_agent_stateless_cartpole_appo.py"],
  271. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  272. )
  273. #@OldAPIStack
  274. py_test(
  275. name = "learning_tests_cartpole_separate_losses_appo_old_api_stack",
  276. main = "tests/run_regression_tests.py",
  277. tags = ["team:rllib", "torch_only", "exclusive", "learning_tests", "learning_tests_discrete"],
  278. size = "medium",
  279. srcs = ["tests/run_regression_tests.py"],
  280. data = [
  281. "tuned_examples/appo/cartpole-appo-separate-losses.py"
  282. ],
  283. args = ["--dir=tuned_examples/appo"]
  284. )
  285. #@OldAPIStack
  286. py_test(
  287. name = "learning_tests_multi_agent_cartpole_appo_old_api_stack",
  288. main = "tests/run_regression_tests.py",
  289. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete"],
  290. size = "large",
  291. srcs = ["tests/run_regression_tests.py"],
  292. data = ["tuned_examples/appo/multi_agent_cartpole_appo_old_api_stack.py"],
  293. args = ["--dir=tuned_examples/appo"]
  294. )
  295. #@OldAPIStack
  296. py_test(
  297. name = "learning_tests_multi_agent_cartpole_w_100_policies_appo_old_api_stack",
  298. main = "tests/run_regression_tests.py",
  299. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  300. size = "enormous",
  301. srcs = ["tests/run_regression_tests.py"],
  302. data = ["tuned_examples/appo/multi-agent-cartpole-w-100-policies-appo.py"],
  303. args = ["--dir=tuned_examples/appo"]
  304. )
  305. # BC
  306. # CartPole
  307. py_test(
  308. name = "learning_tests_cartpole_bc",
  309. main = "tuned_examples/bc/cartpole_bc.py",
  310. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  311. size = "medium",
  312. srcs = ["tuned_examples/bc/cartpole_bc.py"],
  313. # Include the offline data files.
  314. data = [
  315. "tests/data/cartpole/cartpole-v1_large",
  316. ],
  317. args = ["--as-test", "--enable-new-api-stack"]
  318. )
  319. # CQL
  320. # Pendulum
  321. py_test(
  322. name = "learning_tests_pendulum_cql",
  323. main = "tuned_examples/cql/pendulum_cql.py",
  324. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_cartpole", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  325. size = "large",
  326. srcs = ["tuned_examples/cql/pendulum_cql.py"],
  327. # Include the zipped json data file as well.
  328. data = [
  329. "tests/data/pendulum/pendulum-v1_enormous",
  330. ],
  331. args = ["--as-test", "--enable-new-api-stack"]
  332. )
  333. # DQN
  334. # CartPole
  335. py_test(
  336. name = "learning_tests_cartpole_dqn",
  337. main = "tuned_examples/dqn/cartpole_dqn.py",
  338. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  339. size = "large",
  340. srcs = ["tuned_examples/dqn/cartpole_dqn.py"],
  341. args = ["--as-test", "--enable-new-api-stack"]
  342. )
  343. py_test(
  344. name = "learning_tests_cartpole_dqn_gpu",
  345. main = "tuned_examples/dqn/cartpole_dqn.py",
  346. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  347. size = "large",
  348. srcs = ["tuned_examples/dqn/cartpole_dqn.py"],
  349. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  350. )
  351. py_test(
  352. name = "learning_tests_cartpole_dqn_multi_cpu",
  353. main = "tuned_examples/dqn/cartpole_dqn.py",
  354. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  355. size = "large",
  356. srcs = ["tuned_examples/dqn/cartpole_dqn.py"],
  357. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  358. )
  359. py_test(
  360. name = "learning_tests_cartpole_dqn_multi_gpu",
  361. main = "tuned_examples/dqn/cartpole_dqn.py",
  362. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  363. size = "large",
  364. srcs = ["tuned_examples/dqn/cartpole_dqn.py"],
  365. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  366. )
  367. # MultiAgentCartPole
  368. py_test(
  369. name = "learning_tests_multi_agent_cartpole_dqn",
  370. main = "tuned_examples/dqn/multi_agent_cartpole_dqn.py",
  371. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  372. size = "large",
  373. srcs = ["tuned_examples/dqn/multi_agent_cartpole_dqn.py"],
  374. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-cpus=4"]
  375. )
  376. py_test(
  377. name = "learning_tests_multi_agent_cartpole_dqn_gpu",
  378. main = "tuned_examples/dqn/multi_agent_cartpole_dqn.py",
  379. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  380. size = "large",
  381. srcs = ["tuned_examples/dqn/multi_agent_cartpole_dqn.py"],
  382. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-cpus=4", "--num-gpus=1"]
  383. )
  384. py_test(
  385. name = "learning_tests_multi_agent_cartpole_dqn_multi_cpu",
  386. main = "tuned_examples/dqn/multi_agent_cartpole_dqn.py",
  387. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  388. size = "large",
  389. srcs = ["tuned_examples/dqn/multi_agent_cartpole_dqn.py"],
  390. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-cpus=5", "--num-gpus=2"]
  391. )
  392. py_test(
  393. name = "learning_tests_multi_agent_cartpole_dqn_multi_gpu",
  394. main = "tuned_examples/dqn/multi_agent_cartpole_dqn.py",
  395. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  396. size = "large",
  397. srcs = ["tuned_examples/dqn/multi_agent_cartpole_dqn.py"],
  398. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-cpus=4", "--num-gpus=2"]
  399. )
  400. # IMPALA
  401. # CartPole
  402. py_test(
  403. name = "learning_tests_cartpole_impala",
  404. main = "tuned_examples/impala/cartpole_impala.py",
  405. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "torch_only"],
  406. size = "large",
  407. srcs = ["tuned_examples/impala/cartpole_impala.py"],
  408. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  409. )
  410. py_test(
  411. name = "learning_tests_cartpole_impala_gpu",
  412. main = "tuned_examples/impala/cartpole_impala.py",
  413. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  414. size = "large",
  415. srcs = ["tuned_examples/impala/cartpole_impala.py"],
  416. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  417. )
  418. py_test(
  419. name = "learning_tests_cartpole_impala_multi_cpu",
  420. main = "tuned_examples/impala/cartpole_impala.py",
  421. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  422. size = "large",
  423. srcs = ["tuned_examples/impala/cartpole_impala.py"],
  424. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  425. )
  426. py_test(
  427. name = "learning_tests_cartpole_impala_multi_gpu",
  428. main = "tuned_examples/impala/cartpole_impala.py",
  429. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  430. size = "large",
  431. srcs = ["tuned_examples/impala/cartpole_impala.py"],
  432. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  433. )
  434. # MultiAgentCartPole
  435. py_test(
  436. name = "learning_tests_multi_agent_cartpole_impala",
  437. main = "tuned_examples/impala/multi_agent_cartpole_impala.py",
  438. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "torch_only"],
  439. size = "large",
  440. srcs = ["tuned_examples/impala/multi_agent_cartpole_impala.py"],
  441. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1", "--num-cpus=6"]
  442. )
  443. py_test(
  444. name = "learning_tests_multi_agent_cartpole_impala_gpu",
  445. main = "tuned_examples/impala/multi_agent_cartpole_impala.py",
  446. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  447. size = "large",
  448. srcs = ["tuned_examples/impala/multi_agent_cartpole_impala.py"],
  449. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1", "--num-cpus=6"]
  450. )
  451. py_test(
  452. name = "learning_tests_multi_agent_cartpole_impala_multi_cpu",
  453. main = "tuned_examples/impala/multi_agent_cartpole_impala.py",
  454. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  455. size = "enormous",
  456. srcs = ["tuned_examples/impala/multi_agent_cartpole_impala.py"],
  457. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2", "--num-cpus=7"]
  458. )
  459. py_test(
  460. name = "learning_tests_multi_agent_cartpole_impala_multi_gpu",
  461. main = "tuned_examples/impala/multi_agent_cartpole_impala.py",
  462. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  463. size = "large",
  464. srcs = ["tuned_examples/impala/multi_agent_cartpole_impala.py"],
  465. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2", "--num-cpus=7"]
  466. )
  467. # StatelessCartPole
  468. py_test(
  469. name = "learning_tests_stateless_cartpole_impala",
  470. main = "tuned_examples/impala/stateless_cartpole_impala.py",
  471. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  472. size = "large",
  473. srcs = ["tuned_examples/impala/stateless_cartpole_impala.py"],
  474. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  475. )
  476. py_test(
  477. name = "learning_tests_stateless_cartpole_impala_multi_gpu",
  478. main = "tuned_examples/impala/stateless_cartpole_impala.py",
  479. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  480. size = "large",
  481. srcs = ["tuned_examples/impala/stateless_cartpole_impala.py"],
  482. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  483. )
  484. # MultiAgentStatelessCartPole
  485. py_test(
  486. name = "learning_tests_multi_agent_stateless_cartpole_impala",
  487. main = "tuned_examples/impala/multi_agent_stateless_cartpole_impala.py",
  488. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  489. size = "large",
  490. srcs = ["tuned_examples/impala/multi_agent_stateless_cartpole_impala.py"],
  491. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  492. )
  493. py_test(
  494. name = "learning_tests_multi_agent_stateless_cartpole_impala_multi_gpu",
  495. main = "tuned_examples/impala/multi_agent_stateless_cartpole_impala.py",
  496. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  497. size = "large",
  498. srcs = ["tuned_examples/impala/multi_agent_stateless_cartpole_impala.py"],
  499. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  500. )
  501. #@OldAPIstack
  502. py_test(
  503. name = "learning_tests_cartpole_separate_losses_impala_old_api_stack",
  504. main = "tests/run_regression_tests.py",
  505. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete"],
  506. size = "medium",
  507. srcs = ["tests/run_regression_tests.py"],
  508. data = [
  509. "tuned_examples/impala/cartpole-impala-separate-losses.py"
  510. ],
  511. args = ["--dir=tuned_examples/impala"]
  512. )
  513. #@OldAPIStack
  514. py_test(
  515. name = "learning_tests_multi_agent_cartpole_impala_old_api_stack",
  516. main = "tests/run_regression_tests.py",
  517. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete"],
  518. size = "medium",
  519. srcs = ["tests/run_regression_tests.py"],
  520. data = ["tuned_examples/impala/multi_agent_cartpole_impala_old_api_stack.py"],
  521. args = ["--dir=tuned_examples/impala"]
  522. )
  523. # MARWIL
  524. # CartPole
  525. py_test(
  526. name = "learning_tests_cartpole_marwil",
  527. main = "tuned_examples/marwil/cartpole_marwil.py",
  528. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  529. size = "large",
  530. srcs = ["tuned_examples/marwil/cartpole_marwil.py"],
  531. # Include the offline data files.
  532. data = [
  533. "tests/data/cartpole/cartpole-v1_large",
  534. ],
  535. args = ["--as-test", "--enable-new-api-stack"]
  536. )
  537. # PPO
  538. # CartPole
  539. py_test(
  540. name = "learning_tests_cartpole_ppo",
  541. main = "tuned_examples/ppo/cartpole_ppo.py",
  542. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "torch_only"],
  543. size = "large",
  544. srcs = ["tuned_examples/ppo/cartpole_ppo.py"],
  545. args = ["--as-test", "--enable-new-api-stack"]
  546. )
  547. py_test(
  548. name = "learning_tests_cartpole_ppo_gpu",
  549. main = "tuned_examples/ppo/cartpole_ppo.py",
  550. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  551. size = "large",
  552. srcs = ["tuned_examples/ppo/cartpole_ppo.py"],
  553. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  554. )
  555. py_test(
  556. name = "learning_tests_cartpole_ppo_multi_cpu",
  557. main = "tuned_examples/ppo/cartpole_ppo.py",
  558. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  559. size = "large",
  560. srcs = ["tuned_examples/ppo/cartpole_ppo.py"],
  561. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  562. )
  563. py_test(
  564. name = "learning_tests_cartpole_ppo_multi_gpu",
  565. main = "tuned_examples/ppo/cartpole_ppo.py",
  566. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  567. size = "large",
  568. srcs = ["tuned_examples/ppo/cartpole_ppo.py"],
  569. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  570. )
  571. # MultiAgentCartPole
  572. py_test(
  573. name = "learning_tests_multi_agent_cartpole_ppo",
  574. main = "tuned_examples/ppo/multi_agent_cartpole_ppo.py",
  575. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "torch_only"],
  576. size = "large",
  577. srcs = ["tuned_examples/ppo/multi_agent_cartpole_ppo.py"],
  578. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2"]
  579. )
  580. py_test(
  581. name = "learning_tests_multi_agent_cartpole_ppo_gpu",
  582. main = "tuned_examples/ppo/multi_agent_cartpole_ppo.py",
  583. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  584. size = "large",
  585. srcs = ["tuned_examples/ppo/multi_agent_cartpole_ppo.py"],
  586. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1"]
  587. )
  588. py_test(
  589. name = "learning_tests_multi_agent_cartpole_ppo_multi_cpu",
  590. main = "tuned_examples/ppo/multi_agent_cartpole_ppo.py",
  591. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  592. size = "large",
  593. srcs = ["tuned_examples/ppo/multi_agent_cartpole_ppo.py"],
  594. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2"]
  595. )
  596. py_test(
  597. name = "learning_tests_multi_agent_cartpole_ppo_multi_gpu",
  598. main = "tuned_examples/ppo/multi_agent_cartpole_ppo.py",
  599. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  600. size = "large",
  601. srcs = ["tuned_examples/ppo/multi_agent_cartpole_ppo.py"],
  602. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2"]
  603. )
  604. # CartPole (truncated)
  605. py_test(
  606. name = "learning_tests_cartpole_truncated_ppo",
  607. main = "tuned_examples/ppo/cartpole_truncated_ppo.py",
  608. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "torch_only"],
  609. size = "large",
  610. srcs = ["tuned_examples/ppo/cartpole_truncated_ppo.py"],
  611. args = ["--as-test", "--enable-new-api-stack"]
  612. )
  613. # StatelessCartPole
  614. py_test(
  615. name = "learning_tests_stateless_cartpole_ppo",
  616. main = "tuned_examples/ppo/stateless_cartpole_ppo.py",
  617. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "torch_only"],
  618. size = "large",
  619. srcs = ["tuned_examples/ppo/stateless_cartpole_ppo.py"],
  620. args = ["--as-test", "--enable-new-api-stack"]
  621. )
  622. py_test(
  623. name = "learning_tests_stateless_cartpole_ppo_gpu",
  624. main = "tuned_examples/ppo/stateless_cartpole_ppo.py",
  625. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  626. size = "large",
  627. srcs = ["tuned_examples/ppo/stateless_cartpole_ppo.py"],
  628. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  629. )
  630. py_test(
  631. name = "learning_tests_stateless_cartpole_ppo_multi_cpu",
  632. main = "tuned_examples/ppo/stateless_cartpole_ppo.py",
  633. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  634. size = "large",
  635. srcs = ["tuned_examples/ppo/stateless_cartpole_ppo.py"],
  636. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  637. )
  638. py_test(
  639. name = "learning_tests_stateless_cartpole_ppo_multi_gpu",
  640. main = "tuned_examples/ppo/stateless_cartpole_ppo.py",
  641. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  642. size = "large",
  643. srcs = ["tuned_examples/ppo/stateless_cartpole_ppo.py"],
  644. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  645. )
  646. # MultiAgentStatelessCartPole
  647. py_test(
  648. name = "learning_tests_multi_agent_stateless_cartpole_ppo",
  649. main = "tuned_examples/ppo/multi_agent_stateless_cartpole_ppo.py",
  650. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete", "torch_only"],
  651. size = "large",
  652. srcs = ["tuned_examples/ppo/multi_agent_stateless_cartpole_ppo.py"],
  653. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2"]
  654. )
  655. py_test(
  656. name = "learning_tests_multi_agent_stateless_cartpole_ppo_gpu",
  657. main = "tuned_examples/ppo/multi_agent_stateless_cartpole_ppo.py",
  658. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "gpu"],
  659. size = "large",
  660. srcs = ["tuned_examples/ppo/multi_agent_stateless_cartpole_ppo.py"],
  661. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1"]
  662. )
  663. py_test(
  664. name = "learning_tests_multi_agent_stateless_cartpole_ppo_multi_cpu",
  665. main = "tuned_examples/ppo/multi_agent_stateless_cartpole_ppo.py",
  666. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core"],
  667. size = "large",
  668. srcs = ["tuned_examples/ppo/multi_agent_stateless_cartpole_ppo.py"],
  669. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2"]
  670. )
  671. py_test(
  672. name = "learning_tests_multi_agent_stateless_cartpole_ppo_multi_gpu",
  673. main = "tuned_examples/ppo/multi_agent_stateless_cartpole_ppo.py",
  674. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_discrete", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  675. size = "large",
  676. srcs = ["tuned_examples/ppo/multi_agent_stateless_cartpole_ppo.py"],
  677. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2"]
  678. )
  679. # Pendulum
  680. py_test(
  681. name = "learning_tests_pendulum_ppo",
  682. main = "tuned_examples/ppo/pendulum_ppo.py",
  683. tags = ["torch_only", "team:rllib", "exclusive", "learning_tests", "learning_tests_continuous"],
  684. size = "large",
  685. srcs = ["tuned_examples/ppo/pendulum_ppo.py"],
  686. args = ["--as-test", "--enable-new-api-stack"]
  687. )
  688. py_test(
  689. name = "learning_tests_pendulum_ppo_gpu",
  690. main = "tuned_examples/ppo/pendulum_ppo.py",
  691. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "learning_tests_pytorch_use_all_core", "gpu"],
  692. size = "large",
  693. srcs = ["tuned_examples/ppo/pendulum_ppo.py"],
  694. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  695. )
  696. py_test(
  697. name = "learning_tests_pendulum_ppo_multi_cpu",
  698. main = "tuned_examples/ppo/pendulum_ppo.py",
  699. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "learning_tests_pytorch_use_all_core"],
  700. size = "large",
  701. srcs = ["tuned_examples/ppo/pendulum_ppo.py"],
  702. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  703. )
  704. py_test(
  705. name = "learning_tests_pendulum_ppo_multi_gpu",
  706. main = "tuned_examples/ppo/pendulum_ppo.py",
  707. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  708. size = "large",
  709. srcs = ["tuned_examples/ppo/pendulum_ppo.py"],
  710. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  711. )
  712. # MultiAgentPendulum
  713. py_test(
  714. name = "learning_tests_multi_agent_pendulum_ppo",
  715. main = "tuned_examples/ppo/multi_agent_pendulum_ppo.py",
  716. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_continuous", "torch_only"],
  717. size = "large",
  718. srcs = ["tuned_examples/ppo/multi_agent_pendulum_ppo.py"],
  719. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2"]
  720. )
  721. py_test(
  722. name = "learning_tests_multi_agent_pendulum_ppo_gpu",
  723. main = "tuned_examples/ppo/multi_agent_pendulum_ppo.py",
  724. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "learning_tests_pytorch_use_all_core", "gpu"],
  725. size = "large",
  726. srcs = ["tuned_examples/ppo/multi_agent_pendulum_ppo.py"],
  727. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=1"]
  728. )
  729. py_test(
  730. name = "learning_tests_multi_agent_pendulum_ppo_multi_cpu",
  731. main = "tuned_examples/ppo/multi_agent_pendulum_ppo.py",
  732. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "learning_tests_pytorch_use_all_core"],
  733. size = "large",
  734. srcs = ["tuned_examples/ppo/multi_agent_pendulum_ppo.py"],
  735. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2"]
  736. )
  737. py_test(
  738. name = "learning_tests_multi_agent_pendulum_ppo_multi_gpu",
  739. main = "tuned_examples/ppo/multi_agent_pendulum_ppo.py",
  740. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "learning_tests_pytorch_use_all_core", "multi_gpu"],
  741. size = "large",
  742. srcs = ["tuned_examples/ppo/multi_agent_pendulum_ppo.py"],
  743. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-gpus=2"]
  744. )
  745. #@OldAPIStack
  746. py_test(
  747. name = "learning_tests_pendulum_ppo_old_api_stack",
  748. main = "tests/run_regression_tests.py",
  749. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_continuous", "no_tf_static_graph"],
  750. size = "large", # bazel may complain about it being too long sometimes - large is on purpose as some frameworks take longer
  751. srcs = ["tests/run_regression_tests.py"],
  752. data = ["tuned_examples/ppo/pendulum-ppo.yaml"],
  753. args = ["--dir=tuned_examples/ppo"]
  754. )
  755. #@OldAPIStack
  756. py_test(
  757. name = "learning_tests_transformed_actions_pendulum_ppo_old_api_stack",
  758. main = "tests/run_regression_tests.py",
  759. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_continuous", "no_tf_static_graph"],
  760. size = "large", # bazel may complain about it being too long sometimes - large is on purpose as some frameworks take longer
  761. srcs = ["tests/run_regression_tests.py"],
  762. data = ["tuned_examples/ppo/pendulum-transformed-actions-ppo.yaml"],
  763. args = ["--dir=tuned_examples/ppo"]
  764. )
  765. #@OldAPIStack
  766. py_test(
  767. name = "learning_tests_repeat_after_me_ppo_old_api_stack",
  768. main = "tests/run_regression_tests.py",
  769. tags = ["team:rllib", "exclusive", "learning_tests", "learning_tests_discrete"],
  770. size = "medium",
  771. srcs = ["tests/run_regression_tests.py"],
  772. data = ["tuned_examples/ppo/repeatafterme-ppo-lstm.yaml"],
  773. args = ["--dir=tuned_examples/ppo"]
  774. )
  775. # SAC
  776. # Pendulum
  777. py_test(
  778. name = "learning_tests_pendulum_sac",
  779. main = "tuned_examples/sac/pendulum_sac.py",
  780. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous"],
  781. size = "large",
  782. srcs = ["tuned_examples/sac/pendulum_sac.py"],
  783. args = ["--as-test", "--enable-new-api-stack"]
  784. )
  785. py_test(
  786. name = "learning_tests_pendulum_sac_gpu",
  787. main = "tuned_examples/sac/pendulum_sac.py",
  788. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "gpu"],
  789. size = "large",
  790. srcs = ["tuned_examples/sac/pendulum_sac.py"],
  791. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=1"]
  792. )
  793. py_test(
  794. name = "learning_tests_pendulum_sac_multi_cpu",
  795. main = "tuned_examples/sac/pendulum_sac.py",
  796. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous"],
  797. size = "large",
  798. srcs = ["tuned_examples/sac/pendulum_sac.py"],
  799. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  800. )
  801. py_test(
  802. name = "learning_tests_pendulum_sac_multi_gpu",
  803. main = "tuned_examples/sac/pendulum_sac.py",
  804. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "multi_gpu"],
  805. size = "large",
  806. srcs = ["tuned_examples/sac/pendulum_sac.py"],
  807. args = ["--as-test", "--enable-new-api-stack", "--num-gpus=2"]
  808. )
  809. # MultiAgentPendulum
  810. py_test(
  811. name = "learning_tests_multi_agent_pendulum_sac",
  812. main = "tuned_examples/sac/multi_agent_pendulum_sac.py",
  813. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous"],
  814. size = "large",
  815. srcs = ["tuned_examples/sac/multi_agent_pendulum_sac.py"],
  816. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-cpus=4"]
  817. )
  818. py_test(
  819. name = "learning_tests_multi_agent_pendulum_sac_gpu",
  820. main = "tuned_examples/sac/multi_agent_pendulum_sac.py",
  821. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "gpu"],
  822. size = "large",
  823. srcs = ["tuned_examples/sac/multi_agent_pendulum_sac.py"],
  824. args = ["--as-test", "--enable-new-api-stack", "--num-agents=2", "--num-cpus=4", "--num-gpus=1"]
  825. )
  826. py_test(
  827. name = "learning_tests_multi_agent_pendulum_sac_multi_cpu",
  828. main = "tuned_examples/sac/multi_agent_pendulum_sac.py",
  829. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous"],
  830. size = "large",
  831. srcs = ["tuned_examples/sac/multi_agent_pendulum_sac.py"],
  832. args = ["--enable-new-api-stack", "--num-agents=2", "--num-gpus=2"]
  833. )
  834. py_test(
  835. name = "learning_tests_multi_agent_pendulum_sac_multi_gpu",
  836. main = "tuned_examples/sac/multi_agent_pendulum_sac.py",
  837. tags = ["team:rllib", "exclusive", "learning_tests", "torch_only", "learning_tests_continuous", "multi_gpu"],
  838. size = "large",
  839. srcs = ["tuned_examples/sac/multi_agent_pendulum_sac.py"],
  840. args = ["--enable-new-api-stack", "--num-agents=2", "--num-gpus=2"]
  841. )
  842. # --------------------------------------------------------------------
  843. # Algorithms (Compilation, Losses, simple functionality tests)
  844. # rllib/algorithms/
  845. #
  846. # Tag: algorithms_dir
  847. # --------------------------------------------------------------------
  848. # Generic (all Algorithms)
  849. py_test(
  850. name = "test_algorithm",
  851. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  852. size = "large",
  853. srcs = ["algorithms/tests/test_algorithm.py"],
  854. data = ["tests/data/cartpole/small.json"],
  855. )
  856. py_test(
  857. name = "test_algorithm_config",
  858. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  859. size = "medium",
  860. srcs = ["algorithms/tests/test_algorithm_config.py"],
  861. )
  862. py_test(
  863. name = "test_algorithm_export_checkpoint",
  864. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  865. size = "medium",
  866. srcs = ["algorithms/tests/test_algorithm_export_checkpoint.py"],
  867. )
  868. py_test(
  869. name ="test_algorithm_save_load_checkpoint_learner",
  870. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  871. size = "medium",
  872. srcs = ["algorithms/tests/test_algorithm_save_load_checkpoint_learner.py"]
  873. )
  874. py_test(
  875. name="test_algorithm_rl_module_restore",
  876. tags=["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  877. size="large",
  878. srcs=["algorithms/tests/test_algorithm_rl_module_restore.py"]
  879. )
  880. py_test(
  881. name = "test_algorithm_imports",
  882. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  883. size = "small",
  884. srcs = ["algorithms/tests/test_algorithm_imports.py"]
  885. )
  886. py_test(
  887. name = "test_callbacks_on_algorithm",
  888. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  889. size = "large",
  890. srcs = ["algorithms/tests/test_callbacks_on_algorithm.py"]
  891. )
  892. py_test(
  893. name = "test_callbacks_on_env_runner",
  894. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  895. size = "medium",
  896. srcs = ["algorithms/tests/test_callbacks_on_env_runner.py"]
  897. )
  898. # @OldAPIStack
  899. py_test(
  900. name = "test_callbacks_old_api_stack",
  901. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  902. size = "medium",
  903. srcs = ["algorithms/tests/test_callbacks_old_api_stack.py"]
  904. )
  905. py_test(
  906. name = "test_registry",
  907. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic"],
  908. size = "small",
  909. srcs = ["algorithms/tests/test_registry.py"],
  910. )
  911. py_test(
  912. name = "test_env_runner_failures",
  913. tags = ["team:rllib", "algorithms_dir", "algorithms_dir_generic", "exclusive"],
  914. size = "large",
  915. srcs = ["algorithms/tests/test_env_runner_failures.py"]
  916. )
  917. py_test(
  918. name = "test_node_failures",
  919. tags = ["team:rllib", "tests_dir", "exclusive"],
  920. size = "large",
  921. srcs = ["algorithms/tests/test_node_failures.py"],
  922. )
  923. # Specific Algorithms
  924. # APPO
  925. # @OldAPIStack
  926. py_test(
  927. name = "test_appo",
  928. tags = ["team:rllib", "algorithms_dir"],
  929. size = "large",
  930. srcs = ["algorithms/appo/tests/test_appo.py"]
  931. )
  932. py_test(
  933. name = "test_appo_learner",
  934. tags = ["team:rllib", "algorithms_dir"],
  935. size = "medium",
  936. srcs = ["algorithms/appo/tests/test_appo_learner.py"]
  937. )
  938. # BC
  939. py_test(
  940. name = "test_bc",
  941. tags = ["team:rllib", "algorithms_dir"],
  942. size = "medium",
  943. # Include the offline data files.
  944. data = ["tests/data/cartpole/cartpole-v1_large"],
  945. srcs = ["algorithms/bc/tests/test_bc.py"]
  946. )
  947. # @OldAPIStack
  948. py_test(
  949. name = "test_bc_old_api_stack",
  950. tags = ["team:rllib", "algorithms_dir"],
  951. size = "medium",
  952. # Include the json data file.
  953. data = ["tests/data/cartpole/large.json"],
  954. srcs = ["algorithms/bc/tests/test_bc_old_api_stack.py"]
  955. )
  956. # CQL
  957. py_test(
  958. name = "test_cql",
  959. tags = ["team:rllib", "algorithms_dir"],
  960. size = "large",
  961. data = ["tests/data/pendulum/small.json"],
  962. srcs = ["algorithms/cql/tests/test_cql.py"]
  963. )
  964. # DQN
  965. py_test(
  966. name = "test_dqn",
  967. tags = ["team:rllib", "algorithms_dir"],
  968. size = "large",
  969. srcs = ["algorithms/dqn/tests/test_dqn.py"]
  970. )
  971. # DreamerV3
  972. py_test(
  973. name = "test_dreamerv3",
  974. tags = ["team:rllib", "algorithms_dir"],
  975. size = "large",
  976. srcs = ["algorithms/dreamerv3/tests/test_dreamerv3.py"]
  977. )
  978. # IMPALA
  979. py_test(
  980. name = "test_impala",
  981. tags = ["team:rllib", "algorithms_dir"],
  982. size = "large",
  983. srcs = ["algorithms/impala/tests/test_impala.py"]
  984. )
  985. py_test(
  986. name = "test_vtrace_v2",
  987. tags = ["team:rllib", "algorithms_dir"],
  988. size = "small",
  989. srcs = ["algorithms/impala/tests/test_vtrace_v2.py"]
  990. )
  991. # @OldAPIStack
  992. py_test(
  993. name = "test_vtrace_old_api_stack",
  994. tags = ["team:rllib", "algorithms_dir"],
  995. size = "small",
  996. srcs = ["algorithms/impala/tests/test_vtrace_old_api_stack.py"]
  997. )
  998. # MARWIL
  999. py_test(
  1000. name = "test_marwil",
  1001. tags = ["team:rllib", "algorithms_dir"],
  1002. size = "large",
  1003. # Include the offline data files.
  1004. data = [
  1005. "tests/data/cartpole/cartpole-v1_large",
  1006. "tests/data/pendulum/pendulum-v1_large",
  1007. ],
  1008. srcs = ["algorithms/marwil/tests/test_marwil.py"]
  1009. )
  1010. py_test(
  1011. name = "test_marwil_rl_module",
  1012. tags = ["team:rllib", "algorithms_dir"],
  1013. size = "large",
  1014. # Include the json data file.
  1015. data = [
  1016. "tests/data/cartpole/large.json",
  1017. ],
  1018. srcs = ["algorithms/marwil/tests/test_marwil_rl_module.py"]
  1019. )
  1020. # @OldAPIStack
  1021. py_test(
  1022. name = "test_marwil_old_api_stack",
  1023. tags = ["team:rllib", "algorithms_dir"],
  1024. size = "large",
  1025. # Include the json data file.
  1026. data = [
  1027. "tests/data/cartpole/large.json",
  1028. "tests/data/pendulum/large.json",
  1029. "tests/data/cartpole/small.json",
  1030. ],
  1031. srcs = ["algorithms/marwil/tests/test_marwil_old_api_stack.py"]
  1032. )
  1033. # PPO
  1034. py_test(
  1035. name = "test_ppo",
  1036. tags = ["team:rllib", "algorithms_dir"],
  1037. size = "medium",
  1038. srcs = ["algorithms/ppo/tests/test_ppo.py"]
  1039. )
  1040. py_test(
  1041. name = "test_ppo_rl_module",
  1042. tags = ["team:rllib", "algorithms_dir"],
  1043. size = "large",
  1044. srcs = ["algorithms/ppo/tests/test_ppo_rl_module.py"]
  1045. )
  1046. py_test(
  1047. name = "test_ppo_learner",
  1048. tags = ["team:rllib", "algorithms_dir"],
  1049. size = "large",
  1050. srcs = ["algorithms/ppo/tests/test_ppo_learner.py"]
  1051. )
  1052. # @OldAPIStack
  1053. py_test(
  1054. name = "test_ppo_old_api_stack",
  1055. tags = ["team:rllib", "algorithms_dir"],
  1056. size = "large",
  1057. srcs = ["algorithms/ppo/tests/test_ppo_old_api_stack.py"]
  1058. )
  1059. # SAC
  1060. py_test(
  1061. name = "test_sac",
  1062. tags = ["team:rllib", "algorithms_dir"],
  1063. size = "large",
  1064. srcs = ["algorithms/sac/tests/test_sac.py"]
  1065. )
  1066. # --------------------------------------------------------------------
  1067. # Memory leak tests
  1068. #
  1069. # Tag: memory_leak_tests
  1070. # --------------------------------------------------------------------
  1071. # @OldAPIStack
  1072. py_test(
  1073. name = "test_memory_leak_appo_old_api_stack",
  1074. tags = ["team:rllib", "memory_leak_tests"],
  1075. main = "utils/tests/run_memory_leak_tests.py",
  1076. size = "large",
  1077. srcs = ["utils/tests/run_memory_leak_tests.py"],
  1078. data = ["tuned_examples/appo/memory-leak-test-appo.yaml"],
  1079. args = ["--dir=tuned_examples/appo"]
  1080. )
  1081. # @OldAPIStack
  1082. py_test(
  1083. name = "test_memory_leak_impala_old_api_stack",
  1084. tags = ["team:rllib", "memory_leak_tests"],
  1085. main = "utils/tests/run_memory_leak_tests.py",
  1086. size = "large",
  1087. srcs = ["utils/tests/run_memory_leak_tests.py"],
  1088. data = ["tuned_examples/impala/memory-leak-test-impala.yaml"],
  1089. args = ["--dir=tuned_examples/impala"]
  1090. )
  1091. # @OldAPIStack
  1092. py_test(
  1093. name = "test_memory_leak_ppo_old_api_stack",
  1094. tags = ["team:rllib", "memory_leak_tests"],
  1095. main = "utils/tests/run_memory_leak_tests.py",
  1096. size = "large",
  1097. srcs = ["utils/tests/run_memory_leak_tests.py"],
  1098. data = ["tuned_examples/ppo/memory-leak-test-ppo.yaml"],
  1099. args = ["--dir=tuned_examples/ppo"]
  1100. )
  1101. # --------------------------------------------------------------------
  1102. # Connector(V1) tests
  1103. # rllib/connector/
  1104. #
  1105. # Tag: connector
  1106. # --------------------------------------------------------------------
  1107. py_test(
  1108. name = "connectors/tests/test_connector",
  1109. tags = ["team:rllib", "connector"],
  1110. size = "small",
  1111. srcs = ["connectors/tests/test_connector.py"]
  1112. )
  1113. py_test(
  1114. name = "connectors/tests/test_action",
  1115. tags = ["team:rllib", "connector"],
  1116. size = "small",
  1117. srcs = ["connectors/tests/test_action.py"]
  1118. )
  1119. py_test(
  1120. name = "connectors/tests/test_agent",
  1121. tags = ["team:rllib", "connector"],
  1122. size = "medium",
  1123. srcs = ["connectors/tests/test_agent.py"]
  1124. )
  1125. # --------------------------------------------------------------------
  1126. # ConnectorV2 tests
  1127. # rllib/connector/
  1128. #
  1129. # Tag: connector_v2
  1130. # --------------------------------------------------------------------
  1131. # TODO (sven): Add these tests in a separate PR.
  1132. # py_test(
  1133. # name = "connectors/tests/test_connector_v2",
  1134. # tags = ["team:rllib", "connector_v2"],
  1135. # size = "small",
  1136. # srcs = ["connectors/tests/test_connector_v2.py"]
  1137. # )
  1138. # --------------------------------------------------------------------
  1139. # Env tests
  1140. # rllib/env/
  1141. #
  1142. # Tag: env
  1143. # --------------------------------------------------------------------
  1144. py_test(
  1145. name = "env/tests/test_infinite_lookback_buffer",
  1146. tags = ["team:rllib", "env"],
  1147. size = "small",
  1148. srcs = ["env/tests/test_infinite_lookback_buffer.py"]
  1149. )
  1150. # CI all of a sudden has problems with accessing the ports.
  1151. # sh_test(
  1152. # name = "env/tests/test_local_inference_cartpole",
  1153. # tags = ["team:rllib", "env"],
  1154. # size = "medium",
  1155. # srcs = ["env/tests/test_policy_client_server_setup.sh"],
  1156. # args = ["local", "cartpole", "8800"],
  1157. # data = glob(["examples/envs/external_envs/*.py"]),
  1158. # )
  1159. # sh_test(
  1160. # name = "env/tests/test_local_inference_cartpole_w_2_concurrent_episodes",
  1161. # tags = ["team:rllib", "env"],
  1162. # size = "medium",
  1163. # srcs = ["env/tests/test_policy_client_server_setup.sh"],
  1164. # args = ["local", "cartpole-dummy-2-episodes", "8830"],
  1165. # data = glob(["examples/envs/external_envs/*.py"]),
  1166. # )
  1167. # Tests with unity 3d and external envs currently don't work
  1168. # see: https://github.com/ray-project/ray/issues/34290 for more details
  1169. # sh_test(
  1170. # name = "env/tests/test_local_inference_unity3d",
  1171. # tags = ["team:rllib", "env"],
  1172. # size = "large", # bazel may complain about it being too long sometimes - large is on purpose as some frameworks take longer
  1173. # srcs = ["env/tests/test_policy_client_server_setup.sh"],
  1174. # args = ["local", "unity3d", "8850"],
  1175. # data = glob(["examples/envs/external_envs/*.py"]),
  1176. # )
  1177. py_test(
  1178. name = "env/tests/test_multi_agent_env",
  1179. tags = ["team:rllib", "tests_dir"],
  1180. size = "large",
  1181. srcs = ["env/tests/test_multi_agent_env.py"]
  1182. )
  1183. py_test(
  1184. name = "env/tests/test_multi_agent_env_runner",
  1185. tags = ["team:rllib", "env"],
  1186. size = "medium",
  1187. srcs = ["env/tests/test_multi_agent_env_runner.py"]
  1188. )
  1189. py_test(
  1190. name = "env/tests/test_multi_agent_episode",
  1191. tags = ["team:rllib", "env"],
  1192. size = "medium",
  1193. srcs = ["env/tests/test_multi_agent_episode.py"]
  1194. )
  1195. # CI all of a sudden has problems with accessing the ports.
  1196. # sh_test(
  1197. # name = "env/tests/test_remote_inference_cartpole",
  1198. # tags = ["team:rllib", "env", "exclusive"],
  1199. # size = "large", # bazel may complain about it being too long sometimes - large is on purpose as some frameworks take longer
  1200. # srcs = ["env/tests/test_policy_client_server_setup.sh"],
  1201. # args = ["remote", "cartpole", "8810"],
  1202. # data = glob(["examples/envs/external_envs/*.py"]),
  1203. # )
  1204. # sh_test(
  1205. # name = "env/tests/test_remote_inference_cartpole_lstm",
  1206. # tags = ["team:rllib", "env", "exclusive"],
  1207. # size = "large", # bazel may complain about it being too long sometimes - large is on purpose as some frameworks take longer
  1208. # srcs = ["env/tests/test_policy_client_server_setup.sh"],
  1209. # args = ["remote", "cartpole_lstm", "8820"],
  1210. # data = glob(["examples/envs/external_envs/*.py"]),
  1211. # )
  1212. # sh_test(
  1213. # name = "env/tests/test_remote_inference_cartpole_w_2_concurrent_episodes",
  1214. # tags = ["team:rllib", "env", "exclusive"],
  1215. # size = "large", # bazel may complain about it being too long sometimes - large is on purpose as some frameworks take longer
  1216. # srcs = ["env/tests/test_policy_client_server_setup.sh"],
  1217. # args = ["remote", "cartpole-dummy-2-episodes", "8840"],
  1218. # data = glob(["examples/envs/external_envs/*.py"]),
  1219. # )
  1220. # Tests with unity 3d and external envs currently don't work
  1221. # see: https://github.com/ray-project/ray/issues/34290 for more details
  1222. # sh_test(
  1223. # name = "env/tests/test_remote_inference_unity3d",
  1224. # tags = ["team:rllib", "env", "exclusive"],
  1225. # size = "small",
  1226. # srcs = ["env/tests/test_policy_client_server_setup.sh"],
  1227. # args = ["remote", "unity3d", "8860"],
  1228. # data = glob(["examples/envs/external_envs/*.py"]),
  1229. # )
  1230. py_test(
  1231. name = "env/tests/test_single_agent_env_runner",
  1232. tags = ["team:rllib", "env"],
  1233. size = "medium",
  1234. srcs = ["env/tests/test_single_agent_env_runner.py"]
  1235. )
  1236. py_test(
  1237. name = "env/tests/test_single_agent_episode",
  1238. tags = ["team:rllib", "env"],
  1239. size = "small",
  1240. srcs = ["env/tests/test_single_agent_episode.py"]
  1241. )
  1242. py_test(
  1243. name = "env/wrappers/tests/test_exception_wrapper",
  1244. tags = ["team:rllib", "env"],
  1245. size = "small",
  1246. srcs = ["env/wrappers/tests/test_exception_wrapper.py"]
  1247. )
  1248. py_test(
  1249. name = "env/wrappers/tests/test_group_agents_wrapper",
  1250. tags = ["team:rllib", "env"],
  1251. size = "small",
  1252. srcs = ["env/wrappers/tests/test_group_agents_wrapper.py"]
  1253. )
  1254. py_test(
  1255. name = "env/wrappers/tests/test_unity3d_env",
  1256. tags = ["team:rllib", "env"],
  1257. size = "small",
  1258. srcs = ["env/wrappers/tests/test_unity3d_env.py"]
  1259. )
  1260. # --------------------------------------------------------------------
  1261. # Evaluation components
  1262. # rllib/evaluation/
  1263. #
  1264. # Tag: evaluation
  1265. # --------------------------------------------------------------------
  1266. py_test(
  1267. name = "env/tests/test_env_runner_group",
  1268. tags = ["team:rllib", "evaluation", "exclusive"],
  1269. size = "small",
  1270. srcs = ["env/tests/test_env_runner_group.py"]
  1271. )
  1272. # @OldAPIStack
  1273. py_test(
  1274. name = "evaluation/tests/test_agent_collector",
  1275. tags = ["team:rllib", "evaluation"],
  1276. size = "small",
  1277. srcs = ["evaluation/tests/test_agent_collector.py"]
  1278. )
  1279. # @OldAPIStack
  1280. py_test(
  1281. name = "evaluation/tests/test_env_runner_v2",
  1282. tags = ["team:rllib", "evaluation"],
  1283. size = "small",
  1284. srcs = ["evaluation/tests/test_env_runner_v2.py"]
  1285. )
  1286. # @OldAPIStack
  1287. py_test(
  1288. name = "evaluation/tests/test_episode",
  1289. tags = ["team:rllib", "evaluation"],
  1290. size = "small",
  1291. srcs = ["evaluation/tests/test_episode.py"]
  1292. )
  1293. # @OldAPIStack
  1294. py_test(
  1295. name = "evaluation/tests/test_episode_v2",
  1296. tags = ["team:rllib", "evaluation"],
  1297. size = "small",
  1298. srcs = ["evaluation/tests/test_episode_v2.py"]
  1299. )
  1300. # @OldAPIStack
  1301. py_test(
  1302. name = "evaluation/tests/test_postprocessing",
  1303. tags = ["team:rllib", "evaluation"],
  1304. size = "small",
  1305. srcs = ["evaluation/tests/test_postprocessing.py"]
  1306. )
  1307. # @OldAPIStack
  1308. py_test(
  1309. name = "evaluation/tests/test_rollout_worker",
  1310. tags = ["team:rllib", "evaluation", "exclusive"],
  1311. size = "large",
  1312. srcs = ["evaluation/tests/test_rollout_worker.py"]
  1313. )
  1314. # --------------------------------------------------------------------
  1315. # RLlib core
  1316. # rllib/core/
  1317. #
  1318. # Tag: core
  1319. # --------------------------------------------------------------------
  1320. # Catalog
  1321. py_test(
  1322. name = "test_catalog",
  1323. tags = ["team:rllib", "core"],
  1324. size = "medium",
  1325. srcs = ["core/models/tests/test_catalog.py"]
  1326. )
  1327. # Default Models
  1328. py_test(
  1329. name = "test_base_models",
  1330. tags = ["team:rllib", "core"],
  1331. size = "small",
  1332. srcs = ["core/models/tests/test_base_models.py"]
  1333. )
  1334. py_test(
  1335. name = "test_cnn_encoders",
  1336. tags = ["team:rllib", "core", "models"],
  1337. size = "large",
  1338. srcs = ["core/models/tests/test_cnn_encoders.py"]
  1339. )
  1340. py_test(
  1341. name = "test_cnn_transpose_heads",
  1342. tags = ["team:rllib", "core", "models"],
  1343. size = "medium",
  1344. srcs = ["core/models/tests/test_cnn_transpose_heads.py"]
  1345. )
  1346. py_test(
  1347. name = "test_mlp_encoders",
  1348. tags = ["team:rllib", "core", "models"],
  1349. size = "medium",
  1350. srcs = ["core/models/tests/test_mlp_encoders.py"]
  1351. )
  1352. py_test(
  1353. name = "test_mlp_heads",
  1354. tags = ["team:rllib", "core", "models"],
  1355. size = "medium",
  1356. srcs = ["core/models/tests/test_mlp_heads.py"]
  1357. )
  1358. py_test(
  1359. name = "test_recurrent_encoders",
  1360. tags = ["team:rllib", "core", "models"],
  1361. size = "medium",
  1362. srcs = ["core/models/tests/test_recurrent_encoders.py"]
  1363. )
  1364. # RLModule
  1365. py_test(
  1366. name = "test_torch_rl_module",
  1367. tags = ["team:rllib", "core"],
  1368. size = "medium",
  1369. srcs = ["core/rl_module/torch/tests/test_torch_rl_module.py"],
  1370. args = ["TestRLModule"],
  1371. )
  1372. # TODO(Artur): Comment this back in as soon as we can test with GPU
  1373. # py_test(
  1374. # name = "test_torch_rl_module_gpu",
  1375. # main = "core/rl_module/torch/tests/test_torch_rl_module.py",
  1376. # tags = ["team:rllib", "core", "gpu", "exclusive"],
  1377. # size = "medium",
  1378. # srcs = ["core/rl_module/torch/tests/test_torch_rl_module.py"],
  1379. # args = ["TestRLModuleGPU"],
  1380. # )
  1381. py_test(
  1382. name = "test_tf_rl_module",
  1383. tags = ["team:rllib", "core"],
  1384. size = "medium",
  1385. srcs = ["core/rl_module/tf/tests/test_tf_rl_module.py"]
  1386. )
  1387. py_test(
  1388. name = "test_multi_rl_module",
  1389. tags = ["team:rllib", "core"],
  1390. size = "medium",
  1391. srcs = ["core/rl_module/tests/test_multi_rl_module.py"]
  1392. )
  1393. py_test(
  1394. name = "test_rl_module_specs",
  1395. tags = ["team:rllib", "core"],
  1396. size = "medium",
  1397. srcs = ["core/rl_module/tests/test_rl_module_specs.py"]
  1398. )
  1399. # Learner
  1400. py_test(
  1401. name = "TestLearnerGroupSyncUpdate",
  1402. main = "core/learner/tests/test_learner_group.py",
  1403. tags = ["team:rllib", "multi_gpu", "exclusive"],
  1404. size = "large",
  1405. srcs = ["core/learner/tests/test_learner_group.py"],
  1406. args = ["TestLearnerGroupSyncUpdate"]
  1407. )
  1408. py_test(
  1409. name = "TestLearnerGroupCheckpointRestore",
  1410. main = "core/learner/tests/test_learner_group.py",
  1411. tags = ["team:rllib", "multi_gpu", "exclusive"],
  1412. size = "large",
  1413. srcs = ["core/learner/tests/test_learner_group.py"],
  1414. args = ["TestLearnerGroupCheckpointRestore"]
  1415. )
  1416. py_test(
  1417. name = "TestLearnerGroupAsyncUpdate",
  1418. main = "core/learner/tests/test_learner_group.py",
  1419. tags = ["team:rllib", "multi_gpu", "exclusive"],
  1420. size = "large",
  1421. srcs = ["core/learner/tests/test_learner_group.py"],
  1422. args = ["TestLearnerGroupAsyncUpdate"]
  1423. )
  1424. py_test(
  1425. name = "TestLearnerGroupSaveLoadState",
  1426. main = "core/learner/tests/test_learner_group.py",
  1427. tags = ["team:rllib", "multi_gpu", "exclusive"],
  1428. size = "large",
  1429. srcs = ["core/learner/tests/test_learner_group.py"],
  1430. args = ["TestLearnerGroupSaveLoadState"]
  1431. )
  1432. py_test(
  1433. name = "test_learner",
  1434. tags = ["team:rllib", "core", "ray_data"],
  1435. size = "medium",
  1436. srcs = ["core/learner/tests/test_learner.py"]
  1437. )
  1438. py_test(
  1439. name = "test_torch_learner_compile",
  1440. tags = ["team:rllib", "core", "ray_data"],
  1441. size = "medium",
  1442. srcs = ["core/learner/torch/tests/test_torch_learner_compile.py"]
  1443. )
  1444. # --------------------------------------------------------------------
  1445. # Models and Distributions
  1446. # rllib/models/
  1447. #
  1448. # Tag: models
  1449. # --------------------------------------------------------------------
  1450. py_test(
  1451. name = "test_attention_nets",
  1452. tags = ["team:rllib", "models"],
  1453. size = "large",
  1454. srcs = ["models/tests/test_attention_nets.py"]
  1455. )
  1456. py_test(
  1457. name = "test_conv2d_default_stacks",
  1458. tags = ["team:rllib", "models"],
  1459. size = "small",
  1460. srcs = ["models/tests/test_conv2d_default_stacks.py"]
  1461. )
  1462. py_test(
  1463. name = "test_convtranspose2d_stack",
  1464. tags = ["team:rllib", "models"],
  1465. size = "medium",
  1466. data = glob(["tests/data/images/obstacle_tower.png"]),
  1467. srcs = ["models/tests/test_convtranspose2d_stack.py"]
  1468. )
  1469. py_test(
  1470. name = "test_action_distributions",
  1471. tags = ["team:rllib", "models"],
  1472. size = "medium",
  1473. srcs = ["models/tests/test_action_distributions.py"]
  1474. )
  1475. py_test(
  1476. name = "test_distributions",
  1477. tags = ["team:rllib", "models"],
  1478. size = "small",
  1479. srcs = ["models/tests/test_distributions.py"]
  1480. )
  1481. py_test(
  1482. name = "test_lstms",
  1483. tags = ["team:rllib", "models"],
  1484. size = "large",
  1485. srcs = ["models/tests/test_lstms.py"]
  1486. )
  1487. py_test(
  1488. name = "test_models",
  1489. tags = ["team:rllib", "models"],
  1490. size = "medium",
  1491. srcs = ["models/tests/test_models.py"]
  1492. )
  1493. py_test(
  1494. name = "test_preprocessors",
  1495. tags = ["team:rllib", "models"],
  1496. size = "medium",
  1497. srcs = ["models/tests/test_preprocessors.py"]
  1498. )
  1499. # --------------------------------------------------------------------
  1500. # Offline
  1501. # rllib/offline/
  1502. #
  1503. # Tag: offline
  1504. # --------------------------------------------------------------------
  1505. py_test(
  1506. name = "test_dataset_reader",
  1507. tags = ["team:rllib", "offline"],
  1508. size = "small",
  1509. srcs = ["offline/tests/test_dataset_reader.py"],
  1510. data = [
  1511. "tests/data/pendulum/large.json",
  1512. "tests/data/pendulum/enormous.zip",
  1513. ],
  1514. )
  1515. py_test(
  1516. name = "test_feature_importance",
  1517. tags = ["team:rllib", "offline", "torch_only"],
  1518. size = "medium",
  1519. srcs = ["offline/tests/test_feature_importance.py"]
  1520. )
  1521. py_test(
  1522. name = "test_json_reader",
  1523. tags = ["team:rllib", "offline"],
  1524. size = "small",
  1525. srcs = ["offline/tests/test_json_reader.py"],
  1526. data = ["tests/data/pendulum/large.json"],
  1527. )
  1528. py_test(
  1529. name = "test_ope",
  1530. tags = ["team:rllib", "offline", "ray_data"],
  1531. size = "medium",
  1532. srcs = ["offline/estimators/tests/test_ope.py"],
  1533. data = ["tests/data/cartpole/small.json"],
  1534. )
  1535. py_test(
  1536. name = "test_ope_math",
  1537. tags = ["team:rllib", "offline"],
  1538. size = "small",
  1539. srcs = ["offline/estimators/tests/test_ope_math.py"]
  1540. )
  1541. py_test(
  1542. name = "test_dm_learning",
  1543. tags = ["team:rllib", "offline"],
  1544. size = "large",
  1545. srcs = ["offline/estimators/tests/test_dm_learning.py"],
  1546. )
  1547. py_test(
  1548. name = "test_dr_learning",
  1549. tags = ["team:rllib", "offline"],
  1550. size = "large",
  1551. srcs = ["offline/estimators/tests/test_dr_learning.py"],
  1552. )
  1553. py_test(
  1554. name = "test_offline_env_runner",
  1555. tags = ["team:rllib", "offline"],
  1556. size = "small",
  1557. srcs = ["offline/tests/test_offline_env_runner.py"],
  1558. )
  1559. py_test(
  1560. name = "test_offline_data",
  1561. tags = ["team:rllib", "offline"],
  1562. size = "medium",
  1563. srcs = ["offline/tests/test_offline_data.py"],
  1564. # Include the offline data files.
  1565. data = [
  1566. "tests/data/cartpole/cartpole-v1_large",
  1567. "tests/data/cartpole/large.json",
  1568. ]
  1569. )
  1570. py_test(
  1571. name = "test_offline_prelearner",
  1572. tags = ["team:rllib", "offline"],
  1573. size = "medium",
  1574. srcs = ["offline/tests/test_offline_prelearner.py"],
  1575. # Include the offline data files.
  1576. data = [
  1577. "tests/data/cartpole/cartpole-v1_large",
  1578. "tests/data/cartpole/large.json",
  1579. ]
  1580. )
  1581. # --------------------------------------------------------------------
  1582. # Policies
  1583. # rllib/policy/
  1584. #
  1585. # Tag: policy
  1586. # --------------------------------------------------------------------
  1587. py_test(
  1588. name = "policy/tests/test_compute_log_likelihoods",
  1589. tags = ["team:rllib", "policy"],
  1590. size = "medium",
  1591. srcs = ["policy/tests/test_compute_log_likelihoods.py"]
  1592. )
  1593. py_test(
  1594. name = "policy/tests/test_export_checkpoint_and_model",
  1595. tags = ["team:rllib", "policy"],
  1596. size = "large",
  1597. srcs = ["policy/tests/test_export_checkpoint_and_model.py"]
  1598. )
  1599. py_test(
  1600. name = "policy/tests/test_multi_agent_batch",
  1601. tags = ["team:rllib", "policy"],
  1602. size = "small",
  1603. srcs = ["policy/tests/test_multi_agent_batch.py"]
  1604. )
  1605. py_test(
  1606. name = "policy/tests/test_policy",
  1607. tags = ["team:rllib", "policy"],
  1608. size = "medium",
  1609. srcs = ["policy/tests/test_policy.py"]
  1610. )
  1611. py_test(
  1612. name = "policy/tests/test_policy_map",
  1613. tags = ["team:rllib", "policy"],
  1614. size = "medium",
  1615. srcs = ["policy/tests/test_policy_map.py"]
  1616. )
  1617. py_test(
  1618. name = "policy/tests/test_policy_state_swapping",
  1619. tags = ["team:rllib", "policy", "gpu"],
  1620. size = "medium",
  1621. srcs = ["policy/tests/test_policy_state_swapping.py"]
  1622. )
  1623. py_test(
  1624. name = "policy/tests/test_rnn_sequencing",
  1625. tags = ["team:rllib", "policy"],
  1626. size = "small",
  1627. srcs = ["policy/tests/test_rnn_sequencing.py"]
  1628. )
  1629. py_test(
  1630. name = "policy/tests/test_sample_batch",
  1631. tags = ["team:rllib", "policy", "multi_gpu"],
  1632. size = "small",
  1633. srcs = ["policy/tests/test_sample_batch.py"]
  1634. )
  1635. py_test(
  1636. name = "policy/tests/test_view_requirement",
  1637. tags = ["team:rllib", "policy"],
  1638. size = "small",
  1639. srcs = ["policy/tests/test_view_requirement.py"]
  1640. )
  1641. # --------------------------------------------------------------------
  1642. # Utils:
  1643. # rllib/utils/
  1644. #
  1645. # Tag: utils
  1646. # --------------------------------------------------------------------
  1647. py_test(
  1648. name = "test_errors",
  1649. tags = ["team:rllib", "utils"],
  1650. size = "medium",
  1651. srcs = ["utils/tests/test_errors.py"]
  1652. )
  1653. py_test(
  1654. name = "test_minibatch_utils",
  1655. tags = ["team:rllib", "utils"],
  1656. size = "small",
  1657. srcs = ["utils/tests/test_minibatch_utils.py"]
  1658. )
  1659. py_test(
  1660. name = "test_serialization",
  1661. tags = ["team:rllib", "utils"],
  1662. size = "small",
  1663. srcs = ["utils/tests/test_serialization.py"]
  1664. )
  1665. py_test(
  1666. name = "test_curiosity",
  1667. tags = ["team:rllib", "utils"],
  1668. size = "large",
  1669. srcs = ["utils/exploration/tests/test_curiosity.py"]
  1670. )
  1671. py_test(
  1672. name = "test_explorations",
  1673. tags = ["team:rllib", "utils"],
  1674. size = "large",
  1675. srcs = ["utils/exploration/tests/test_explorations.py"]
  1676. )
  1677. py_test(
  1678. name = "test_value_predictions",
  1679. tags = ["team:rllib", "utils"],
  1680. size = "small",
  1681. srcs = ["utils/postprocessing/tests/test_value_predictions.py"]
  1682. )
  1683. py_test(
  1684. name = "test_torch_utils",
  1685. tags = ["team:rllib", "utils", "gpu"],
  1686. size = "medium",
  1687. srcs = ["utils/tests/test_torch_utils.py"]
  1688. )
  1689. # Schedules
  1690. py_test(
  1691. name = "test_schedules",
  1692. tags = ["team:rllib", "utils"],
  1693. size = "small",
  1694. srcs = ["utils/schedules/tests/test_schedules.py"]
  1695. )
  1696. py_test(
  1697. name = "test_framework_agnostic_components",
  1698. tags = ["team:rllib", "utils"],
  1699. size = "small",
  1700. data = glob(["utils/tests/**"]),
  1701. srcs = ["utils/tests/test_framework_agnostic_components.py"]
  1702. )
  1703. # Spaces/Space utils.
  1704. py_test(
  1705. name = "test_space_utils",
  1706. tags = ["team:rllib", "utils"],
  1707. size = "small",
  1708. srcs = ["utils/spaces/tests/test_space_utils.py"]
  1709. )
  1710. # TaskPool
  1711. py_test(
  1712. name = "test_taskpool",
  1713. tags = ["team:rllib", "utils"],
  1714. size = "small",
  1715. srcs = ["utils/tests/test_taskpool.py"]
  1716. )
  1717. # ReplayBuffers
  1718. py_test(
  1719. name = "test_episode_replay_buffer",
  1720. tags = ["team:rllib", "utils"],
  1721. size = "small",
  1722. srcs = ["utils/replay_buffers/tests/test_episode_replay_buffer.py"]
  1723. )
  1724. py_test(
  1725. name = "test_multi_agent_episode_buffer",
  1726. tags = ["team:rllib", "utils"],
  1727. size = "small",
  1728. srcs = ["utils/replay_buffers/tests/test_multi_agent_episode_buffer.py"]
  1729. )
  1730. py_test(
  1731. name = "test_multi_agent_mixin_replay_buffer",
  1732. tags = ["team:rllib", "utils"],
  1733. size = "small",
  1734. srcs = ["utils/replay_buffers/tests/test_multi_agent_mixin_replay_buffer.py"]
  1735. )
  1736. py_test(
  1737. name = "test_multi_agent_prio_episode_buffer",
  1738. tags = ["team:rllib", "utils"],
  1739. size = "small",
  1740. srcs = ["utils/replay_buffers/tests/test_multi_agent_prio_episode_buffer.py"]
  1741. )
  1742. py_test(
  1743. name = "test_multi_agent_prioritized_replay_buffer",
  1744. tags = ["team:rllib", "utils"],
  1745. size = "small",
  1746. srcs = ["utils/replay_buffers/tests/test_multi_agent_prioritized_replay_buffer.py"]
  1747. )
  1748. py_test(
  1749. name = "test_multi_agent_replay_buffer",
  1750. tags = ["team:rllib", "utils"],
  1751. size = "small",
  1752. srcs = ["utils/replay_buffers/tests/test_multi_agent_replay_buffer.py"]
  1753. )
  1754. py_test(
  1755. name = "test_prioritized_episode_buffer",
  1756. tags = ["team::rllib", "utils"],
  1757. size = "small",
  1758. srcs = ["utils/replay_buffers/tests/test_prioritized_episode_buffer.py"]
  1759. )
  1760. py_test(
  1761. name = "test_prioritized_replay_buffer_replay_buffer_api",
  1762. tags = ["team:rllib", "utils"],
  1763. size = "small",
  1764. srcs = ["utils/replay_buffers/tests/test_prioritized_replay_buffer_replay_buffer_api.py"]
  1765. )
  1766. py_test(
  1767. name = "test_replay_buffer",
  1768. tags = ["team:rllib", "utils"],
  1769. size = "small",
  1770. srcs = ["utils/replay_buffers/tests/test_replay_buffer.py"]
  1771. )
  1772. py_test(
  1773. name = "test_fifo_replay_buffer",
  1774. tags = ["team:rllib", "utils"],
  1775. size = "small",
  1776. srcs = ["utils/replay_buffers/tests/test_fifo_replay_buffer.py"]
  1777. )
  1778. py_test(
  1779. name = "test_reservoir_buffer",
  1780. tags = ["team:rllib", "utils"],
  1781. size = "small",
  1782. srcs = ["utils/replay_buffers/tests/test_reservoir_buffer.py"]
  1783. )
  1784. py_test(
  1785. name = "test_segment_tree_replay_buffer_api",
  1786. tags = ["team:rllib", "utils"],
  1787. size = "small",
  1788. srcs = ["utils/replay_buffers/tests/test_segment_tree_replay_buffer_api.py"]
  1789. )
  1790. py_test(
  1791. name = "test_check_multi_agent",
  1792. tags = ["team:rllib", "utils"],
  1793. size = "small",
  1794. srcs = ["utils/tests/test_check_multi_agent.py"]
  1795. )
  1796. py_test(
  1797. name = "test_actor_manager",
  1798. tags = ["team:rllib", "utils", "exclusive"],
  1799. size = "medium",
  1800. srcs = ["utils/tests/test_actor_manager.py"],
  1801. data = ["utils/tests/random_numbers.pkl"],
  1802. )
  1803. # --------------------------------------------------------------------
  1804. # rllib/tests/ directory
  1805. #
  1806. # Tag: tests_dir
  1807. #
  1808. # NOTE: Add tests alphabetically into this list.
  1809. # --------------------------------------------------------------------
  1810. py_test(
  1811. name = "tests/test_catalog",
  1812. tags = ["team:rllib", "tests_dir"],
  1813. size = "medium",
  1814. srcs = ["tests/test_catalog.py"]
  1815. )
  1816. py_test(
  1817. name = "policy/tests/test_policy_checkpoint_restore",
  1818. main = "policy/tests/test_policy_checkpoint_restore.py",
  1819. tags = ["team:rllib", "tests_dir"],
  1820. size = "large",
  1821. data = glob([
  1822. "tests/data/checkpoints/APPO_CartPole-v1-connector-enabled/**",
  1823. ]),
  1824. srcs = ["policy/tests/test_policy_checkpoint_restore.py"],
  1825. )
  1826. py_test(
  1827. name = "tests/test_custom_resource",
  1828. tags = ["team:rllib", "tests_dir"],
  1829. size = "large", # bazel may complain about it being too long sometimes - large is on purpose as some frameworks take longer
  1830. srcs = ["tests/test_custom_resource.py"]
  1831. )
  1832. py_test(
  1833. name = "tests/test_dependency_tf",
  1834. tags = ["team:rllib", "tests_dir"],
  1835. size = "small",
  1836. srcs = ["tests/test_dependency_tf.py"]
  1837. )
  1838. py_test(
  1839. name = "tests/test_dependency_torch",
  1840. tags = ["team:rllib", "tests_dir"],
  1841. size = "small",
  1842. srcs = ["tests/test_dependency_torch.py"]
  1843. )
  1844. py_test(
  1845. name = "tests/test_eager_support_policy_gradient",
  1846. main = "tests/test_eager_support.py",
  1847. tags = ["team:rllib", "tests_dir"],
  1848. size = "small",
  1849. srcs = ["tests/test_eager_support.py"],
  1850. args = ["TestEagerSupportPolicyGradient"]
  1851. )
  1852. py_test(
  1853. name = "tests/test_eager_support_off_policy",
  1854. main = "tests/test_eager_support.py",
  1855. tags = ["team:rllib", "tests_dir"],
  1856. size = "small",
  1857. srcs = ["tests/test_eager_support.py"],
  1858. args = ["TestEagerSupportOffPolicy"]
  1859. )
  1860. py_test(
  1861. name = "tests/test_filters",
  1862. tags = ["team:rllib", "tests_dir"],
  1863. size = "small",
  1864. srcs = ["tests/test_filters.py"]
  1865. )
  1866. py_test(
  1867. name = "tests/test_gpus",
  1868. tags = ["team:rllib", "tests_dir"],
  1869. size = "large",
  1870. srcs = ["tests/test_gpus.py"]
  1871. )
  1872. py_test(
  1873. name = "tests/test_io",
  1874. tags = ["team:rllib", "tests_dir"],
  1875. size = "large",
  1876. srcs = ["tests/test_io.py"]
  1877. )
  1878. py_test(
  1879. name = "tests/test_local",
  1880. tags = ["team:rllib", "tests_dir"],
  1881. size = "small",
  1882. srcs = ["tests/test_local.py"]
  1883. )
  1884. py_test(
  1885. name = "tests/test_lstm",
  1886. tags = ["team:rllib", "tests_dir"],
  1887. size = "medium",
  1888. srcs = ["tests/test_lstm.py"]
  1889. )
  1890. py_test(
  1891. name = "tests/test_nn_framework_import_errors",
  1892. tags = ["team:rllib", "tests_dir"],
  1893. size = "small",
  1894. srcs = ["tests/test_nn_framework_import_errors.py"]
  1895. )
  1896. py_test(
  1897. name = "tests/test_pettingzoo_env",
  1898. tags = ["team:rllib", "tests_dir"],
  1899. size = "medium",
  1900. srcs = ["tests/test_pettingzoo_env.py"]
  1901. )
  1902. py_test(
  1903. name = "tests/test_placement_groups",
  1904. tags = ["team:rllib", "tests_dir"],
  1905. size = "large", # bazel may complain about it being too long sometimes - large is on purpose as some frameworks take longer
  1906. srcs = ["tests/test_placement_groups.py"]
  1907. )
  1908. py_test(
  1909. name = "tests/test_ray_client",
  1910. tags = ["team:rllib", "tests_dir"],
  1911. size = "large",
  1912. srcs = ["tests/test_ray_client.py"]
  1913. )
  1914. py_test(
  1915. name = "tests/test_reproducibility",
  1916. tags = ["team:rllib", "tests_dir"],
  1917. size = "medium",
  1918. srcs = ["tests/test_reproducibility.py"]
  1919. )
  1920. py_test(
  1921. name = "tests/test_timesteps",
  1922. tags = ["team:rllib", "tests_dir"],
  1923. size = "small",
  1924. srcs = ["tests/test_timesteps.py"]
  1925. )
  1926. # --------------------------------------------------------------------
  1927. # examples/ directory
  1928. #
  1929. # Tag: examples
  1930. #
  1931. # NOTE: Add tests alphabetically into this list.
  1932. # --------------------------------------------------------------------
  1933. # subdirectory: _docs/
  1934. py_test(
  1935. name = "examples/_docs/rllib_on_rllib_readme",
  1936. main = "examples/_docs/rllib_on_rllib_readme.py",
  1937. tags = ["team:rllib", "documentation", "no_main"],
  1938. size = "medium",
  1939. srcs = ["examples/_docs/rllib_on_rllib_readme.py"],
  1940. )
  1941. # ----------------------
  1942. # Old API stack examples
  1943. # ----------------------
  1944. # subdirectory: _old_api_stack/
  1945. py_test(
  1946. name = "examples/_old_api_stack/complex_struct_space_tf",
  1947. main = "examples/_old_api_stack/complex_struct_space.py",
  1948. tags = ["team:rllib", "exclusive", "examples", "old_api_stack"],
  1949. size = "small",
  1950. srcs = ["examples/_old_api_stack/complex_struct_space.py"],
  1951. args = ["--framework=tf"],
  1952. )
  1953. py_test(
  1954. name = "examples/_old_api_stack/complex_struct_space_tf_eager",
  1955. main = "examples/_old_api_stack/complex_struct_space.py",
  1956. tags = ["team:rllib", "exclusive", "examples", "old_api_stack"],
  1957. size = "small",
  1958. srcs = ["examples/_old_api_stack/complex_struct_space.py"],
  1959. args = ["--framework=tf2"],
  1960. )
  1961. py_test(
  1962. name = "examples/_old_api_stack/complex_struct_space_torch",
  1963. main = "examples/_old_api_stack/complex_struct_space.py",
  1964. tags = ["team:rllib", "exclusive", "examples", "old_api_stack"],
  1965. size = "small",
  1966. srcs = ["examples/_old_api_stack/complex_struct_space.py"],
  1967. args = ["--framework=torch"],
  1968. )
  1969. # subdirectory: _old_api_stack/connectors/
  1970. py_test(
  1971. name = "examples/_old_api_stack/connectors/run_connector_policy",
  1972. main = "examples/_old_api_stack/connectors/run_connector_policy.py",
  1973. tags = ["team:rllib", "exclusive", "examples", "old_api_stack"],
  1974. size = "small",
  1975. srcs = ["examples/_old_api_stack/connectors/run_connector_policy.py"],
  1976. )
  1977. py_test(
  1978. name = "examples/_old_api_stack/connectors/run_connector_policy_w_lstm",
  1979. main = "examples/_old_api_stack/connectors/run_connector_policy.py",
  1980. tags = ["team:rllib", "exclusive", "examples", "old_api_stack"],
  1981. size = "small",
  1982. srcs = ["examples/_old_api_stack/connectors/run_connector_policy.py"],
  1983. args = ["--use-lstm"],
  1984. )
  1985. py_test(
  1986. name = "examples/_old_api_stack/connectors/adapt_connector_policy",
  1987. main = "examples/_old_api_stack/connectors/adapt_connector_policy.py",
  1988. tags = ["team:rllib", "exclusive", "examples", "old_api_stack"],
  1989. size = "small",
  1990. srcs = ["examples/_old_api_stack/connectors/adapt_connector_policy.py"],
  1991. )
  1992. # py_test(
  1993. # name = "examples/_old_api_stack/connectors/self_play_with_policy_checkpoint",
  1994. # main = "examples/_old_api_stack/connectors/self_play_with_policy_checkpoint.py",
  1995. # tags = ["team:rllib", "exclusive", "examples", "old_api_stack"],
  1996. # size = "small",
  1997. # srcs = ["examples/_old_api_stack/connectors/self_play_with_policy_checkpoint.py"],
  1998. # args = [
  1999. # "--train_iteration=1" # Smoke test.
  2000. # ]
  2001. # )
  2002. # ----------------------
  2003. # New API stack
  2004. # Note: This includes to-be-translated-to-new-API-stack examples
  2005. # tagged by @OldAPIStack and/or @HybridAPIStack
  2006. # ----------------------
  2007. # subdirectory: actions/
  2008. # Nested action spaces (flattening obs and learning w/ multi-action distribution).
  2009. py_test(
  2010. name = "examples/actions/nested_action_spaces_ppo",
  2011. main = "examples/actions/nested_action_spaces.py",
  2012. tags = ["team:rllib", "exclusive", "examples"],
  2013. size = "large",
  2014. srcs = ["examples/actions/nested_action_spaces.py"],
  2015. args = ["--enable-new-api-stack", "--as-test", "--framework=torch", "--stop-reward=-500.0", "--algo=PPO"]
  2016. )
  2017. py_test(
  2018. name = "examples/actions/nested_action_spaces_multi_agent_ppo",
  2019. main = "examples/actions/nested_action_spaces.py",
  2020. tags = ["team:rllib", "exclusive", "examples"],
  2021. size = "large",
  2022. srcs = ["examples/actions/nested_action_spaces.py"],
  2023. args = ["--enable-new-api-stack", "--as-test", "--num-agents=2", "--framework=torch", "--stop-reward=-1000.0", "--algo=PPO"]
  2024. )
  2025. # subdirectory: catalogs/
  2026. # ....................................
  2027. py_test(
  2028. name = "examples/catalogs/custom_action_distribution",
  2029. main = "examples/catalogs/custom_action_distribution.py",
  2030. tags = ["team:rllib", "examples", "no_main"],
  2031. size = "small",
  2032. srcs = ["examples/catalogs/custom_action_distribution.py"],
  2033. )
  2034. py_test(
  2035. name = "examples/catalogs/mobilenet_v2_encoder",
  2036. main = "examples/catalogs/mobilenet_v2_encoder.py",
  2037. tags = ["team:rllib", "examples", "no_main"],
  2038. size = "small",
  2039. srcs = ["examples/catalogs/mobilenet_v2_encoder.py"],
  2040. )
  2041. # subdirectory: checkpoints/
  2042. # ....................................
  2043. py_test(
  2044. name = "examples/checkpoints/checkpoint_by_custom_criteria",
  2045. main = "examples/checkpoints/checkpoint_by_custom_criteria.py",
  2046. tags = ["team:rllib", "exclusive", "examples", "examples_use_all_core"],
  2047. size = "large",
  2048. srcs = ["examples/checkpoints/checkpoint_by_custom_criteria.py"],
  2049. args = ["--enable-new-api-stack", "--stop-reward=150.0", "--num-cpus=8"]
  2050. )
  2051. py_test(
  2052. name = "examples/checkpoints/continue_training_from_checkpoint",
  2053. main = "examples/checkpoints/continue_training_from_checkpoint.py",
  2054. tags = ["team:rllib", "exclusive", "examples"],
  2055. size = "large",
  2056. srcs = ["examples/checkpoints/continue_training_from_checkpoint.py"],
  2057. args = ["--enable-new-api-stack", "--as-test"]
  2058. )
  2059. py_test(
  2060. name = "examples/checkpoints/continue_training_from_checkpoint_multi_agent",
  2061. main = "examples/checkpoints/continue_training_from_checkpoint.py",
  2062. tags = ["team:rllib", "exclusive", "examples"],
  2063. size = "large",
  2064. srcs = ["examples/checkpoints/continue_training_from_checkpoint.py"],
  2065. args = ["--enable-new-api-stack", "--as-test", "--num-agents=2", "--stop-reward-crash=400.0", "--stop-reward=900.0"]
  2066. )
  2067. #@OldAPIStack
  2068. py_test(
  2069. name = "examples/checkpoints/continue_training_from_checkpoint_old_api_stack",
  2070. main = "examples/checkpoints/continue_training_from_checkpoint.py",
  2071. tags = ["team:rllib", "exclusive", "examples"],
  2072. size = "large",
  2073. srcs = ["examples/checkpoints/continue_training_from_checkpoint.py"],
  2074. args = ["--as-test"]
  2075. )
  2076. py_test(
  2077. name = "examples/checkpoints/cartpole_dqn_export",
  2078. main = "examples/checkpoints/cartpole_dqn_export.py",
  2079. tags = ["team:rllib", "exclusive", "examples"],
  2080. size = "small",
  2081. srcs = ["examples/checkpoints/cartpole_dqn_export.py"],
  2082. )
  2083. #@OldAPIStack
  2084. py_test(
  2085. name = "examples/checkpoints/onnx_tf2",
  2086. main = "examples/checkpoints/onnx_tf.py",
  2087. tags = ["team:rllib", "exclusive", "examples", "no_main"],
  2088. size = "small",
  2089. srcs = ["examples/checkpoints/onnx_tf.py"],
  2090. args = ["--framework=tf2"],
  2091. )
  2092. #@OldAPIStack
  2093. py_test(
  2094. name = "examples/checkpoints/onnx_torch",
  2095. main = "examples/checkpoints/onnx_torch.py",
  2096. tags = ["team:rllib", "exclusive", "examples", "no_main"],
  2097. size = "small",
  2098. srcs = ["examples/checkpoints/onnx_torch.py"],
  2099. )
  2100. #@OldAPIStack
  2101. py_test(
  2102. name = "examples/checkpoints/onnx_torch_lstm",
  2103. main = "examples/checkpoints/onnx_torch_lstm.py",
  2104. tags = ["team:rllib", "exclusive", "examples", "no_main"],
  2105. size = "small",
  2106. srcs = ["examples/checkpoints/onnx_torch_lstm.py"],
  2107. )
  2108. # subdirectory: connectors/
  2109. # ....................................
  2110. # Framestacking examples only run in smoke-test mode (a few iters only).
  2111. # PPO
  2112. py_test(
  2113. name = "examples/connectors/frame_stacking_ppo",
  2114. main = "examples/connectors/frame_stacking.py",
  2115. tags = ["team:rllib", "exclusive", "examples"],
  2116. size = "medium",
  2117. srcs = ["examples/connectors/frame_stacking.py"],
  2118. args = ["--enable-new-api-stack", "--stop-iter=2", "--framework=torch", "--algo=PPO"]
  2119. )
  2120. py_test(
  2121. name = "examples/connectors/frame_stacking_multi_agent_ppo",
  2122. main = "examples/connectors/frame_stacking.py",
  2123. tags = ["team:rllib", "exclusive", "examples"],
  2124. size = "medium",
  2125. srcs = ["examples/connectors/frame_stacking.py"],
  2126. args = ["--enable-new-api-stack", "--num-agents=2", "--stop-iter=2", "--framework=torch", "--algo=PPO", "--num-env-runners=4", "--num-cpus=6"]
  2127. )
  2128. # IMPALA
  2129. py_test(
  2130. name = "examples/connectors/frame_stacking_impala",
  2131. main = "examples/connectors/frame_stacking.py",
  2132. tags = ["team:rllib", "exclusive", "examples"],
  2133. size = "medium",
  2134. srcs = ["examples/connectors/frame_stacking.py"],
  2135. args = ["--enable-new-api-stack", "--stop-iter=2", "--framework=torch", "--algo=IMPALA"]
  2136. )
  2137. py_test(
  2138. name = "examples/connectors/frame_stacking_multi_agent_impala",
  2139. main = "examples/connectors/frame_stacking.py",
  2140. tags = ["team:rllib", "exclusive", "examples"],
  2141. size = "medium",
  2142. srcs = ["examples/connectors/frame_stacking.py"],
  2143. args = ["--enable-new-api-stack", "--num-agents=2", "--stop-iter=2", "--framework=torch", "--algo=IMPALA", "--num-env-runners=4", "--num-cpus=6"]
  2144. )
  2145. # Nested observation spaces (flattening).
  2146. # PPO
  2147. py_test(
  2148. name = "examples/connectors/flatten_observations_dict_space_ppo",
  2149. main = "examples/connectors/flatten_observations_dict_space.py",
  2150. tags = ["team:rllib", "exclusive", "examples"],
  2151. size = "medium",
  2152. srcs = ["examples/connectors/flatten_observations_dict_space.py"],
  2153. args = ["--enable-new-api-stack", "--as-test", "--stop-reward=400.0", "--framework=torch", "--algo=PPO"]
  2154. )
  2155. py_test(
  2156. name = "examples/connectors/flatten_observations_dict_space_multi_agent_ppo",
  2157. main = "examples/connectors/flatten_observations_dict_space.py",
  2158. tags = ["team:rllib", "exclusive", "examples"],
  2159. size = "medium",
  2160. srcs = ["examples/connectors/flatten_observations_dict_space.py"],
  2161. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--stop-reward=800.0", "--framework=torch", "--algo=PPO"]
  2162. )
  2163. # IMPALA
  2164. py_test(
  2165. name = "examples/connectors/flatten_observations_dict_space_impala",
  2166. main = "examples/connectors/flatten_observations_dict_space.py",
  2167. tags = ["team:rllib", "exclusive", "examples"],
  2168. size = "large",
  2169. srcs = ["examples/connectors/flatten_observations_dict_space.py"],
  2170. args = ["--enable-new-api-stack", "--as-test", "--stop-reward=400.0", "--stop-timesteps=2000000", "--framework=torch", "--algo=IMPALA"]
  2171. )
  2172. py_test(
  2173. name = "examples/connectors/flatten_observations_dict_space_multi_agent_impala",
  2174. main = "examples/connectors/flatten_observations_dict_space.py",
  2175. tags = ["team:rllib", "exclusive", "examples"],
  2176. size = "large",
  2177. srcs = ["examples/connectors/flatten_observations_dict_space.py"],
  2178. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--stop-reward=800.0", "--stop-timesteps=2000000", "--framework=torch", "--algo=IMPALA"]
  2179. )
  2180. # Prev-r/prev actions + LSTM example.
  2181. py_test(
  2182. name = "examples/connectors/prev_actions_prev_rewards_ppo",
  2183. main = "examples/connectors/prev_actions_prev_rewards.py",
  2184. tags = ["team:rllib", "exclusive", "examples"],
  2185. size = "large",
  2186. srcs = ["examples/connectors/prev_actions_prev_rewards.py"],
  2187. args = ["--enable-new-api-stack", "--as-test", "--stop-reward=200.0", "--framework=torch", "--algo=PPO", "--num-env-runners=4", "--num-cpus=6"]
  2188. )
  2189. py_test(
  2190. name = "examples/connectors/prev_actions_prev_rewards_multi_agent_ppo",
  2191. main = "examples/connectors/prev_actions_prev_rewards.py",
  2192. tags = ["team:rllib", "exclusive", "examples", "examples_use_all_core"],
  2193. size = "large",
  2194. srcs = ["examples/connectors/prev_actions_prev_rewards.py"],
  2195. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--stop-reward=400.0", "--framework=torch", "--algo=PPO", "--num-env-runners=4", "--num-cpus=6"]
  2196. )
  2197. # MeanStd filtering example.
  2198. # PPO
  2199. py_test(
  2200. name = "examples/connectors/mean_std_filtering_ppo",
  2201. main = "examples/connectors/mean_std_filtering.py",
  2202. tags = ["team:rllib", "exclusive", "examples"],
  2203. size = "medium",
  2204. srcs = ["examples/connectors/mean_std_filtering.py"],
  2205. args = ["--enable-new-api-stack", "--as-test", "--stop-reward=-300.0", "--framework=torch", "--algo=PPO", "--num-env-runners=2", "--num-cpus=4"]
  2206. )
  2207. py_test(
  2208. name = "examples/connectors/mean_std_filtering_multi_agent_ppo",
  2209. main = "examples/connectors/mean_std_filtering.py",
  2210. tags = ["team:rllib", "exclusive", "examples", "examples_use_all_core"],
  2211. size = "large",
  2212. srcs = ["examples/connectors/mean_std_filtering.py"],
  2213. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--stop-reward=-600.0", "--framework=torch", "--algo=PPO", "--num-env-runners=5", "--num-cpus=7"]
  2214. )
  2215. # IMPALA
  2216. # TODO (sven): Make IMPALA learn Pendulum OR make this script flexible to accept
  2217. # (lopsided obs) CartPole as well.
  2218. # py_test(
  2219. # name = "examples/connectors/mean_std_filtering_impala",
  2220. # main = "examples/connectors/mean_std_filtering.py",
  2221. # tags = ["team:rllib", "exclusive", "examples"],
  2222. # size = "medium",
  2223. # srcs = ["examples/connectors/mean_std_filtering.py"],
  2224. # args = ["--enable-new-api-stack", "--as-test", "--stop-reward=-300.0", "--framework=torch", "--algo=IMPALA", "--num-env-runners=2"]
  2225. # )
  2226. # py_test(
  2227. # name = "examples/connectors/mean_std_filtering_multi_agent_impala",
  2228. # main = "examples/connectors/mean_std_filtering.py",
  2229. # tags = ["team:rllib", "exclusive", "examples"],
  2230. # size = "medium",
  2231. # srcs = ["examples/connectors/mean_std_filtering.py"],
  2232. # args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--stop-reward=-600.0", "--framework=torch", "--algo=IMPALA", "--num-env-runners=5", "--num-cpus=6"]
  2233. # )
  2234. # subdirectory: curiosity/
  2235. # ....................................
  2236. py_test(
  2237. name = "examples/curiosity/count_based_curiosity",
  2238. main = "examples/curiosity/count_based_curiosity.py",
  2239. tags = ["team:rllib", "exclusive", "examples"],
  2240. size = "large",
  2241. srcs = ["examples/curiosity/count_based_curiosity.py"],
  2242. args = ["--enable-new-api-stack", "--as-test"]
  2243. )
  2244. py_test(
  2245. name = "examples/curiosity/euclidian_distance_based_curiosity",
  2246. main = "examples/curiosity/euclidian_distance_based_curiosity.py",
  2247. tags = ["team:rllib", "exclusive", "examples"],
  2248. size = "large",
  2249. srcs = ["examples/curiosity/euclidian_distance_based_curiosity.py"],
  2250. args = ["--enable-new-api-stack", "--as-test"]
  2251. )
  2252. py_test(
  2253. name = "examples/curiosity/intrinsic_curiosity_model_based_curiosity_ppo",
  2254. main = "examples/curiosity/intrinsic_curiosity_model_based_curiosity.py",
  2255. tags = ["team:rllib", "exclusive", "examples"],
  2256. size = "large",
  2257. srcs = ["examples/curiosity/intrinsic_curiosity_model_based_curiosity.py"],
  2258. args = ["--enable-new-api-stack", "--as-test", "--algo=PPO"]
  2259. )
  2260. # TODO (sven): Learns, but very slowly. Needs further tuning.
  2261. # py_test(
  2262. # name = "examples/curiosity/intrinsic_curiosity_model_based_curiosity_dqn",
  2263. # main = "examples/curiosity/intrinsic_curiosity_model_based_curiosity.py",
  2264. # tags = ["team:rllib", "exclusive", "examples"],
  2265. # size = "large",
  2266. # srcs = ["examples/curiosity/intrinsic_curiosity_model_based_curiosity.py"],
  2267. # args = ["--enable-new-api-stack", "--as-test", "--algo=DQN"]
  2268. # )
  2269. # subdirectory: curriculum/
  2270. # ....................................
  2271. py_test(
  2272. name = "examples/curriculum/curriculum_learning",
  2273. main = "examples/curriculum/curriculum_learning.py",
  2274. tags = ["team:rllib", "exclusive", "examples"],
  2275. size = "medium",
  2276. srcs = ["examples/curriculum/curriculum_learning.py"],
  2277. args = ["--enable-new-api-stack", "--as-test"]
  2278. )
  2279. # subdirectory: debugging/
  2280. # ....................................
  2281. #@OldAPIStack
  2282. py_test(
  2283. name = "examples/debugging/deterministic_training_torch",
  2284. main = "examples/debugging/deterministic_training.py",
  2285. tags = ["team:rllib", "exclusive", "multi_gpu", "examples"],
  2286. size = "medium",
  2287. srcs = ["examples/debugging/deterministic_training.py"],
  2288. args = ["--as-test", "--stop-iters=1", "--framework=torch", "--num-gpus=1", "--num-gpus-per-env-runner=1"]
  2289. )
  2290. # subdirectory: envs/
  2291. # ....................................
  2292. py_test(
  2293. name = "examples/envs/custom_gym_env",
  2294. main = "examples/envs/custom_gym_env.py",
  2295. tags = ["team:rllib", "exclusive", "examples"],
  2296. size = "medium",
  2297. srcs = ["examples/envs/custom_gym_env.py"],
  2298. args = ["--enable-new-api-stack", "--as-test"]
  2299. )
  2300. py_test(
  2301. name = "examples/envs/custom_env_render_method",
  2302. main = "examples/envs/custom_env_render_method.py",
  2303. tags = ["team:rllib", "exclusive", "examples"],
  2304. size = "medium",
  2305. srcs = ["examples/envs/custom_env_render_method.py"],
  2306. args = ["--enable-new-api-stack", "--num-agents=0"]
  2307. )
  2308. py_test(
  2309. name = "examples/envs/custom_env_render_method_multi_agent",
  2310. main = "examples/envs/custom_env_render_method.py",
  2311. tags = ["team:rllib", "exclusive", "examples"],
  2312. size = "medium",
  2313. srcs = ["examples/envs/custom_env_render_method.py"],
  2314. args = ["--enable-new-api-stack", "--num-agents=2"]
  2315. )
  2316. py_test(
  2317. name = "examples/envs/env_rendering_and_recording",
  2318. srcs = ["examples/envs/env_rendering_and_recording.py"],
  2319. tags = ["team:rllib", "exclusive", "examples"],
  2320. size = "small",
  2321. args = ["--enable-new-api-stack", "--env=CartPole-v1", "--stop-iters=3"]
  2322. )
  2323. #@OldAPIStack
  2324. py_test(
  2325. name = "examples/envs/greyscale_env",
  2326. tags = ["team:rllib", "examples", "no_main"],
  2327. size = "medium",
  2328. srcs = ["examples/envs/greyscale_env.py"],
  2329. args = ["--stop-iters=1 --as-test --framework torch"]
  2330. )
  2331. # subdirectory: evaluation/
  2332. # ....................................
  2333. py_test(
  2334. name = "examples/evaluation/custom_evaluation",
  2335. main = "examples/evaluation/custom_evaluation.py",
  2336. tags = ["team:rllib", "exclusive", "examples"],
  2337. size = "medium",
  2338. srcs = ["examples/evaluation/custom_evaluation.py"],
  2339. args = ["--enable-new-api-stack", "--framework=torch", "--as-test", "--stop-reward=0.75", "--num-cpus=5"]
  2340. )
  2341. py_test(
  2342. name = "examples/evaluation/custom_evaluation_parallel_to_training",
  2343. main = "examples/evaluation/custom_evaluation.py",
  2344. tags = ["team:rllib", "exclusive", "examples"],
  2345. size = "medium",
  2346. srcs = ["examples/evaluation/custom_evaluation.py"],
  2347. args = ["--enable-new-api-stack", "--as-test", "--framework=torch", "--stop-reward=0.75", "--evaluation-parallel-to-training", "--num-cpus=5"]
  2348. )
  2349. py_test(
  2350. name = "examples/evaluation/evaluation_parallel_to_training_duration_auto_torch",
  2351. main = "examples/evaluation/evaluation_parallel_to_training.py",
  2352. tags = ["team:rllib", "exclusive", "examples"],
  2353. size = "medium",
  2354. srcs = ["examples/evaluation/evaluation_parallel_to_training.py"],
  2355. args = ["--enable-new-api-stack", "--as-test", "--evaluation-parallel-to-training", "--stop-reward=450.0", "--num-cpus=6", "--evaluation-duration=auto"]
  2356. )
  2357. py_test(
  2358. name = "examples/evaluation/evaluation_parallel_to_training_multi_agent_duration_auto_torch",
  2359. main = "examples/evaluation/evaluation_parallel_to_training.py",
  2360. tags = ["team:rllib", "exclusive", "examples", "examples_use_all_core"],
  2361. size = "large",
  2362. srcs = ["examples/evaluation/evaluation_parallel_to_training.py"],
  2363. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--evaluation-parallel-to-training", "--stop-reward=900.0", "--num-cpus=6", "--evaluation-duration=auto", "--evaluation-duration-unit=episodes"]
  2364. )
  2365. py_test(
  2366. name = "examples/evaluation/evaluation_parallel_to_training_511_ts_torch",
  2367. main = "examples/evaluation/evaluation_parallel_to_training.py",
  2368. tags = ["team:rllib", "exclusive", "examples"],
  2369. size = "medium",
  2370. srcs = ["examples/evaluation/evaluation_parallel_to_training.py"],
  2371. args = ["--enable-new-api-stack", "--as-test", "--evaluation-parallel-to-training", "--stop-reward=450.0", "--num-cpus=6", "--evaluation-num-env-runners=3", "--evaluation-duration=511", "--evaluation-duration-unit=timesteps"]
  2372. )
  2373. py_test(
  2374. name = "examples/evaluation/evaluation_parallel_to_training_multi_agent_1001_ts_torch",
  2375. main = "examples/evaluation/evaluation_parallel_to_training.py",
  2376. tags = ["team:rllib", "exclusive", "examples"],
  2377. size = "medium",
  2378. srcs = ["examples/evaluation/evaluation_parallel_to_training.py"],
  2379. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--evaluation-parallel-to-training", "--stop-reward=900.0", "--num-cpus=6", "--evaluation-duration=1001", "--evaluation-duration-unit=timesteps"]
  2380. )
  2381. py_test(
  2382. name = "examples/evaluation/evaluation_parallel_to_training_13_episodes_torch",
  2383. main = "examples/evaluation/evaluation_parallel_to_training.py",
  2384. tags = ["team:rllib", "exclusive", "examples"],
  2385. size = "medium",
  2386. srcs = ["examples/evaluation/evaluation_parallel_to_training.py"],
  2387. args = ["--enable-new-api-stack", "--as-test", "--evaluation-parallel-to-training", "--stop-reward=450.0", "--num-cpus=6", "--evaluation-duration=13", "--evaluation-duration-unit=episodes"]
  2388. )
  2389. py_test(
  2390. name = "examples/evaluation/evaluation_parallel_to_training_multi_agent_10_episodes_torch",
  2391. main = "examples/evaluation/evaluation_parallel_to_training.py",
  2392. tags = ["team:rllib", "exclusive", "examples"],
  2393. size = "medium",
  2394. srcs = ["examples/evaluation/evaluation_parallel_to_training.py"],
  2395. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--evaluation-parallel-to-training", "--stop-reward=900.0", "--num-cpus=6", "--evaluation-duration=10", "--evaluation-duration-unit=episodes"]
  2396. )
  2397. # @OldAPIStack
  2398. py_test(
  2399. name = "examples/evaluation/evaluation_parallel_to_training_duration_auto_torch_old_api_stack",
  2400. main = "examples/evaluation/evaluation_parallel_to_training.py",
  2401. tags = ["team:rllib", "exclusive", "examples"],
  2402. size = "medium",
  2403. srcs = ["examples/evaluation/evaluation_parallel_to_training.py"],
  2404. args = ["--as-test", "--evaluation-parallel-to-training", "--stop-reward=50.0", "--num-cpus=6", "--evaluation-duration=auto"]
  2405. )
  2406. # @OldAPIStack
  2407. py_test(
  2408. name = "examples/evaluation/evaluation_parallel_to_training_211_ts_torch_old_api_stack",
  2409. main = "examples/evaluation/evaluation_parallel_to_training.py",
  2410. tags = ["team:rllib", "exclusive", "examples"],
  2411. size = "medium",
  2412. srcs = ["examples/evaluation/evaluation_parallel_to_training.py"],
  2413. args = ["--as-test", "--evaluation-parallel-to-training", "--framework=torch", "--stop-reward=30.0", "--num-cpus=6", "--evaluation-num-env-runners=3", "--evaluation-duration=211", "--evaluation-duration-unit=timesteps"]
  2414. )
  2415. # subdirectory: fault_tolerance/
  2416. # ....................................
  2417. py_test(
  2418. name = "examples/fault_tolerance/crashing_cartpole_recreate_failed_env_runners_appo",
  2419. main = "examples/fault_tolerance/crashing_and_stalling_env.py",
  2420. tags = ["team:rllib", "exclusive", "examples"],
  2421. size = "large",
  2422. srcs = ["examples/fault_tolerance/crashing_and_stalling_env.py"],
  2423. args = ["--algo=APPO", "--enable-new-api-stack", "--as-test", "--stop-reward=450.0"]
  2424. )
  2425. py_test(
  2426. name = "examples/fault_tolerance/crashing_cartpole_restart_failed_envs_appo",
  2427. main = "examples/fault_tolerance/crashing_and_stalling_env.py",
  2428. tags = ["team:rllib", "exclusive", "examples"],
  2429. size = "large",
  2430. srcs = ["examples/fault_tolerance/crashing_and_stalling_env.py"],
  2431. args = ["--algo=APPO", "--enable-new-api-stack", "--as-test", "--restart-failed-envs", "--stop-reward=450.0"]
  2432. )
  2433. py_test(
  2434. name = "examples/fault_tolerance/crashing_and_stalling_cartpole_restart_failed_envs_ppo",
  2435. main = "examples/fault_tolerance/crashing_and_stalling_env.py",
  2436. tags = ["team:rllib", "exclusive", "examples"],
  2437. size = "large",
  2438. srcs = ["examples/fault_tolerance/crashing_and_stalling_env.py"],
  2439. args = ["--algo=PPO", "--enable-new-api-stack", "--as-test", "--restart-failed-envs", "--stall", "--stop-reward=450.0"]
  2440. )
  2441. py_test(
  2442. name = "examples/fault_tolerance/crashing_and_stalling_multi_agent_cartpole_restart_failed_envs_ppo",
  2443. main = "examples/fault_tolerance/crashing_and_stalling_env.py",
  2444. tags = ["team:rllib", "exclusive", "examples"],
  2445. size = "large",
  2446. srcs = ["examples/fault_tolerance/crashing_and_stalling_env.py"],
  2447. args = ["--algo=PPO", "--num-agents=2", "--enable-new-api-stack", "--as-test", "--restart-failed-envs", "--stop-reward=800.0"]
  2448. )
  2449. # subdirectory: gpus/
  2450. # ....................................
  2451. py_test(
  2452. name = "examples/gpus/float16_training_and_inference",
  2453. main = "examples/gpus/float16_training_and_inference.py",
  2454. tags = ["team:rllib", "exclusive", "examples", "gpu"],
  2455. size = "medium",
  2456. srcs = ["examples/gpus/float16_training_and_inference.py"],
  2457. args = ["--enable-new-api-stack", "--as-test", "--stop-reward=150.0"]
  2458. )
  2459. py_test(
  2460. name = "examples/gpus/mixed_precision_training_float16_inference",
  2461. main = "examples/gpus/mixed_precision_training_float16_inference.py",
  2462. tags = ["team:rllib", "exclusive", "examples", "gpu"],
  2463. size = "medium",
  2464. srcs = ["examples/gpus/mixed_precision_training_float16_inference.py"],
  2465. args = ["--enable-new-api-stack", "--as-test"]
  2466. )
  2467. py_test(
  2468. name = "examples/gpus/fractional_0.5_gpus_per_learner",
  2469. main = "examples/gpus/fractional_gpus_per_learner.py",
  2470. tags = ["team:rllib", "exclusive", "examples", "multi_gpu"],
  2471. size = "medium",
  2472. srcs = ["examples/gpus/fractional_gpus_per_learner.py"],
  2473. args = ["--enable-new-api-stack", "--as-test", "--stop-reward=40.0", "--num-learners=1", "--num-gpus-per-learner=0.5"]
  2474. )
  2475. py_test(
  2476. name = "examples/gpus/fractional_0.2_gpus_per_learner",
  2477. main = "examples/gpus/fractional_gpus_per_learner.py",
  2478. tags = ["team:rllib", "exclusive", "examples", "gpu"],
  2479. size = "medium",
  2480. srcs = ["examples/gpus/fractional_gpus_per_learner.py"],
  2481. args = ["--enable-new-api-stack", "--as-test", "--stop-reward=40.0", "--num-learners=1", "--num-gpus-per-learner=0.2"]
  2482. )
  2483. # subdirectory: hierarchical/
  2484. # ....................................
  2485. #@OldAPIStack
  2486. py_test(
  2487. name = "examples/hierarchical/hierarchical_training_tf",
  2488. main = "examples/hierarchical/hierarchical_training.py",
  2489. tags = ["team:rllib", "exclusive", "examples"],
  2490. size = "medium",
  2491. srcs = ["examples/hierarchical/hierarchical_training.py"],
  2492. args = [ "--framework=tf", "--stop-reward=0.0"]
  2493. )
  2494. #@OldAPIStack
  2495. py_test(
  2496. name = "examples/hierarchical/hierarchical_training_torch",
  2497. main = "examples/hierarchical/hierarchical_training.py",
  2498. tags = ["team:rllib", "exclusive", "examples"],
  2499. size = "medium",
  2500. srcs = ["examples/hierarchical/hierarchical_training.py"],
  2501. args = ["--framework=torch", "--stop-reward=0.0"]
  2502. )
  2503. # subdirectory: inference/
  2504. # ....................................
  2505. py_test(
  2506. name = "examples/inference/policy_inference_after_training",
  2507. main = "examples/inference/policy_inference_after_training.py",
  2508. tags = ["team:rllib", "exclusive", "examples"],
  2509. size = "medium",
  2510. srcs = ["examples/inference/policy_inference_after_training.py"],
  2511. args = ["--enable-new-api-stack", "--stop-reward=100.0"]
  2512. )
  2513. py_test(
  2514. name = "examples/inference/policy_inference_after_training_w_connector",
  2515. main = "examples/inference/policy_inference_after_training_w_connector.py",
  2516. tags = ["team:rllib", "exclusive", "examples"],
  2517. size = "medium",
  2518. srcs = ["examples/inference/policy_inference_after_training_w_connector.py"],
  2519. args = ["--enable-new-api-stack", "--stop-reward=150.0"]
  2520. )
  2521. #@OldAPIStack
  2522. py_test(
  2523. name = "examples/inference/policy_inference_after_training_with_attention_tf",
  2524. main = "examples/inference/policy_inference_after_training_with_attention.py",
  2525. tags = ["team:rllib", "exclusive", "examples"],
  2526. size = "medium",
  2527. srcs = ["examples/inference/policy_inference_after_training_with_attention.py"],
  2528. args = ["--stop-iters=2", "--framework=tf"]
  2529. )
  2530. #@OldAPIStack
  2531. py_test(
  2532. name = "examples/inference/policy_inference_after_training_with_attention_torch",
  2533. main = "examples/inference/policy_inference_after_training_with_attention.py",
  2534. tags = ["team:rllib", "exclusive", "examples"],
  2535. size = "medium",
  2536. srcs = ["examples/inference/policy_inference_after_training_with_attention.py"],
  2537. args = ["--stop-iters=2", "--framework=torch"]
  2538. )
  2539. #@OldAPIStack
  2540. py_test(
  2541. name = "examples/inference/policy_inference_after_training_with_lstm_tf",
  2542. main = "examples/inference/policy_inference_after_training_with_lstm.py",
  2543. tags = ["team:rllib", "exclusive", "examples"],
  2544. size = "medium",
  2545. srcs = ["examples/inference/policy_inference_after_training_with_lstm.py"],
  2546. args = ["--stop-iters=1", "--framework=tf"]
  2547. )
  2548. #@OldAPIStack
  2549. py_test(
  2550. name = "examples/inference/policy_inference_after_training_with_lstm_torch",
  2551. main = "examples/inference/policy_inference_after_training_with_lstm.py",
  2552. tags = ["team:rllib", "exclusive", "examples"],
  2553. size = "medium",
  2554. srcs = ["examples/inference/policy_inference_after_training_with_lstm.py"],
  2555. args = ["--stop-iters=1", "--framework=torch"]
  2556. )
  2557. # subdirectory: learners/
  2558. # ....................................
  2559. py_test(
  2560. name = "examples/learners/custom_loss_fn_simple",
  2561. main = "examples/learners/custom_loss_fn_simple.py",
  2562. tags = ["team:rllib", "examples"],
  2563. size = "medium",
  2564. srcs = ["examples/learners/custom_loss_fn_simple.py"],
  2565. args = ["--enable-new-api-stack", "--as-test"]
  2566. )
  2567. py_test(
  2568. name = "examples/learners/separate_vf_lr_and_optimizer",
  2569. main = "examples/learners/separate_vf_lr_and_optimizer.py",
  2570. tags = ["team:rllib", "examples"],
  2571. size = "medium",
  2572. srcs = ["examples/learners/separate_vf_lr_and_optimizer.py"],
  2573. args = ["--enable-new-api-stack", "--as-test"]
  2574. )
  2575. py_test(
  2576. name = "examples/learners/ppo_with_torch_lr_schedulers",
  2577. main = "examples/learners/ppo_with_torch_lr_schedulers.py",
  2578. tags = ["team:rllib", "examples"],
  2579. size = "medium",
  2580. srcs = ["examples/learners/ppo_with_torch_lr_schedulers.py"],
  2581. args = ["--enable-new-api-stack", "--as-test"]
  2582. )
  2583. # subdirectory: metrics/
  2584. # ....................................
  2585. py_test(
  2586. name = "examples/metrics/custom_metrics_in_env_runners",
  2587. main = "examples/metrics/custom_metrics_in_env_runners.py",
  2588. tags = ["team:rllib", "exclusive", "examples"],
  2589. size = "medium",
  2590. srcs = ["examples/metrics/custom_metrics_in_env_runners.py"],
  2591. args = ["--enable-new-api-stack", "--stop-iters=3"]
  2592. )
  2593. # subdirectory: multi_agent/
  2594. # ....................................
  2595. py_test(
  2596. name = "examples/multi_agent/custom_heuristic_policy",
  2597. main = "examples/multi_agent/custom_heuristic_policy.py",
  2598. tags = ["team:rllib", "exclusive", "examples", "examples_use_all_core"],
  2599. size = "large",
  2600. srcs = ["examples/multi_agent/custom_heuristic_policy.py"],
  2601. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=450.0"]
  2602. )
  2603. py_test(
  2604. name = "examples/multi_agent/different_spaces_for_agents_ppo",
  2605. main = "examples/multi_agent/different_spaces_for_agents.py",
  2606. tags = ["team:rllib", "exclusive", "examples"],
  2607. size = "small",
  2608. srcs = ["examples/multi_agent/different_spaces_for_agents.py"],
  2609. args = ["--enable-new-api-stack", "--algo=PPO", "--stop-iters=4", "--framework=torch"]
  2610. )
  2611. py_test(
  2612. name = "examples/multi_agent/multi_agent_cartpole",
  2613. main = "examples/multi_agent/multi_agent_cartpole.py",
  2614. tags = ["team:rllib", "exclusive", "examples", "examples_use_all_core"],
  2615. size = "large",
  2616. srcs = ["examples/multi_agent/multi_agent_cartpole.py"],
  2617. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=600.0", "--num-cpus=4"]
  2618. )
  2619. py_test(
  2620. name = "examples/multi_agent/multi_agent_pendulum_multi_gpu",
  2621. main = "examples/multi_agent/multi_agent_pendulum.py",
  2622. tags = ["team:rllib", "exclusive", "examples", "multi_gpu"],
  2623. size = "large",
  2624. srcs = ["examples/multi_agent/multi_agent_pendulum.py"],
  2625. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=-500.0", "--num-cpus=5", "--num-gpus=2"]
  2626. )
  2627. py_test(
  2628. name = "examples/multi_agent/pettingzoo_independent_learning",
  2629. main = "examples/multi_agent/pettingzoo_independent_learning.py",
  2630. tags = ["team:rllib", "examples"],
  2631. size = "large",
  2632. srcs = ["examples/multi_agent/pettingzoo_independent_learning.py"],
  2633. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=-200.0", "--num-cpus=4"]
  2634. )
  2635. py_test(
  2636. name = "examples/multi_agent/pettingzoo_parameter_sharing",
  2637. main = "examples/multi_agent/pettingzoo_parameter_sharing.py",
  2638. tags = ["team:rllib", "exclusive", "examples"],
  2639. size = "large",
  2640. srcs = ["examples/multi_agent/pettingzoo_parameter_sharing.py"],
  2641. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=-210.0", "--num-cpus=4"],
  2642. )
  2643. # TODO (sven): Activate this test once this script is ready.
  2644. # py_test(
  2645. # name = "examples/multi_agent/pettingzoo_shared_value_function",
  2646. # main = "examples/multi_agent/pettingzoo_shared_value_function.py",
  2647. # tags = ["team:rllib", "exclusive", "examples"],
  2648. # size = "large",
  2649. # srcs = ["examples/multi_agent/pettingzoo_shared_value_function.py"],
  2650. # args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=-100.0", "--num-cpus=4"],
  2651. # )
  2652. py_test(
  2653. name = "examples/checkpoints/restore_1_of_n_agents_from_checkpoint",
  2654. main = "examples/checkpoints/restore_1_of_n_agents_from_checkpoint.py",
  2655. tags = ["team:rllib", "exclusive", "examples", "examples_use_all_core", "no_main"],
  2656. size = "large",
  2657. srcs = ["examples/checkpoints/restore_1_of_n_agents_from_checkpoint.py"],
  2658. args = ["--enable-new-api-stack", "--num-agents=2", "--framework=torch", "--checkpoint-freq=20", "--checkpoint-at-end", "--num-cpus=4", "--algo=PPO"]
  2659. )
  2660. py_test(
  2661. name = "examples/multi_agent/rock_paper_scissors_heuristic_vs_learned",
  2662. main = "examples/multi_agent/rock_paper_scissors_heuristic_vs_learned.py",
  2663. tags = ["team:rllib", "exclusive", "examples"],
  2664. size = "medium",
  2665. srcs = ["examples/multi_agent/rock_paper_scissors_heuristic_vs_learned.py"],
  2666. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=6.5"],
  2667. )
  2668. py_test(
  2669. name = "examples/multi_agent/rock_paper_scissors_heuristic_vs_learned_w_lstm",
  2670. main = "examples/multi_agent/rock_paper_scissors_heuristic_vs_learned.py",
  2671. tags = ["team:rllib", "exclusive", "examples"],
  2672. size = "large",
  2673. srcs = ["examples/multi_agent/rock_paper_scissors_heuristic_vs_learned.py"],
  2674. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=7.2", "--use-lstm", "--num-env-runners=4", "--num-cpus=6"],
  2675. )
  2676. py_test(
  2677. name = "examples/multi_agent/rock_paper_scissors_learned_vs_learned",
  2678. main = "examples/multi_agent/rock_paper_scissors_learned_vs_learned.py",
  2679. tags = ["team:rllib", "exclusive", "examples"],
  2680. size = "medium",
  2681. srcs = ["examples/multi_agent/rock_paper_scissors_learned_vs_learned.py"],
  2682. args = ["--enable-new-api-stack", "--num-agents=2", "--framework=torch", "--stop-iter=10"],
  2683. )
  2684. # @OldAPIStack
  2685. py_test(
  2686. name = "examples/multi_agent/self_play_with_open_spiel_connect_4_ppo_tf_old_api_stack",
  2687. main = "examples/multi_agent/self_play_with_open_spiel.py",
  2688. tags = ["team:rllib", "exclusive", "examples"],
  2689. size = "medium",
  2690. srcs = ["examples/multi_agent/self_play_with_open_spiel.py"],
  2691. args = ["--framework=tf", "--env=connect_four", "--win-rate-threshold=0.9", "--num-episodes-human-play=0", "--min-league-size=3"]
  2692. )
  2693. # @OldAPIStack
  2694. py_test(
  2695. name = "examples/multi_agent/self_play_with_open_spiel_connect_4_ppo_torch_old_api_stack",
  2696. main = "examples/multi_agent/self_play_with_open_spiel.py",
  2697. tags = ["team:rllib", "exclusive", "examples"],
  2698. size = "medium",
  2699. srcs = ["examples/multi_agent/self_play_with_open_spiel.py"],
  2700. args = ["--framework=torch", "--env=connect_four", "--win-rate-threshold=0.9", "--num-episodes-human-play=0", "--min-league-size=3"]
  2701. )
  2702. py_test(
  2703. name = "examples/multi_agent/self_play_with_open_spiel_connect_4_ppo_torch",
  2704. main = "examples/multi_agent/self_play_with_open_spiel.py",
  2705. tags = ["team:rllib", "exclusive", "examples"],
  2706. size = "medium",
  2707. srcs = ["examples/multi_agent/self_play_with_open_spiel.py"],
  2708. args = ["--enable-new-api-stack", "--framework=torch", "--env=connect_four", "--win-rate-threshold=0.9", "--num-episodes-human-play=0", "--min-league-size=4"]
  2709. )
  2710. py_test(
  2711. name = "examples/multi_agent/self_play_league_based_with_open_spiel_connect_4_ppo_torch",
  2712. main = "examples/multi_agent/self_play_league_based_with_open_spiel.py",
  2713. tags = ["team:rllib", "exclusive", "examples"],
  2714. size = "large",
  2715. srcs = ["examples/multi_agent/self_play_league_based_with_open_spiel.py"],
  2716. args = ["--enable-new-api-stack", "--framework=torch", "--env=connect_four", "--win-rate-threshold=0.8", "--num-episodes-human-play=0", "--min-league-size=8"]
  2717. )
  2718. py_test(
  2719. name = "examples/multi_agent/two_step_game_with_grouped_agents",
  2720. main = "examples/multi_agent/two_step_game_with_grouped_agents.py",
  2721. tags = ["team:rllib", "exclusive", "examples"],
  2722. size = "medium",
  2723. srcs = ["examples/multi_agent/two_step_game_with_grouped_agents.py"],
  2724. args = ["--enable-new-api-stack", "--num-agents=2", "--as-test", "--framework=torch", "--stop-reward=7.0"]
  2725. )
  2726. # subdirectory: offline_rl/
  2727. # ....................................
  2728. py_test(
  2729. name = "examples/offline_rl/train_w_bc_finetune_w_ppo",
  2730. main = "examples/offline_rl/train_w_bc_finetune_w_ppo.py",
  2731. tags = ["team:rllib", "examples", "exclusive"],
  2732. size = "medium",
  2733. srcs = ["examples/offline_rl/train_w_bc_finetune_w_ppo.py"],
  2734. args = ["--enable-new-api-stack", "--as-test", "--framework=torch"],
  2735. # Include the offline data files.
  2736. data = ["tests/data/cartpole/cartpole-v1_large"]
  2737. )
  2738. # @HybridAPIStack
  2739. # py_test(
  2740. # name = "examples/offline_rl/pretrain_bc_single_agent_evaluate_as_multi_agent",
  2741. # main = "examples/offline_rl/pretrain_bc_single_agent_evaluate_as_multi_agent.py",
  2742. # tags = ["team:rllib", "exclusive", "examples"],
  2743. # size = "large",
  2744. # srcs = ["examples/offline_rl/pretrain_bc_single_agent_evaluate_as_multi_agent.py"],
  2745. # data = ["tests/data/cartpole/large.json"],
  2746. # args = ["--as-test"]
  2747. # )
  2748. #@OldAPIStack
  2749. # TODO (sven): Doesn't seem to learn at the moment. Uncomment once fixed.
  2750. # py_test(
  2751. # name = "examples/offline_rl/custom_input_api_cql_torch",
  2752. # main = "examples/offline_rl/custom_input_api.py",
  2753. # tags = ["team:rllib", "exclusive", "examples"],
  2754. # size = "medium",
  2755. # srcs = ["examples/offline_rl/custom_input_api.py"],
  2756. # args = ["--as-test", "--stop-reward=-300", "--stop-iters=1"]
  2757. # )
  2758. #@OldAPIStack
  2759. py_test(
  2760. name = "examples/offline_rl/offline_rl_torch_old_api_stack",
  2761. main = "examples/offline_rl/offline_rl.py",
  2762. tags = ["team:rllib", "exclusive", "examples"],
  2763. size = "medium",
  2764. srcs = ["examples/offline_rl/offline_rl.py"],
  2765. args = ["--as-test", "--stop-reward=-300", "--stop-iters=1"]
  2766. )
  2767. # subdirectory: ray_serve/
  2768. # ....................................
  2769. # TODO (sven): Uncomment once the problem with the path on BAZEL is solved.
  2770. # py_test(
  2771. # name = "examples/ray_serve/ray_serve_with_rllib",
  2772. # main = "examples/ray_serve/ray_serve_with_rllib.py",
  2773. # tags = ["team:rllib", "exclusive", "examples"],
  2774. # size = "medium",
  2775. # srcs = ["examples/ray_serve/ray_serve_with_rllib.py"],
  2776. # args = ["--train-iters=2", "--serve-episodes=2", "--no-render"]
  2777. # )
  2778. # subdirectory: ray_tune/
  2779. # ....................................
  2780. py_test(
  2781. name = "examples/ray_tune/custom_experiment",
  2782. main = "examples/ray_tune/custom_experiment.py",
  2783. tags = ["team:rllib", "exclusive", "examples"],
  2784. size = "medium",
  2785. srcs = ["examples/ray_tune/custom_experiment.py"],
  2786. )
  2787. py_test(
  2788. name = "examples/ray_tune/custom_logger",
  2789. main = "examples/ray_tune/custom_logger.py",
  2790. tags = ["team:rllib", "exclusive", "examples"],
  2791. size = "medium",
  2792. srcs = ["examples/ray_tune/custom_logger.py"],
  2793. )
  2794. py_test(
  2795. name = "examples/ray_tune/custom_progress_reporter",
  2796. main = "examples/ray_tune/custom_progress_reporter.py",
  2797. tags = ["team:rllib", "exclusive", "examples"],
  2798. size = "medium",
  2799. srcs = ["examples/ray_tune/custom_progress_reporter.py"],
  2800. )
  2801. # subdirectory: rl_modules/
  2802. # ....................................
  2803. py_test(
  2804. name = "examples/rl_modules/action_masking_rl_module",
  2805. main = "examples/rl_modules/action_masking_rl_module.py",
  2806. tags = ["team:rllib", "examples"],
  2807. size = "medium",
  2808. srcs = ["examples/rl_modules/action_masking_rl_module.py"],
  2809. args = ["--enable-new-api-stack", "--stop-iters=5"],
  2810. )
  2811. py_test(
  2812. name = "examples/rl_modules/autoregressive_actions_rl_module",
  2813. main = "examples/rl_modules/autoregressive_actions_rl_module.py",
  2814. tags = ["team:rllib", "examples"],
  2815. size = "medium",
  2816. srcs = ["examples/rl_modules/autoregressive_actions_rl_module.py"],
  2817. args = ["--enable-new-api-stack"],
  2818. )
  2819. py_test(
  2820. name = "examples/rl_modules/custom_cnn_rl_module",
  2821. main = "examples/rl_modules/custom_cnn_rl_module.py",
  2822. tags = ["team:rllib", "examples"],
  2823. size = "medium",
  2824. srcs = ["examples/rl_modules/custom_cnn_rl_module.py"],
  2825. args = ["--enable-new-api-stack", "--stop-iters=3"],
  2826. )
  2827. py_test(
  2828. name = "examples/rl_modules/custom_lstm_rl_module",
  2829. main = "examples/rl_modules/custom_lstm_rl_module.py",
  2830. tags = ["team:rllib", "examples"],
  2831. size = "large",
  2832. srcs = ["examples/rl_modules/custom_lstm_rl_module.py"],
  2833. args = ["--as-test", "--enable-new-api-stack"],
  2834. )
  2835. py_test(
  2836. name = "examples/rl_modules/classes/mobilenet_rlm",
  2837. main = "examples/rl_modules/classes/mobilenet_rlm.py",
  2838. tags = ["team:rllib", "examples", "no_main"],
  2839. size = "small",
  2840. srcs = ["examples/rl_modules/classes/mobilenet_rlm.py"],
  2841. )
  2842. py_test(
  2843. name = "examples/rl_modules/migrate_modelv2_to_new_api_stack_by_config",
  2844. main = "examples/rl_modules/migrate_modelv2_to_new_api_stack_by_config.py",
  2845. tags = ["team:rllib", "examples"],
  2846. size = "large",
  2847. srcs = ["examples/rl_modules/migrate_modelv2_to_new_api_stack_by_config.py"],
  2848. )
  2849. py_test(
  2850. name = "examples/rl_modules/migrate_modelv2_to_new_api_stack_by_policy_checkpoint",
  2851. main = "examples/rl_modules/migrate_modelv2_to_new_api_stack_by_policy_checkpoint.py",
  2852. tags = ["team:rllib", "examples"],
  2853. size = "large",
  2854. srcs = ["examples/rl_modules/migrate_modelv2_to_new_api_stack_by_policy_checkpoint.py"],
  2855. )
  2856. py_test(
  2857. name = "examples/rl_modules/pretraining_single_agent_training_multi_agent",
  2858. main = "examples/rl_modules/pretraining_single_agent_training_multi_agent.py",
  2859. tags = ["team:rllib", "examples"],
  2860. size = "medium",
  2861. srcs = ["examples/rl_modules/pretraining_single_agent_training_multi_agent.py"],
  2862. args = ["--enable-new-api-stack", "--num-agents=2", "--stop-iters-pretraining=5", "--stop-iters=20", "--stop-reward=150.0"],
  2863. )
  2864. #@OldAPIStack
  2865. py_test(
  2866. name = "examples/autoregressive_action_dist_tf",
  2867. main = "examples/autoregressive_action_dist.py",
  2868. tags = ["team:rllib", "exclusive", "examples"],
  2869. size = "medium",
  2870. srcs = ["examples/autoregressive_action_dist.py"],
  2871. args = ["--as-test", "--framework=tf", "--stop-reward=-0.012", "--num-cpus=4"]
  2872. )
  2873. #@OldAPIStack
  2874. py_test(
  2875. name = "examples/autoregressive_action_dist_torch",
  2876. main = "examples/autoregressive_action_dist.py",
  2877. tags = ["team:rllib", "exclusive", "examples"],
  2878. size = "medium",
  2879. srcs = ["examples/autoregressive_action_dist.py"],
  2880. args = ["--as-test", "--framework=torch", "--stop-reward=-0.012", "--num-cpus=4"]
  2881. )
  2882. #@OldAPIStack
  2883. py_test(
  2884. name = "examples/centralized_critic_tf",
  2885. main = "examples/centralized_critic.py",
  2886. tags = ["team:rllib", "exclusive", "examples"],
  2887. size = "medium",
  2888. srcs = ["examples/centralized_critic.py"],
  2889. args = ["--as-test", "--framework=tf", "--stop-reward=7.2"]
  2890. )
  2891. #@OldAPIStack
  2892. py_test(
  2893. name = "examples/centralized_critic_torch",
  2894. main = "examples/centralized_critic.py",
  2895. tags = ["team:rllib", "exclusive", "examples"],
  2896. size = "medium",
  2897. srcs = ["examples/centralized_critic.py"],
  2898. args = ["--as-test", "--framework=torch", "--stop-reward=7.2"]
  2899. )
  2900. #@OldAPIStack
  2901. py_test(
  2902. name = "examples/centralized_critic_2_tf",
  2903. main = "examples/centralized_critic_2.py",
  2904. tags = ["team:rllib", "exclusive", "examples"],
  2905. size = "medium",
  2906. srcs = ["examples/centralized_critic_2.py"],
  2907. args = ["--as-test", "--framework=tf", "--stop-reward=6.0"]
  2908. )
  2909. #@OldAPIStack
  2910. py_test(
  2911. name = "examples/centralized_critic_2_torch",
  2912. main = "examples/centralized_critic_2.py",
  2913. tags = ["team:rllib", "exclusive", "examples"],
  2914. size = "medium",
  2915. srcs = ["examples/centralized_critic_2.py"],
  2916. args = ["--as-test", "--framework=torch", "--stop-reward=6.0"]
  2917. )
  2918. py_test(
  2919. name = "examples/custom_recurrent_rnn_tokenizer_repeat_after_me_tf2",
  2920. main = "examples/custom_recurrent_rnn_tokenizer.py",
  2921. tags = ["team:rllib", "exclusive", "examples"],
  2922. size = "medium",
  2923. srcs = ["examples/custom_recurrent_rnn_tokenizer.py"],
  2924. args = ["--as-test", "--framework=tf2", "--stop-reward=40", "--env=RepeatAfterMeEnv", "--num-cpus=4"]
  2925. )
  2926. py_test(
  2927. name = "examples/custom_recurrent_rnn_tokenizer_repeat_initial_obs_env_tf2",
  2928. main = "examples/custom_recurrent_rnn_tokenizer.py",
  2929. tags = ["team:rllib", "examples"],
  2930. size = "medium",
  2931. srcs = ["examples/custom_recurrent_rnn_tokenizer.py"],
  2932. args = ["--as-test", "--framework=tf2", "--stop-reward=10", "--stop-timesteps=300000", "--env=RepeatInitialObsEnv", "--num-cpus=4"]
  2933. )
  2934. py_test(
  2935. name = "examples/custom_recurrent_rnn_tokenizer_repeat_after_me_torch",
  2936. main = "examples/custom_recurrent_rnn_tokenizer.py",
  2937. tags = ["team:rllib", "exclusive", "examples"],
  2938. size = "medium",
  2939. srcs = ["examples/custom_recurrent_rnn_tokenizer.py"],
  2940. args = ["--as-test", "--framework=torch", "--stop-reward=40", "--env=RepeatAfterMeEnv", "--num-cpus=4"]
  2941. )
  2942. py_test(
  2943. name = "examples/custom_recurrent_rnn_tokenizer_repeat_initial_obs_env_torch",
  2944. main = "examples/custom_recurrent_rnn_tokenizer.py",
  2945. tags = ["team:rllib", "exclusive", "examples"],
  2946. size = "medium",
  2947. srcs = ["examples/custom_recurrent_rnn_tokenizer.py"],
  2948. args = ["--as-test", "--framework=torch", "--stop-reward=10", "--stop-timesteps=300000", "--env=RepeatInitialObsEnv", "--num-cpus=4"]
  2949. )
  2950. py_test(
  2951. name = "examples/replay_buffer_api",
  2952. tags = ["team:rllib", "examples"],
  2953. size = "large",
  2954. srcs = ["examples/replay_buffer_api.py"],
  2955. )
  2956. # --------------------------------------------------------------------
  2957. # Manual/disabled tests
  2958. # --------------------------------------------------------------------
  2959. py_test_module_list(
  2960. files = [
  2961. "utils/tests/test_utils.py",
  2962. ],
  2963. size = "large",
  2964. extra_srcs = [],
  2965. deps = [],
  2966. tags = ["manual", "team:rllib", "no_main"],
  2967. )