Skip to content

feat(backends): Native Windows jax-md support via Winloop #94

@ericchansen

Description

@ericchansen

Summary

Enable native Windows installation of jax-md by using Winloop as a drop-in replacement for uvloop.

Problem

jax-md cannot be installed on Windows due to this transitive dependency chain:

jax-md -> flax -> orbax-checkpoint -> uvloop

uvloop is Unix-only (it wraps libuv's Unix event loop). This blocks native Windows usage of jax-md and forces WSL2 as a workaround (#92 phase 1).

Proposed solution

Winloop is a Windows-compatible fork of uvloop built on top of libuv's Windows IOCP backend. It provides a drop-in replacement API.

Options (in order of preference)

  1. Upstream fix in orbax-checkpoint: Make uvloop an optional/conditional dependency -- only require it on non-Windows platforms. This is the right fix since orbax-checkpoint likely only uses uvloop for async checkpointing performance, not correctness.

  2. Upstream fix in jax-md: Make flax an optional dependency (see feat(backends): Native Windows jax-md support via Winloop #94), eliminating the chain entirely for MM-only usage.

  3. Local workaround: Install jax-md with --no-deps, then manually install dependencies substituting Winloop for uvloop:

    pip install winloop
    pip install jax-md --no-deps
    pip install flax --no-deps
    pip install orbax-checkpoint --no-deps
    # ... install remaining deps manually
  4. Platform-conditional dependency in our pyproject.toml:

    [project.optional-dependencies]
    jax-md = [
        "jax-md; sys_platform != 'win32'",
    ]
    jax-md-win = [
        "jax-md; sys_platform == 'win32'",
        "winloop; sys_platform == 'win32'",
    ]

Acceptance criteria

  • pip install q2mm[jax-md] works on Windows without WSL2
  • JaxMDEngine passes all tests on native Windows
  • CI includes a Windows + jax-md test matrix entry

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend-specific (OpenMM, Tinker, JAX, etc.)enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions