Skip to content

fix: Add Pydantic v1, PyTorch 2.11, and NumPy v2 compatibility shims - #1

Open
VAmsIdhAR2340 wants to merge 1 commit into
OSU-Nowlab:nowlab-mainfrom
VAmsIdhAR2340:patch/pydantic-pytorch-2.11-compatibility
Open

fix: Add Pydantic v1, PyTorch 2.11, and NumPy v2 compatibility shims#1
VAmsIdhAR2340 wants to merge 1 commit into
OSU-Nowlab:nowlab-mainfrom
VAmsIdhAR2340:patch/pydantic-pytorch-2.11-compatibility

Conversation

@VAmsIdhAR2340

Copy link
Copy Markdown

The version of DeepSpeed in the OSU repo (0.10.2) was fundamentally incompatible with the modern Python ecosystem required by vLLM and Transformers. Specifically, DeepSpeed was written for Pydantic v1 and older PyTorch elastic APIs, but our stack requires Pydantic v2 and PyTorch 2.11. This caused an endless loop of import errors and strict type-checking crashes during initialization.

Instead of downgrading our stack (which would break vLLM), I applied a global compatibility shim. I rewrote DeepSpeed's imports to use Pydantic's hidden v1 compatibility layer (pydantic.v1). I also patched out a few deprecated PyTorch and NumPy functions that were removed in the newer versions.

Now, DeepSpeed initializes perfectly. The test run executed 5 epochs of training at ~2,500 samples/sec, utilized ZeRO memory optimization.

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.

1 participant