Support dynamic shard_size when save_only_first_rank = true#260
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces auto-estimation and validation of broadcast_shard_size based on available NPU memory to prevent OOM errors on Ascend devices, along with preallocation of the broadcast merged-buffer pool and explicit stream synchronization to prevent hangs in graph mode. The review feedback highlights several key improvements for robustness and compatibility, including raising a clear error when load_stream is missing, removing the Python 3.10+ strict argument from zip for backward compatibility, preventing potential division-by-zero and type errors, and simplifying the dtype byte-size calculation using PyTorch's built-in element_size().
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
881248b to
c38a72f
Compare
Uh oh!
There was an error while loading. Please reload this page.