{"record":{"id":"6380cfcef6e302ed","repo":"jax-ml/jax","slug":"make-mpi-collectives-is-not-implemented-for-window","errorCode":null,"errorMessage":"make_mpi_collectives is not implemented for Windows","messagePattern":"make_mpi_collectives is not implemented for Windows","errorType":"exception","errorClass":"xla::XlaRuntimeError","httpStatus":null,"severity":"error","filePath":"jaxlib/jax.cc","lineNumber":446,"sourceCode":"            \"make_gloo_tcp_collectives only implemented for linux and macos\");\n#endif  // defined(__linux__)\n      },\n      nb::arg(\"distributed_client\"), nb::arg(\"hostname\").none() = std::nullopt,\n      nb::arg(\"interface\").none() = std::nullopt);\n\n#if !defined(_WIN32) && !defined(PLATFORM_GOOGLE)\n  nb::class_<xla::cpu::MpiCollectives> mpi_collectives(m, \"MpiCollectives\",\n                                                       cpu_collectives);\n  mpi_collectives.def(\"Init\", &xla::cpu::MpiCollectives::Init);\n  mpi_collectives.def(\"Finalize\", &xla::cpu::MpiCollectives::Finalize);\n  m.def(\"make_mpi_collectives\",\n        []() -> std::shared_ptr<xla::cpu::MpiCollectives> {\n          return std::make_shared<xla::cpu::MpiCollectives>();\n        });\n#else   // !_WIN32 && !PLATFORM_GOOGLE\n  m.def(\"make_mpi_collectives\",\n        []() -> std::shared_ptr<xla::cpu::CpuCollectives> {\n          throw xla::XlaRuntimeError(\n              \"make_mpi_collectives is not implemented for Windows\");\n        });\n#endif  // !_WIN32 && !PLATFORM_GOOGLE\n\n  m.def(\n      \"get_tfrt_cpu_client\",\n      [](bool asynchronous,\n         std::shared_ptr<xla::DistributedRuntimeClient> distributed_client,\n         int node_id, int num_nodes,\n         std::shared_ptr<xla::cpu::CpuCollectives> collectives,\n         std::optional<int> num_devices,\n         std::optional<int> get_local_topology_timeout_minutes,\n         std::optional<int> get_global_topology_timeout_minutes,\n         std::optional<xla::ifrt::TransferServerInterfaceFactory>\n             transfer_server_factory) -> nb_class_ptr<PyClient> {\n        std::unique_ptr<xla::ifrt::PjRtClient> ifrt_client;\n        {\n          nb::gil_scoped_release gil_release;","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jaxlib/jax.cc#L428-L464","documentation":"MpiCollectives is only compiled when jaxlib is built with MPI support on non-Windows; the default Windows build registers the function but throws to signal the capability is absent.","triggerScenarios":"Calling jaxlib.make_mpi_collectives() on Windows or on a jaxlib built without MPI support.","commonSituations":"Attempting MPI-based CPU collectives on Windows or with the standard pip jaxlib (which lacks MPI).","solutions":["Use gloo collectives (make_gloo_tcp_collectives) instead where supported","Build jaxlib from source with MPI on Linux","Run under WSL2/Linux with an MPI-enabled build"],"exampleFix":"# before\ncoll = jaxlib.make_mpi_collectives()\n# after\ncoll = jaxlib.make_gloo_tcp_collectives(distributed_client)","handlingStrategy":"fallback","validationCode":"import sys\nmpi_ok = sys.platform != 'win32' and hasattr(jaxlib, 'make_mpi_collectives')","typeGuard":"def mpi_available() -> bool:\n    import jaxlib\n    return sys.platform != 'win32' and getattr(jaxlib, '_mpi_support', False)","tryCatchPattern":"try:\n    coll = jaxlib.make_mpi_collectives()\nexcept Exception:\n    coll = jaxlib.make_gloo_tcp_collectives(client)","preventionTips":["Prefer gloo collectives unless you built jaxlib with MPI"],"tags":["jax","mpi","collectives","platform-support"],"backgroundTag":"platform-not-supported","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}