| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…nd compile Three files drain lists front-to-back via .pop(0): - ulysses_sp.py: micro_batches queue for sequence parallel data - superoffload_stage3.py: params_in_ipg_bucket_buffer for gradient bucketing - compile/backend.py: remaining_schedule for compile pass scheduling Each .pop(0) is O(n); switching to collections.deque with .popleft() gives O(1) front removal. Signed-off-by: g97iulio1609 <giulio97.leone@gmail.com>
|
Friendly ping — CI is green and this is ready for review. Happy to address any feedback. Thanks! |
Sorry, something went wrong.
…nd compile (deepspeedai#7880) ## Problem Three files use `.pop(0)` for FIFO queue processing, which is **O(n)** per removal: 1. `ulysses_sp.py`: Micro-batch queue for sequence parallel data sharding 2. `superoffload_stage3.py`: Parameter buffer for IPG gradient bucketing 3. `compile/backend.py`: Compile pass schedule queue ## Solution Switch to `collections.deque` with `.popleft()` for **O(1)** front removal. ## Changes | File | Pattern | |------|---------| | `deepspeed/runtime/sequence_parallel/ulysses_sp.py` | `micro_batches` FIFO queue | | `deepspeed/runtime/superoffload/superoffload_stage3.py` | `params_in_ipg_bucket_buffer` drain loop | | `deepspeed/compile/backend.py` | `remaining_schedule` step-by-step consumption | Signed-off-by: g97iulio1609 <giulio97.leone@gmail.com> Signed-off-by: nathon-lee <leejianwoo@gmail.com>
…nd compile (deepspeedai#7880) ## Problem Three files use `.pop(0)` for FIFO queue processing, which is **O(n)** per removal: 1. `ulysses_sp.py`: Micro-batch queue for sequence parallel data sharding 2. `superoffload_stage3.py`: Parameter buffer for IPG gradient bucketing 3. `compile/backend.py`: Compile pass schedule queue ## Solution Switch to `collections.deque` with `.popleft()` for **O(1)** front removal. ## Changes | File | Pattern | |------|---------| | `deepspeed/runtime/sequence_parallel/ulysses_sp.py` | `micro_batches` FIFO queue | | `deepspeed/runtime/superoffload/superoffload_stage3.py` | `params_in_ipg_bucket_buffer` drain loop | | `deepspeed/compile/backend.py` | `remaining_schedule` step-by-step consumption | Signed-off-by: g97iulio1609 <giulio97.leone@gmail.com> Signed-off-by: nathon-lee <leejianwoo@gmail.com>
| Back | FazBrowse Home | New Git URL |
Problem
Three files use .pop(0) for FIFO queue processing, which is O(n) per removal:
Solution
Switch to collections.deque with .popleft() for O(1) front removal.
Changes