Skip to content

Add Native Windows Support - #8542

Open
nithin-aashik-mcw wants to merge 12 commits into
deepspeedai:masterfrom
nithin-aashik-mcw:feature/windows-support
Open

nithin-aashik-mcw wants to merge 12 commits into
deepspeedai:masterfrom
nithin-aashik-mcw:feature/windows-support

Conversation

@nithin-aashik-mcw

Copy link
Copy Markdown

Summary

Adds native Windows support to DeepSpeed: the CPU-side extension ops (pin_memory, async_io/AIO, and the shared-memory comm backend) now build and run under MSVC, the op_builder/build system and build_win.bat support compiling these ops on Windows, and the unit test harness is runnable on Windows. Also fixes a handful of Windows-specific runtime bugs (paths, timers, MSVC OpenMP loop signedness, header include order) and a few unrelated test flakiness issues found along the way, and adds Windows CI and release wheel-build workflows.

Closes #7276
Closes #7057
Relates to #7744, #7523, #7341

Test plan

  • Windows (x64, arm64) CI job (windows-torch-latest.yml) passes
  • Unit test suite run on Windows (tests/unit)
  • Windows wheel build succeeds via the release workflow

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 244dd3e463

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 88 to +91
def is_compatible(self, verbose=False):
if sys.platform == "win32":
# No libaio on Windows; the op is built on native Win32 file I/O instead.
return super().is_compatible(verbose)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Port the CUDA async I/O builder to Windows

This Windows compatibility branch only exists on the CPU accelerator's builder. On a Windows installation with CUDA-enabled PyTorch, CudaAccelerator resolves AsyncIOBuilder from the separate op_builder/async_io.py, which still probes for io_submit and links -laio; consequently AsyncIOBuilder().is_compatible() is false (or its JIT build fails) in CUDA environments, where NVMe offload is most commonly used. Apply the Windows compatibility, compiler, and linker handling to that top-level builder as well.

Useful? React with 👍 / 👎.

Comment on lines +95 to +99
const auto error_code = GetLastError();
report_file_error(
"<aio>", req->_read_op ? "ReadFile" : "WriteFile", static_cast<int>(error_code));
assert(ok && bytes_transferred > 0);
return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Propagate failed Win32 I/O requests

When a post-open ReadFile or WriteFile fails (for example, a full disk, a network filesystem error, or a concurrently truncated file), this path only logs and returns. In release builds where assert is disabled, the submit caller has no failure state and the Windows completion path reports every request as completed, so wait()/pwrite() can report success while the checkpoint or offload data is partial. Preserve and surface the request failure instead of manufacturing a completion.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Install to Windows - fatal error LNK1181 [REQUEST] Publish your Windows Wheels build workflow

1 participant